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

Unified Diff: src/gpu/GrClipStackClip.cpp

Issue 2468743002: TEMPORARY: track stencil clip state in GrRenderTargetOpList (Closed)
Patch Set: Created 4 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 | « no previous file | src/gpu/GrRenderTargetContextPriv.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrClipStackClip.cpp
diff --git a/src/gpu/GrClipStackClip.cpp b/src/gpu/GrClipStackClip.cpp
index 7afaa92bd315548a11eca08242056f20f2b509a2..669a9c23a6cd4811010b4be3e17edd9e679b6424 100644
--- a/src/gpu/GrClipStackClip.cpp
+++ b/src/gpu/GrClipStackClip.cpp
@@ -358,10 +358,7 @@ bool GrClipStackClip::apply(GrContext* context, GrRenderTargetContext* renderTar
}
// use the stencil clip if we can't represent the clip as a rectangle.
- // TODO: these need to be swapped over to using a StencilAttachmentProxy
- GrStencilAttachment* stencilAttachment =
- context->resourceProvider()->attachStencilAttachment(rt);
- if (nullptr == stencilAttachment) {
+ if (!context->resourceProvider()->attachStencilAttachment(rt)) {
SkDebugf("WARNING: failed to attach stencil buffer for clip mask. Clip will be ignored.\n");
return true;
}
@@ -369,11 +366,11 @@ bool GrClipStackClip::apply(GrContext* context, GrRenderTargetContext* renderTar
// This relies on the property that a reduced sub-rect of the last clip will contain all the
// relevant window rectangles that were in the last clip. This subtle requirement will go away
// after clipping is overhauled.
- if (stencilAttachment->mustRenderClip(reducedClip.elementsGenID(), reducedClip.ibounds(),
- fOrigin)) {
+ if (renderTargetContext->priv().mustRenderClip(reducedClip.elementsGenID(),
+ reducedClip.ibounds(), fOrigin)) {
reducedClip.drawStencilClipMask(context, renderTargetContext, fOrigin);
- stencilAttachment->setLastClip(reducedClip.elementsGenID(), reducedClip.ibounds(),
- fOrigin);
+ renderTargetContext->priv().setLastClip(reducedClip.elementsGenID(), reducedClip.ibounds(),
+ fOrigin);
}
out->addStencilClip();
return true;
« no previous file with comments | « no previous file | src/gpu/GrRenderTargetContextPriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698