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

Unified Diff: src/gpu/GrStencilBuffer.h

Issue 939093002: Recycle stencil buffers across render targets. (Closed) Base URL: https://skia.googlesource.com/skia.git@keychange
Patch Set: Address comments 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/GrGpu.cpp ('k') | src/gpu/GrStencilBuffer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrStencilBuffer.h
diff --git a/src/gpu/GrStencilBuffer.h b/src/gpu/GrStencilBuffer.h
index 43d211458195fa5ae60730e345a33212ffea9113..3788e61afc8ab119226ac5ee6f05f6143bca9cd8 100644
--- a/src/gpu/GrStencilBuffer.h
+++ b/src/gpu/GrStencilBuffer.h
@@ -47,7 +47,10 @@ public:
!fLastClipStackRect.contains(clipSpaceRect);
}
- static void ComputeKey(int width, int height, int sampleCnt, GrScratchKey* key);
+ // We create a unique stencil buffer at each width, height and sampleCnt and share it for
+ // all render targets that require a stencil with those params.
+ static void ComputeSharedStencilBufferKey(int width, int height, int sampleCnt,
+ GrUniqueKey* key);
protected:
GrStencilBuffer(GrGpu* gpu, LifeCycle lifeCycle, int width, int height, int bits, int sampleCnt)
@@ -57,11 +60,6 @@ protected:
, fBits(bits)
, fSampleCnt(sampleCnt)
, fLastClipStackGenID(SkClipStack::kInvalidGenID) {
- if (kCached_LifeCycle == lifeCycle) {
- GrScratchKey key;
- ComputeKey(width, height, sampleCnt, &key);
- this->setScratchKey(key);
- }
fLastClipStackRect.setEmpty();
}
« no previous file with comments | « src/gpu/GrGpu.cpp ('k') | src/gpu/GrStencilBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698