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

Unified Diff: src/core/SkCanvas.cpp

Issue 472123002: simplify SkCanvas::init() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 4 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 | « no previous file | no next file » | 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 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()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698