diff options
author | 2015-01-27 00:30:18 -0800 | |
---|---|---|
committer | 2015-01-27 00:30:18 -0800 | |
commit | 36c57dfb4fe9bbaca436942d5eaa75b142ba251d (patch) | |
tree | 2c36bc441b1746f3f36d2f7061abcb1a99741aaf /src/gpu/GrStencilBuffer.h | |
parent | 7f7036ab3fc8bb2f353b3055078ec884e37d67da (diff) |
Make stencil buffers uncached for uncached render target textures
Make new stencil buffers of uncached render target textures not affect the
cache budgets. This is consistent with render buffer storage of uncached
render target textures.
Affects only newly created stencil buffers. An uncached render target
might still receive a cached stencil buffer if such is available from
cache.
BUG=skia:3119
BUG=skia:3301
Review URL: https://codereview.chromium.org/859013002
Diffstat (limited to 'src/gpu/GrStencilBuffer.h')
-rw-r--r-- | src/gpu/GrStencilBuffer.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/gpu/GrStencilBuffer.h b/src/gpu/GrStencilBuffer.h index 883a982ac4..43d2114581 100644 --- a/src/gpu/GrStencilBuffer.h +++ b/src/gpu/GrStencilBuffer.h @@ -50,16 +50,18 @@ public: static void ComputeKey(int width, int height, int sampleCnt, GrScratchKey* key); protected: - GrStencilBuffer(GrGpu* gpu, int width, int height, int bits, int sampleCnt) - : GrGpuResource(gpu, kCached_LifeCycle) + GrStencilBuffer(GrGpu* gpu, LifeCycle lifeCycle, int width, int height, int bits, int sampleCnt) + : GrGpuResource(gpu, lifeCycle) , fWidth(width) , fHeight(height) , fBits(bits) , fSampleCnt(sampleCnt) , fLastClipStackGenID(SkClipStack::kInvalidGenID) { - GrScratchKey key; - ComputeKey(width, height, sampleCnt, &key); - this->setScratchKey(key); + if (kCached_LifeCycle == lifeCycle) { + GrScratchKey key; + ComputeKey(width, height, sampleCnt, &key); + this->setScratchKey(key); + } fLastClipStackRect.setEmpty(); } |