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

Unified Diff: skia/ext/platform_canvas.cc

Issue 1963713002: Replace setMatrixClip() with BeginPlatformPaint() logic (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: skia/ext/platform_canvas.cc
diff --git a/skia/ext/platform_canvas.cc b/skia/ext/platform_canvas.cc
index dfd8e8f8a65128a004b7c489370475d407ef409d..98705c3daff4eb2df6d74c32113f2e806e246698 100644
--- a/skia/ext/platform_canvas.cc
+++ b/skia/ext/platform_canvas.cc
@@ -97,7 +97,11 @@ bool IsPreviewMetafile(const SkCanvas& canvas) {
CGContextRef GetBitmapContext(const SkCanvas& canvas) {
SkBaseDevice* device = GetTopDevice(canvas);
PlatformDevice* platform_device = GetPlatformDevice(device);
- return platform_device ? platform_device->GetBitmapContext() :
+ SkIRect clip_bounds;
+ canvas.getClipDeviceBounds(&clip_bounds);
+ return platform_device ?
+ platform_device->GetBitmapContext(
+ canvas.getTotalMatrix(), clip_bounds) :
nullptr;
}
@@ -106,9 +110,14 @@ CGContextRef GetBitmapContext(const SkCanvas& canvas) {
ScopedPlatformPaint::ScopedPlatformPaint(SkCanvas* canvas) :
canvas_(canvas),
platform_surface_(nullptr) {
+ // TODO(tomhudson) we're assuming non-null canvas?
PlatformDevice* platform_device = GetPlatformDevice(GetTopDevice(*canvas));
- if (platform_device)
- platform_surface_ = platform_device->BeginPlatformPaint();
+ if (platform_device) {
+ SkIRect clip_bounds;
+ canvas->getClipDeviceBounds(&clip_bounds);
+ platform_surface_ = platform_device->BeginPlatformPaint(
+ canvas->getTotalMatrix(), clip_bounds);
+ }
}
} // namespace skia

Powered by Google App Engine
This is Rietveld 408576698