Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Side by Side Diff: skia/ext/platform_canvas.h

Issue 10915065: Add PlatformPictureSkia and RecordingPlatformDeviceSkia. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Replace SupportsPlatformPaint() with PlatformPaintSupport() which return one of the following enum … Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 // The platform-specific device will include the necessary platform headers 8 // The platform-specific device will include the necessary platform headers
9 // to get the surface type. 9 // to get the surface type.
10 #include "skia/ext/platform_device.h" 10 #include "skia/ext/platform_device.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 // Set is_opaque if you are going to erase the bitmap and not use 107 // Set is_opaque if you are going to erase the bitmap and not use
108 // transparency: this will enable some optimizations. 108 // transparency: this will enable some optimizations.
109 SK_API SkCanvas* CreateBitmapCanvas(int width, int height, bool is_opaque); 109 SK_API SkCanvas* CreateBitmapCanvas(int width, int height, bool is_opaque);
110 110
111 // Non-crashing version of CreateBitmapCanvas 111 // Non-crashing version of CreateBitmapCanvas
112 // returns NULL if allocation fails for any reason. 112 // returns NULL if allocation fails for any reason.
113 // Use this instead of CreateBitmapCanvas in places that are likely to 113 // Use this instead of CreateBitmapCanvas in places that are likely to
114 // attempt to allocate very large canvases (therefore likely to fail), 114 // attempt to allocate very large canvases (therefore likely to fail),
115 // and where it is possible to recover gracefully from the failed allocation. 115 // and where it is possible to recover gracefully from the failed allocation.
116 SK_API SkCanvas* TryCreateBitmapCanvas(int width, int height, bool is_opaque); 116 SK_API SkCanvas* TryCreateBitmapCanvas(int width, int height, bool is_opaque);
117 117
reed1 2012/09/24 21:04:01 So now a canvas/device will report DIRECT or INDIR
118 // Returns true if native platform routines can be used to draw on the 118 // Returns support for native platform routines.
119 // given canvas. If this function returns false, BeginPlatformPaint will 119 SK_API PlatformDevice::PlatformPaint PlatformPaintSupport(
120 // return NULL PlatformSurface. 120 const SkCanvas* canvas);
121 SK_API bool SupportsPlatformPaint(const SkCanvas* canvas);
122 121
123 // Draws into the a native platform surface, |context|. Forwards to 122 // Draws into the a native platform surface, |context|. Forwards to
124 // DrawToNativeContext on a PlatformDevice instance bound to the top device. 123 // DrawToNativeContext on a PlatformDevice instance bound to the top device.
125 // If no PlatformDevice instance is bound, is a no-operation. 124 // If no PlatformDevice instance is bound, is a no-operation.
126 SK_API void DrawToNativeContext(SkCanvas* canvas, PlatformSurface context, 125 SK_API void DrawToNativeContext(SkCanvas* canvas, PlatformSurface context,
127 int x, int y, const PlatformRect* src_rect); 126 int x, int y, const PlatformRect* src_rect);
128 127
129 // Sets the opacity of each pixel in the specified region to be opaque. 128 // Sets the opacity of each pixel in the specified region to be opaque.
130 SK_API void MakeOpaque(SkCanvas* canvas, int x, int y, int width, int height); 129 SK_API void MakeOpaque(SkCanvas* canvas, int x, int y, int width, int height);
131 130
(...skipping 23 matching lines...) Expand all
155 PlatformSurface platform_surface_; 154 PlatformSurface platform_surface_;
156 155
157 // Disallow copy and assign 156 // Disallow copy and assign
158 ScopedPlatformPaint(const ScopedPlatformPaint&); 157 ScopedPlatformPaint(const ScopedPlatformPaint&);
159 ScopedPlatformPaint& operator=(const ScopedPlatformPaint&); 158 ScopedPlatformPaint& operator=(const ScopedPlatformPaint&);
160 }; 159 };
161 160
162 } // namespace skia 161 } // namespace skia
163 162
164 #endif // SKIA_EXT_PLATFORM_CANVAS_H_ 163 #endif // SKIA_EXT_PLATFORM_CANVAS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698