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

Unified Diff: src/core/SkCanvas.cpp

Issue 2180793002: remove fClipStack and attach/deattach-from-canvas (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: no need for attachToCanvas Created 4 years, 5 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 | « src/core/SkBitmapDevice.cpp ('k') | src/core/SkDevice.cpp » ('j') | 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 2cfe8ae2da8b92e65a12b177eb7ef27dea7268fc..ffdcf9d5de5d54cf97909bcb6de381ed3f2e7379 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -207,19 +207,13 @@ struct DeviceCM {
, fClip(conservativeRasterClip)
, fStashedMatrix(stashed)
{
- if (nullptr != device) {
- device->ref();
- device->onAttachToCanvas(canvas);
- }
+ SkSafeRef(device);
fDevice = device;
fPaint = paint ? new SkPaint(*paint) : nullptr;
}
~DeviceCM() {
- if (fDevice) {
- fDevice->onDetachFromCanvas();
- fDevice->unref();
- }
+ SkSafeUnref(fDevice);
delete fPaint;
}
@@ -684,7 +678,6 @@ SkBaseDevice* SkCanvas::init(SkBaseDevice* device, InitFlags flags) {
if (device) {
// The root device and the canvas should always have the same pixel geometry
SkASSERT(fProps.pixelGeometry() == device->surfaceProps().pixelGeometry());
- device->onAttachToCanvas(this);
fMCRec->fLayer->fDevice = SkRef(device);
fMCRec->fRasterClip.setRect(device->getGlobalBounds());
}
« no previous file with comments | « src/core/SkBitmapDevice.cpp ('k') | src/core/SkDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698