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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 54543008: Revert "Avoid re-rendering stencil clip for every draw with reducable clip stack" (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 1 month 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/GrStencilBuffer.h ('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 d98b005b1993de606b350629bb14659c42904672..0f4b93140ef2ef902164595ba62074b2d62fd786 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -344,15 +344,34 @@ void SkGpuDevice::writePixels(const SkBitmap& bitmap, int x, int y,
config, bitmap.getPixels(), bitmap.rowBytes(), flags);
}
+namespace {
+void purgeClipCB(int genID, void* ) {
+
+ if (SkClipStack::kInvalidGenID == genID ||
+ SkClipStack::kEmptyGenID == genID ||
+ SkClipStack::kWideOpenGenID == genID) {
+ // none of these cases will have a cached clip mask
+ return;
+ }
+
+}
+};
+
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->addPurgeClipCallback(purgeClipCB, fContext);
}
void SkGpuDevice::onDetachFromCanvas() {
INHERITED::onDetachFromCanvas();
+
+ // TODO: iterate through the clip stack and clean up any cached clip masks
+ fClipData.fClipStack->removePurgeClipCallback(purgeClipCB, fContext);
+
fClipData.fClipStack = NULL;
}
« no previous file with comments | « src/gpu/GrStencilBuffer.h ('k') | tests/ClipCacheTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698