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

Unified Diff: src/gpu/GrClipMaskManager.cpp

Issue 961813002: Some small code tidying (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 10 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/GrDefaultPathRenderer.h » ('j') | src/gpu/GrDrawTarget.h » ('J')
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 99c74e3c3f5d09133e1da6b667c9e6452e24e886..690c31acb6f6f3eefaa7e8c828a96f2b4d346575 100644
--- a/src/gpu/GrClipMaskManager.cpp
+++ b/src/gpu/GrClipMaskManager.cpp
@@ -30,10 +30,12 @@ typedef SkClipStack::Element Element;
namespace {
// set up the draw state to enable the aa clipping mask. Besides setting up the
// stage matrix this also alters the vertex layout
-void setup_drawstate_aaclip(const SkIRect &devBound,
- GrPipelineBuilder* pipelineBuilder,
- GrTexture* result) {
- SkASSERT(pipelineBuilder);
+void setup_drawstate_aaclip(GrPipelineBuilder* pipelineBuilder,
+ GrTexture* result,
+ GrPipelineBuilder::AutoRestoreEffects* are,
+ const SkIRect &devBound) {
+ SkASSERT(pipelineBuilder && are);
+ are->set(pipelineBuilder);
SkMatrix mat;
// We use device coords to compute the texture coordinates. We set our matrix to be a
@@ -169,7 +171,7 @@ bool GrClipMaskManager::installClipEffects(GrPipelineBuilder* pipelineBuilder,
switch (iter.get()->getType()) {
case SkClipStack::Element::kPath_Type:
fp.reset(GrConvexPolyEffect::Create(edgeType, iter.get()->getPath(),
- &clipToRTOffset));
+ &clipToRTOffset));
break;
case SkClipStack::Element::kRRect_Type: {
SkRRect rrect = iter.get()->getRRect();
@@ -331,11 +333,12 @@ bool GrClipMaskManager::setupClipping(GrPipelineBuilder* pipelineBuilder,
}
if (result) {
+ are->set(pipelineBuilder);
// The mask's top left coord should be pinned to the rounded-out top left corner of
// clipSpace bounds. We determine the mask's position WRT to the render target here.
SkIRect rtSpaceMaskBounds = clipSpaceIBounds;
rtSpaceMaskBounds.offset(-clip.origin());
- setup_drawstate_aaclip(rtSpaceMaskBounds, pipelineBuilder, result);
+ setup_drawstate_aaclip(pipelineBuilder, result, are, rtSpaceMaskBounds);
this->setPipelineBuilderStencil(pipelineBuilder, ars);
return true;
}
« no previous file with comments | « no previous file | src/gpu/GrDefaultPathRenderer.h » ('j') | src/gpu/GrDrawTarget.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698