aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/core/SkCanvas.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 7e2609b22d..bab1edca0b 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -385,7 +385,7 @@ SkBaseDevice* SkCanvas::init(SkBaseDevice* device) {
fCachedLocalClipBoundsDirty = true;
fAllowSoftClip = true;
fAllowSimplifyClip = false;
- fDeviceCMDirty = false;
+ fDeviceCMDirty = true;
fSaveLayerCount = 0;
fCullCount = 0;
fMetaData = NULL;
@@ -398,7 +398,12 @@ SkBaseDevice* SkCanvas::init(SkBaseDevice* device) {
fSurfaceBase = NULL;
- return this->setRootDevice(device);
+ if (device) {
+ device->onAttachToCanvas(this);
+ fMCRec->fLayer->fDevice = SkRef(device);
+ fMCRec->fRasterClip.setRect(SkIRect::MakeWH(device->width(), device->height()));
+ }
+ return device;
}
SkCanvas::SkCanvas()