Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Unified Diff: src/core/SkCanvas.cpp

Issue 137833016: add SkCanvas constructor that explicitly creates no_config with dimensions (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkCanvas.h ('k') | src/utils/SkDumpCanvas.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « include/core/SkCanvas.h ('k') | src/utils/SkDumpCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698