Index: src/core/SkCanvas.cpp |
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp |
index 7e2609b22d133c60c3ca2ab06fc2fb2f7dc9708b..bab1edca0b562617d10ccdba9096964a28b640cb 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() |