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

Unified Diff: skia/ext/skia_utils_mac.mm

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « skia/ext/platform_device_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/skia_utils_mac.mm
diff --git a/skia/ext/skia_utils_mac.mm b/skia/ext/skia_utils_mac.mm
index b6351d404eb9a271146a2b3566bc0e6a5970454e..c1f1552321a963b1a5f6e6a13f2251e4b27930f1 100644
--- a/skia/ext/skia_utils_mac.mm
+++ b/skia/ext/skia_utils_mac.mm
@@ -14,7 +14,6 @@
#include "base/mac/scoped_nsobject.h"
#include "skia/ext/bitmap_platform_device_mac.h"
#include "skia/ext/platform_canvas.h"
-#include "third_party/skia/include/core/SkRegion.h"
#include "third_party/skia/include/utils/mac/SkCGUtils.h"
namespace {
@@ -192,10 +191,12 @@ SkBitmap CGImageToSkBitmap(CGImageRef image) {
int width = CGImageGetWidth(image);
int height = CGImageGetHeight(image);
- std::unique_ptr<skia::BitmapPlatformDevice> device(
+ sk_sp<skia::BitmapPlatformDevice> device(
skia::BitmapPlatformDevice::Create(NULL, width, height, false));
- CGContextRef context = device->GetBitmapContext();
+ sk_sp<SkCanvas> canvas(skia::CreateCanvas(device, RETURN_NULL_ON_FAILURE));
+ ScopedPlatformPaint p(canvas.get());
+ CGContextRef context = p.GetPlatformSurface();
// We need to invert the y-axis of the canvas so that Core Graphics drawing
// happens right-side up. Skia has an upper-left origin and CG has a lower-
« no previous file with comments | « skia/ext/platform_device_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698