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

Unified Diff: src/gpu/GrClipMaskManager.cpp

Issue 1416113006: Minor cleanup of clip mask manager (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 2 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 | src/gpu/GrDrawingManager.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrClipMaskManager.cpp
diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp
index 9617e0dc659d16b4086c5afceff919ccb2f7b9bc..076871ca05b25a001f66ef790de30c87d1d7dfd9 100644
--- a/src/gpu/GrClipMaskManager.cpp
+++ b/src/gpu/GrClipMaskManager.cpp
@@ -589,12 +589,7 @@ GrTexture* GrClipMaskManager::createAlphaClipMask(int32_t elementsGenID,
SkRegion::Op op = element->getOp();
bool invert = element->isInverseFilled();
if (invert || SkRegion::kIntersect_Op == op || SkRegion::kReverseDifference_Op == op) {
- GrPipelineBuilder pipelineBuilder;
-
- pipelineBuilder.setClip(clip);
- pipelineBuilder.setRenderTarget(texture->asRenderTarget());
- SkASSERT(pipelineBuilder.getStencil().isDisabled());
GrPathRenderer* pr = GetPathRenderer(this->getContext(),
texture, translate, element);
if (Element::kRect_Type != element->getType() && !pr) {
@@ -605,21 +600,29 @@ GrTexture* GrClipMaskManager::createAlphaClipMask(int32_t elementsGenID,
continue;
}
- // draw directly into the result with the stencil set to make the pixels affected
- // by the clip shape be non-zero.
- GR_STATIC_CONST_SAME_STENCIL(kStencilInElement,
- kReplace_StencilOp,
- kReplace_StencilOp,
- kAlways_StencilFunc,
- 0xffff,
- 0xffff,
- 0xffff);
- pipelineBuilder.setStencil(kStencilInElement);
- set_coverage_drawing_xpf(op, invert, &pipelineBuilder);
-
- if (!this->drawElement(&pipelineBuilder, translate, texture, element, pr)) {
- texture->resourcePriv().removeUniqueKey();
- return nullptr;
+ {
+ GrPipelineBuilder pipelineBuilder;
+
+ pipelineBuilder.setClip(clip);
+ pipelineBuilder.setRenderTarget(texture->asRenderTarget());
+ SkASSERT(pipelineBuilder.getStencil().isDisabled());
+
+ // draw directly into the result with the stencil set to make the pixels affected
+ // by the clip shape be non-zero.
+ GR_STATIC_CONST_SAME_STENCIL(kStencilInElement,
+ kReplace_StencilOp,
+ kReplace_StencilOp,
+ kAlways_StencilFunc,
+ 0xffff,
+ 0xffff,
+ 0xffff);
+ pipelineBuilder.setStencil(kStencilInElement);
+ set_coverage_drawing_xpf(op, invert, &pipelineBuilder);
+
+ if (!this->drawElement(&pipelineBuilder, translate, texture, element, pr)) {
+ texture->resourcePriv().removeUniqueKey();
+ return nullptr;
+ }
}
{
« no previous file with comments | « no previous file | src/gpu/GrDrawingManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698