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

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: Add IsPlatformPaintSupported(), update comment in WebPluginDelegateProxy::Paint and require direct … 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
« no previous file with comments | « content/renderer/webplugin_delegate_proxy.cc ('k') | skia/ext/platform_canvas.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
118 // Returns support for native platform routines.
119 SK_API PlatformDevice::PlatformPaint PlatformPaintSupport(
sky 2012/09/26 21:17:32 Can we have a Get in here, eg GetPlatformPaintSupp
120 const SkCanvas* canvas);
121
118 // Returns true if native platform routines can be used to draw on the 122 // Returns true if native platform routines can be used to draw on the
119 // given canvas. If this function returns false, BeginPlatformPaint will 123 // given canvas. If this function returns false, BeginPlatformPaint will
120 // return NULL PlatformSurface. 124 // return NULL PlatformSurface.
121 SK_API bool SupportsPlatformPaint(const SkCanvas* canvas); 125 SK_API bool IsPlatformPaintSupported(const SkCanvas* canvas);
122 126
123 // Draws into the a native platform surface, |context|. Forwards to 127 // Draws into the a native platform surface, |context|. Forwards to
124 // DrawToNativeContext on a PlatformDevice instance bound to the top device. 128 // DrawToNativeContext on a PlatformDevice instance bound to the top device.
125 // If no PlatformDevice instance is bound, is a no-operation. 129 // If no PlatformDevice instance is bound, is a no-operation.
126 SK_API void DrawToNativeContext(SkCanvas* canvas, PlatformSurface context, 130 SK_API void DrawToNativeContext(SkCanvas* canvas, PlatformSurface context,
127 int x, int y, const PlatformRect* src_rect); 131 int x, int y, const PlatformRect* src_rect);
128 132
129 // Sets the opacity of each pixel in the specified region to be opaque. 133 // 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); 134 SK_API void MakeOpaque(SkCanvas* canvas, int x, int y, int width, int height);
131 135
(...skipping 23 matching lines...) Expand all
155 PlatformSurface platform_surface_; 159 PlatformSurface platform_surface_;
156 160
157 // Disallow copy and assign 161 // Disallow copy and assign
158 ScopedPlatformPaint(const ScopedPlatformPaint&); 162 ScopedPlatformPaint(const ScopedPlatformPaint&);
159 ScopedPlatformPaint& operator=(const ScopedPlatformPaint&); 163 ScopedPlatformPaint& operator=(const ScopedPlatformPaint&);
160 }; 164 };
161 165
162 } // namespace skia 166 } // namespace skia
163 167
164 #endif // SKIA_EXT_PLATFORM_CANVAS_H_ 168 #endif // SKIA_EXT_PLATFORM_CANVAS_H_
OLDNEW
« no previous file with comments | « content/renderer/webplugin_delegate_proxy.cc ('k') | skia/ext/platform_canvas.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698