Index: src/core/SkCanvas.cpp |
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp |
index a5fa30ff2d7a6946e8c5e32d1ca9f786f7d6275c..45c196448d299c73ece1bf051e11829248a493f6 100644 |
--- a/src/core/SkCanvas.cpp |
+++ b/src/core/SkCanvas.cpp |
@@ -505,21 +505,34 @@ SkBaseDevice* SkCanvas::init(SkBaseDevice* device) { |
} |
SkCanvas::SkCanvas() |
-: fMCStack(sizeof(MCRec), fMCRecStorage, sizeof(fMCRecStorage)) { |
+ : fMCStack(sizeof(MCRec), fMCRecStorage, sizeof(fMCRecStorage)) |
+{ |
inc_canvas(); |
- |
+ |
this->init(NULL); |
} |
+SkCanvas::SkCanvas(int width, int height) |
+ : fMCStack(sizeof(MCRec), fMCRecStorage, sizeof(fMCRecStorage)) |
+{ |
+ inc_canvas(); |
+ |
+ SkBitmap bitmap; |
+ bitmap.setConfig(SkBitmap::kNo_Config, width, height); |
+ this->init(SkNEW_ARGS(SkBitmapDevice, (bitmap)))->unref(); |
+} |
+ |
SkCanvas::SkCanvas(SkBaseDevice* device) |
- : fMCStack(sizeof(MCRec), fMCRecStorage, sizeof(fMCRecStorage)) { |
+ : fMCStack(sizeof(MCRec), fMCRecStorage, sizeof(fMCRecStorage)) |
+{ |
inc_canvas(); |
this->init(device); |
} |
SkCanvas::SkCanvas(const SkBitmap& bitmap) |
- : fMCStack(sizeof(MCRec), fMCRecStorage, sizeof(fMCRecStorage)) { |
+ : fMCStack(sizeof(MCRec), fMCRecStorage, sizeof(fMCRecStorage)) |
+{ |
inc_canvas(); |
this->init(SkNEW_ARGS(SkBitmapDevice, (bitmap)))->unref(); |