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

Unified Diff: src/gpu/GrDrawTarget.cpp

Issue 1971353003: Abort stencil draws when the attachment fails (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawTarget.cpp
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
index 0db31f29de983f5b9adbe48a1f819b63ea255f46..0af773735660bd2ae3ea1901ed738a397138695c 100644
--- a/src/gpu/GrDrawTarget.cpp
+++ b/src/gpu/GrDrawTarget.cpp
@@ -255,7 +255,9 @@ void GrDrawTarget::drawBatch(const GrPipelineBuilder& pipelineBuilder,
args.fScissor = &appliedClip.scissorState();
args.fHasStencilClip = appliedClip.hasStencilClip();
if (pipelineBuilder.hasUserStencilSettings() || appliedClip.hasStencilClip()) {
- fResourceProvider->attachStencilAttachment(pipelineBuilder.getRenderTarget());
+ if (!fResourceProvider->attachStencilAttachment(pipelineBuilder.getRenderTarget())) {
+ return;
Chris Dalton 2016/05/13 16:56:55 Do we want to fail silently or print a debug messa
bsalomon 2016/05/13 17:43:01 It's probably a good idea to print here for now. W
Chris Dalton 2016/05/13 18:03:08 Done.
+ }
}
batch->getPipelineOptimizations(&args.fOpts);
GrScissorState finalScissor;
@@ -330,6 +332,9 @@ void GrDrawTarget::stencilPath(const GrPipelineBuilder& pipelineBuilder,
GrRenderTarget* rt = pipelineBuilder.getRenderTarget();
GrStencilAttachment* stencilAttachment = fResourceProvider->attachStencilAttachment(rt);
+ if (!stencilAttachment) {
+ return;
+ }
GrBatch* batch = GrStencilPathBatch::Create(viewMatrix,
pipelineBuilder.isHWAntialias(),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698