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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 894693003: Add refcnting to SkClipStack on SkCanvas (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: feedback inc Created 5 years, 10 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/gpu/GrDrawTarget.cpp ('k') | tests/ClipCacheTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGpuDevice.cpp
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 5ed068cc18364ce7bb2b65718c99017f4c9ce9d7..1695f5d681e86f49a04978843c0fdbf7c0576d76 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -280,12 +280,12 @@ void SkGpuDevice::onAttachToCanvas(SkCanvas* canvas) {
INHERITED::onAttachToCanvas(canvas);
// Canvas promises that this ptr is valid until onDetachFromCanvas is called
- fClipData.fClipStack = canvas->getClipStack();
+ fClipData.fClipStack.reset(SkRef(canvas->getClipStack()));
}
void SkGpuDevice::onDetachFromCanvas() {
INHERITED::onDetachFromCanvas();
- fClipData.fClipStack = NULL;
+ fClipData.fClipStack.reset(NULL);
}
// call this every draw call, to ensure that the context reflects our state,
« no previous file with comments | « src/gpu/GrDrawTarget.cpp ('k') | tests/ClipCacheTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698