diff options
author | reed <reed@google.com> | 2014-08-18 08:02:43 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-08-18 08:02:43 -0700 |
commit | f92c86642a1875da54d54b447f006cb9dfbbb35c (patch) | |
tree | c3255b1223d3e1698cc4266f24ac12bfd3cd9ed2 /src | |
parent | 95498ed2d8ad933d47f41fd97c0ee2feefbc1399 (diff) |
simplify SkCanvas::init()
BUG=skia:
R=robertphillips@google.com
Author: reed@google.com
Review URL: https://codereview.chromium.org/472123002
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkCanvas.cpp | 9 |
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() |