| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef SKIA_EXT_PLATFORM_CANVAS_H_ | 5 #ifndef SKIA_EXT_PLATFORM_CANVAS_H_ |
| 6 #define SKIA_EXT_PLATFORM_CANVAS_H_ | 6 #define SKIA_EXT_PLATFORM_CANVAS_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 // Gives the pixmap passed in *writable* access to the pixels backing this | 133 // Gives the pixmap passed in *writable* access to the pixels backing this |
| 134 // canvas. All writes to the pixmap should be visible if the canvas is | 134 // canvas. All writes to the pixmap should be visible if the canvas is |
| 135 // raster-backed. | 135 // raster-backed. |
| 136 // | 136 // |
| 137 // Returns false on failure: if either argument is nullptr, or if the | 137 // Returns false on failure: if either argument is nullptr, or if the |
| 138 // pixels can not be retrieved from the canvas. In the latter case resets | 138 // pixels can not be retrieved from the canvas. In the latter case resets |
| 139 // the pixmap to empty. | 139 // the pixmap to empty. |
| 140 SK_API bool GetWritablePixels(SkCanvas* canvas, SkPixmap* pixmap); | 140 SK_API bool GetWritablePixels(SkCanvas* canvas, SkPixmap* pixmap); |
| 141 | 141 |
| 142 // Returns true if native platform routines can be used to draw on the | 142 // Returns true if native platform routines can be used to draw on the |
| 143 // given canvas. If this function returns false, BeginPlatformPaint will | 143 // given canvas. If this function returns false, |
| 144 // return NULL PlatformSurface. | 144 // ScopedPlatformPaint::GetPlatformSurface() should return NULL. |
| 145 SK_API bool SupportsPlatformPaint(const SkCanvas* canvas); | 145 SK_API bool SupportsPlatformPaint(const SkCanvas* canvas); |
| 146 | 146 |
| 147 // This object guards calls to platform drawing routines. The surface | 147 // This object guards calls to platform drawing routines. The surface |
| 148 // returned from GetPlatformSurface() can be used with the native platform | 148 // returned from GetPlatformSurface() can be used with the native platform |
| 149 // routines. | 149 // routines. |
| 150 class SK_API ScopedPlatformPaint { | 150 class SK_API ScopedPlatformPaint { |
| 151 public: | 151 public: |
| 152 explicit ScopedPlatformPaint(SkCanvas* canvas); | 152 explicit ScopedPlatformPaint(SkCanvas* canvas); |
| 153 | 153 |
| 154 // Returns the PlatformSurface to use for native platform drawing calls. | 154 // Returns the PlatformSurface to use for native platform drawing calls. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 172 SK_API bool IsPreviewMetafile(const SkCanvas& canvas); | 172 SK_API bool IsPreviewMetafile(const SkCanvas& canvas); |
| 173 | 173 |
| 174 // Returns the CGContext that backing the SkCanvas. | 174 // Returns the CGContext that backing the SkCanvas. |
| 175 // Returns NULL if none is bound. | 175 // Returns NULL if none is bound. |
| 176 SK_API CGContextRef GetBitmapContext(const SkCanvas& canvas); | 176 SK_API CGContextRef GetBitmapContext(const SkCanvas& canvas); |
| 177 #endif | 177 #endif |
| 178 | 178 |
| 179 } // namespace skia | 179 } // namespace skia |
| 180 | 180 |
| 181 #endif // SKIA_EXT_PLATFORM_CANVAS_H_ | 181 #endif // SKIA_EXT_PLATFORM_CANVAS_H_ |
| OLD | NEW |