Index: skia/ext/platform_canvas.cc |
=================================================================== |
--- skia/ext/platform_canvas.cc (revision 97133) |
+++ skia/ext/platform_canvas.cc (working copy) |
@@ -34,6 +34,15 @@ |
return new PlatformCanvas(width, height, is_opaque); |
} |
+SkCanvas* TryCreateBitmapCanvas(int width, int height, bool is_opaque) { |
alokp
2011/08/19 15:34:39
Couldn't you change the existing function to retur
junov1
2011/08/19 15:50:25
There are many places that currently call CreateBi
|
+ PlatformCanvas* canvas = new PlatformCanvas(); |
+ if (!canvas->initialize(width, height, is_opaque)) { |
+ delete canvas; |
+ canvas = NULL; |
+ } |
+ return canvas; |
+} |
+ |
SkDevice* GetTopDevice(const SkCanvas& canvas) { |
SkCanvas::LayerIter iter(const_cast<SkCanvas*>(&canvas), false); |
return iter.device(); |