Chromium Code Reviews| 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..2dac31278efb4ebe72a55da6ee133fe9448f7251 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(); |
| + SkCanvas* canvas = skia::CreateCanvas(device, RETURN_NULL_ON_FAILURE); |
|
f(malita)
2016/05/11 19:29:37
Ditto.
tomhudson
2016/05/19 12:24:12
Done.
|
| + ScopedPlatformPaint p(canvas); |
| + 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- |