simplify SkCanvas::init()

BUG=skia:
R=robertphillips@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/472123002
This commit is contained in:
reed 2014-08-18 08:02:43 -07:00 committed by Commit bot
parent 95498ed2d8
commit f92c86642a

View File

@ -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()