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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 48593003: Avoid re-rendering stencil clip for every draw with reducable clip stack (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: gcc-4.2 mac os 10.6 fix 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 4041c411fc1391618b5238c3c85ddd83c13461c3..7630ccd08c3292b5fa3a66631b394a90ce44ae9b 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -344,34 +344,15 @@ 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