| Index: skia/ext/platform_canvas_mac.cc
|
| diff --git a/skia/ext/platform_canvas_mac.cc b/skia/ext/platform_canvas_mac.cc
|
| index 7e4c6108ccf4204b1a57f91b69aff3736e24da9e..937346805b2c0bacaf57c0c580063a43141ade61 100644
|
| --- a/skia/ext/platform_canvas_mac.cc
|
| +++ b/skia/ext/platform_canvas_mac.cc
|
| @@ -19,7 +19,7 @@ PlatformCanvas::PlatformCanvas(int width,
|
| bool is_opaque,
|
| CGContextRef context)
|
| : SkCanvas(SkNEW(BitmapPlatformDeviceFactory)) {
|
| - initialize(width, height, is_opaque);
|
| + initialize(context, width, height, is_opaque);
|
| }
|
|
|
| PlatformCanvas::PlatformCanvas(int width,
|
| @@ -37,14 +37,16 @@ bool PlatformCanvas::initialize(int width,
|
| int height,
|
| bool is_opaque,
|
| uint8_t* data) {
|
| - SkDevice* device = BitmapPlatformDevice::CreateWithData(data, width, height,
|
| - is_opaque);
|
| - if (!device)
|
| - return false;
|
| -
|
| - setDevice(device);
|
| - device->unref(); // Was created with refcount 1, and setDevice also refs.
|
| - return true;
|
| + return initializeWithDevice(BitmapPlatformDevice::CreateWithData(
|
| + data, width, height, is_opaque));
|
| +}
|
| +
|
| +bool PlatformCanvas::initialize(CGContextRef context,
|
| + int width,
|
| + int height,
|
| + bool is_opaque) {
|
| + return initializeWithDevice(BitmapPlatformDevice::Create(
|
| + context, width, height, is_opaque));
|
| }
|
|
|
| CGContextRef PlatformCanvas::beginPlatformPaint() {
|
|
|