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 #pragma once | 7 #pragma once |
8 | 8 |
9 // The platform-specific device will include the necessary platform headers | 9 // The platform-specific device will include the necessary platform headers |
10 // to get the surface type. | 10 // to get the surface type. |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
107 // Calling SkCanvas' version will create a new device which is not compatible | 107 // Calling SkCanvas' version will create a new device which is not compatible |
108 // with us and we will crash if somebody tries to draw into it with | 108 // with us and we will crash if somebody tries to draw into it with |
109 // CoreGraphics. | 109 // CoreGraphics. |
110 virtual SkDevice* setBitmapDevice(const SkBitmap& bitmap); | 110 virtual SkDevice* setBitmapDevice(const SkBitmap& bitmap); |
111 | 111 |
112 // Disallow copy and assign. | 112 // Disallow copy and assign. |
113 PlatformCanvas(const PlatformCanvas&); | 113 PlatformCanvas(const PlatformCanvas&); |
114 PlatformCanvas& operator=(const PlatformCanvas&); | 114 PlatformCanvas& operator=(const PlatformCanvas&); |
115 }; | 115 }; |
116 | 116 |
117 // Creates a canvas with raster bitmap backing. | |
118 // Set is_opaque if you are going to erase the bitmap and not use | |
119 // transparency: this will enable some optimizations. | |
120 SK_API SkCanvas* CreateBitmapCanvas(int width, int height, bool is_opaque); | |
gwright
2011/04/07 15:28:12
Do we want an is_offscreen parameter here as well?
alokp
2011/04/07 15:57:36
May be. The one I am replacing in webkit does not
| |
121 | |
122 // These calls should surround calls to platform drawing routines, the | |
123 // surface returned here can be used with the native platform routines. | |
124 // | |
125 // Call EndPlatformPaint when you are done and want to use skia operations | |
126 // after calling the platform-specific BeginPlatformPaint; this will | |
127 // synchronize the bitmap to OS if necessary. | |
128 // | |
129 // Note: These functions will eventually replace | |
130 // PlatformCanvas::beginPlatformPaint and PlatformCanvas::endPlatformPaint. | |
131 SK_API PlatformDevice::PlatformSurface BeginPlatformPaint(SkCanvas* canvas); | |
132 SK_API void EndPlatformPaint(SkCanvas* canvas); | |
133 | |
117 } // namespace skia | 134 } // namespace skia |
118 | 135 |
119 #endif // SKIA_EXT_PLATFORM_CANVAS_H_ | 136 #endif // SKIA_EXT_PLATFORM_CANVAS_H_ |
OLD | NEW |