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, |