diff options
author | 2015-02-26 08:47:52 -0800 | |
---|---|---|
committer | 2015-02-26 08:47:52 -0800 | |
commit | 642429e27c6439abff4121f0cba30a7832b4744a (patch) | |
tree | 7a5077116e58c809d46a4d8bae067924a5c02418 /src/gpu/GrClipMaskManager.cpp | |
parent | d2ad8eb5801e2c8c0fa544a6a776bb46eedde2a0 (diff) |
Some small code tidying
BUG=skia:
Review URL: https://codereview.chromium.org/961813002
Diffstat (limited to 'src/gpu/GrClipMaskManager.cpp')
-rw-r--r-- | src/gpu/GrClipMaskManager.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp index 99c74e3c3f..690c31acb6 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; } |