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

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: Minor style changes and move skia include to .cpp file. Created 8 years, 3 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 true if native platform routines can be used to draw on the 118 // Returns true if native platform routines can be used to draw on the
119 // given canvas. If this function returns false, BeginPlatformPaint will 119 // given canvas. If this function returns false, BeginPlatformPaint will
120 // return NULL PlatformSurface. 120 // return NULL PlatformSurface.
121 SK_API bool SupportsPlatformPaint(const SkCanvas* canvas); 121 SK_API bool SupportsPlatformPaint(const SkCanvas* canvas);
122 122
123 // Returns true if native platform routines can be used to draw on the
124 // given canvas without any indirect rendering taking place.
alokp 2012/09/17 16:29:30 I am not quite clear on the differences between th
reed1 2012/09/17 16:51:24 +1 -- not sure the diff between these two function
reveman 2012/09/17 21:22:16 Sure, does updating the comment to the following m
nduca 2012/09/18 09:54:24 Done.
nduca 2012/09/18 09:54:24 Would a better tweak for this be to change Support
reveman 2012/09/18 17:56:15 I left this as SupportsPlatformPaint/SupportsDirec
125 SK_API bool SupportsDirectPlatformPaint(const SkCanvas* canvas);
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
132 // These calls should surround calls to platform drawing routines, the 136 // These calls should surround calls to platform drawing routines, the
(...skipping 22 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

Powered by Google App Engine
This is Rietveld 408576698