diff options
Diffstat (limited to 'base')
-rwxr-xr-x | base/gfx/platform_canvas_mac.cc | 16 | ||||
-rwxr-xr-x | base/gfx/platform_canvas_mac.h | 3 |
2 files changed, 10 insertions, 9 deletions
diff --git a/base/gfx/platform_canvas_mac.cc b/base/gfx/platform_canvas_mac.cc index 102655c..2777dee 100755 --- a/base/gfx/platform_canvas_mac.cc +++ b/base/gfx/platform_canvas_mac.cc @@ -14,7 +14,7 @@ PlatformCanvasMac::PlatformCanvasMac() : SkCanvas() { PlatformCanvasMac::PlatformCanvasMac(int width, int height, bool is_opaque) : SkCanvas() { - initialize(width, height, is_opaque, NULL); + initialize(width, height, is_opaque); } PlatformCanvasMac::PlatformCanvasMac(int width, @@ -22,20 +22,22 @@ PlatformCanvasMac::PlatformCanvasMac(int width, bool is_opaque, CGContextRef context) : SkCanvas() { - initialize(width, height, is_opaque, context); + initialize(width, height, is_opaque); } PlatformCanvasMac::~PlatformCanvasMac() { } -void PlatformCanvasMac::initialize(int width, +bool PlatformCanvasMac::initialize(int width, int height, - bool is_opaque, - CGContextRef context) { - SkDevice* device = - createPlatformDevice(width, height, is_opaque, context); + bool is_opaque) { + SkDevice* device = createPlatformDevice(width, height, is_opaque, NULL); + if (!device) + return false; + setDevice(device); device->unref(); // was created with refcount 1, and setDevice also refs + return true; } CGContextRef PlatformCanvasMac::beginPlatformPaint() { diff --git a/base/gfx/platform_canvas_mac.h b/base/gfx/platform_canvas_mac.h index 562b1a0..3f79fb3 100755 --- a/base/gfx/platform_canvas_mac.h +++ b/base/gfx/platform_canvas_mac.h @@ -28,8 +28,7 @@ class PlatformCanvasMac : public SkCanvas { virtual ~PlatformCanvasMac(); // For two-part init, call if you use the no-argument constructor above - void initialize(int width, int height, bool is_opaque, CGContextRef context); - + bool initialize(int width, int height, bool is_opaque); // These calls should surround calls to platform drawing routines. The CG // context returned by beginPlatformPaint is the one that can be used to |