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

Unified Diff: src/gpu/SkGpuDevice.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/gpu/SkGpuDevice.h ('k') | src/pdf/SkPDFDevice.h » ('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 873256d15f848164c0394f387f3dc64947425afb..f3fd23f628424d0d90db0d87e27e9f6f95a4f084 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -287,30 +287,12 @@ bool SkGpuDevice::onAccessPixels(SkPixmap* pmap) {
return false;
}
-void SkGpuDevice::onAttachToCanvas(SkCanvas* canvas) {
- ASSERT_SINGLE_OWNER
- INHERITED::onAttachToCanvas(canvas);
-
- // Canvas promises that this ptr is valid until onDetachFromCanvas is called
- fClipStack.reset(SkRef(canvas->getClipStack()));
-}
-
-void SkGpuDevice::onDetachFromCanvas() {
- ASSERT_SINGLE_OWNER
- INHERITED::onDetachFromCanvas();
- fClip.reset();
- fClipStack.reset(nullptr);
-}
-
// call this every draw call, to ensure that the context reflects our state,
// and not the state from some other canvas/device
void SkGpuDevice::prepareDraw(const SkDraw& draw) {
ASSERT_SINGLE_OWNER
- SkASSERT(fClipStack.get());
-
- SkASSERT(draw.fClipStack && draw.fClipStack == fClipStack);
- fClip.reset(fClipStack, &this->getOrigin());
+ fClip.reset(draw.fClipStack, &this->getOrigin());
}
GrDrawContext* SkGpuDevice::accessDrawContext() {
« no previous file with comments | « src/gpu/SkGpuDevice.h ('k') | src/pdf/SkPDFDevice.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698