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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 | 114 |
115 // Gives the pixmap passed in *writable* access to the pixels backing this | 115 // Gives the pixmap passed in *writable* access to the pixels backing this |
116 // canvas. All writes to the pixmap should be visible if the canvas is | 116 // canvas. All writes to the pixmap should be visible if the canvas is |
117 // raster-backed. | 117 // raster-backed. |
118 // | 118 // |
119 // Returns false on failure: if either argument is nullptr, or if the | 119 // Returns false on failure: if either argument is nullptr, or if the |
120 // pixels can not be retrieved from the canvas. In the latter case resets | 120 // pixels can not be retrieved from the canvas. In the latter case resets |
121 // the pixmap to empty. | 121 // the pixmap to empty. |
122 SK_API bool GetWritablePixels(SkCanvas* canvas, SkPixmap* pixmap); | 122 SK_API bool GetWritablePixels(SkCanvas* canvas, SkPixmap* pixmap); |
123 | 123 |
124 // Returns true if native platform routines can be used to draw on the | |
125 // given canvas. If this function returns false, | |
126 // GetNativeDrawingContext() should return NULL. | |
127 SK_API bool SupportsPlatformPaint(const SkCanvas* canvas); | |
128 | |
129 // Returns the NativeDrawingContext to use for native platform drawing calls. | 124 // Returns the NativeDrawingContext to use for native platform drawing calls. |
130 SK_API NativeDrawingContext GetNativeDrawingContext(SkCanvas* canvas); | 125 SK_API NativeDrawingContext GetNativeDrawingContext(SkCanvas* canvas); |
131 | 126 |
132 // Following routines are used in print preview workflow to mark the | 127 // Following routines are used in print preview workflow to mark the |
133 // preview metafile. | 128 // preview metafile. |
134 SK_API SkMetaData& GetMetaData(const SkCanvas& canvas); | 129 SK_API SkMetaData& GetMetaData(const SkCanvas& canvas); |
135 | 130 |
136 #if defined(OS_MACOSX) | 131 #if defined(OS_MACOSX) |
137 SK_API void SetIsPreviewMetafile(const SkCanvas& canvas, bool is_preview); | 132 SK_API void SetIsPreviewMetafile(const SkCanvas& canvas, bool is_preview); |
138 SK_API bool IsPreviewMetafile(const SkCanvas& canvas); | 133 SK_API bool IsPreviewMetafile(const SkCanvas& canvas); |
139 #endif | 134 #endif |
140 | 135 |
141 } // namespace skia | 136 } // namespace skia |
142 | 137 |
143 #endif // SKIA_EXT_PLATFORM_CANVAS_H_ | 138 #endif // SKIA_EXT_PLATFORM_CANVAS_H_ |
OLD | NEW |