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

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

Issue 1963713002: Replace setMatrixClip() with BeginPlatformPaint() logic (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: compensate for any outstanding saveLayer() calls Created 4 years, 7 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
« no previous file with comments | « skia/ext/bitmap_platform_device_win.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 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 // Gives the pixmap passed in *writable* access to the pixels backing this 133 // Gives the pixmap passed in *writable* access to the pixels backing this
134 // canvas. All writes to the pixmap should be visible if the canvas is 134 // canvas. All writes to the pixmap should be visible if the canvas is
135 // raster-backed. 135 // raster-backed.
136 // 136 //
137 // Returns false on failure: if either argument is nullptr, or if the 137 // Returns false on failure: if either argument is nullptr, or if the
138 // pixels can not be retrieved from the canvas. In the latter case resets 138 // pixels can not be retrieved from the canvas. In the latter case resets
139 // the pixmap to empty. 139 // the pixmap to empty.
140 SK_API bool GetWritablePixels(SkCanvas* canvas, SkPixmap* pixmap); 140 SK_API bool GetWritablePixels(SkCanvas* canvas, SkPixmap* pixmap);
141 141
142 // Returns true if native platform routines can be used to draw on the 142 // Returns true if native platform routines can be used to draw on the
143 // given canvas. If this function returns false, BeginPlatformPaint will 143 // given canvas. If this function returns false,
144 // return NULL PlatformSurface. 144 // ScopedPlatformPaint::GetPlatformSurface() should return NULL.
145 SK_API bool SupportsPlatformPaint(const SkCanvas* canvas); 145 SK_API bool SupportsPlatformPaint(const SkCanvas* canvas);
146 146
147 // This object guards calls to platform drawing routines. The surface 147 // This object guards calls to platform drawing routines. The surface
148 // returned from GetPlatformSurface() can be used with the native platform 148 // returned from GetPlatformSurface() can be used with the native platform
149 // routines. 149 // routines.
150 class SK_API ScopedPlatformPaint { 150 class SK_API ScopedPlatformPaint {
151 public: 151 public:
152 explicit ScopedPlatformPaint(SkCanvas* canvas); 152 explicit ScopedPlatformPaint(SkCanvas* canvas);
153 153
154 // Returns the PlatformSurface to use for native platform drawing calls. 154 // Returns the PlatformSurface to use for native platform drawing calls.
(...skipping 17 matching lines...) Expand all
172 SK_API bool IsPreviewMetafile(const SkCanvas& canvas); 172 SK_API bool IsPreviewMetafile(const SkCanvas& canvas);
173 173
174 // Returns the CGContext that backing the SkCanvas. 174 // Returns the CGContext that backing the SkCanvas.
175 // Returns NULL if none is bound. 175 // Returns NULL if none is bound.
176 SK_API CGContextRef GetBitmapContext(const SkCanvas& canvas); 176 SK_API CGContextRef GetBitmapContext(const SkCanvas& canvas);
177 #endif 177 #endif
178 178
179 } // namespace skia 179 } // namespace skia
180 180
181 #endif // SKIA_EXT_PLATFORM_CANVAS_H_ 181 #endif // SKIA_EXT_PLATFORM_CANVAS_H_
OLDNEW
« no previous file with comments | « skia/ext/bitmap_platform_device_win.cc ('k') | skia/ext/platform_canvas.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698