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

Unified Diff: src/gpu/GrGpu.cpp

Issue 859013002: Make stencil buffers uncached for uncached render target textures (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 years, 11 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.h ('k') | src/gpu/GrStencilBuffer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrGpu.cpp
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index b7a064ceee613c6e0b3c48b13fe4aa90c636051d..1566aab67f376b4881ca6f6903a2dbba324401dc 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -65,7 +65,7 @@ GrTexture* GrGpu::createTexture(const GrSurfaceDesc& desc, bool budgeted,
!(kNoStencil_GrSurfaceFlag & desc.fFlags)) {
SkASSERT(tex->asRenderTarget());
// TODO: defer this and attach dynamically
- if (!this->attachStencilBufferToRenderTarget(tex->asRenderTarget())) {
+ if (!this->attachStencilBufferToRenderTarget(tex->asRenderTarget(), budgeted)) {
tex->unref();
return NULL;
}
@@ -77,7 +77,7 @@ GrTexture* GrGpu::createTexture(const GrSurfaceDesc& desc, bool budgeted,
return tex;
}
-bool GrGpu::attachStencilBufferToRenderTarget(GrRenderTarget* rt) {
+bool GrGpu::attachStencilBufferToRenderTarget(GrRenderTarget* rt, bool budgeted) {
SkASSERT(NULL == rt->getStencilBuffer());
GrScratchKey sbKey;
GrStencilBuffer::ComputeKey(rt->width(), rt->height(), rt->numSamples(), &sbKey);
@@ -91,7 +91,7 @@ bool GrGpu::attachStencilBufferToRenderTarget(GrRenderTarget* rt) {
}
return attached;
}
- if (this->createStencilBufferForRenderTarget(rt, rt->width(), rt->height())) {
+ if (this->createStencilBufferForRenderTarget(rt, budgeted, rt->width(), rt->height())) {
// Right now we're clearing the stencil buffer here after it is
// attached to an RT for the first time. When we start matching
// stencil buffers with smaller color targets this will no longer
@@ -116,7 +116,7 @@ GrTexture* GrGpu::wrapBackendTexture(const GrBackendTextureDesc& desc) {
// TODO: defer this and attach dynamically
GrRenderTarget* tgt = tex->asRenderTarget();
if (tgt &&
- !this->attachStencilBufferToRenderTarget(tgt)) {
+ !this->attachStencilBufferToRenderTarget(tgt, true /*budgeted*/)) {
tex->unref();
return NULL;
} else {
« no previous file with comments | « src/gpu/GrGpu.h ('k') | src/gpu/GrStencilBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698