Chromium Code Reviews| Index: src/gpu/GrClipMaskManager.h |
| diff --git a/src/gpu/GrClipMaskManager.h b/src/gpu/GrClipMaskManager.h |
| index 0c0c10cf30a6eceacf595925e6c4ec6c1d0d4838..aa1a4af16b0db7d77723a6adb6f24da6054ec68b 100644 |
| --- a/src/gpu/GrClipMaskManager.h |
| +++ b/src/gpu/GrClipMaskManager.h |
| @@ -23,6 +23,19 @@ class GrPathRenderer; |
| class GrPathRendererChain; |
| class GrTexture; |
| class SkPath; |
| + |
|
robertphillips
2015/10/07 13:06:43
// informative comment ?
|
| +class GrAppliedClip : public SkNoncopyable { |
| +public: |
| + GrAppliedClip() {} |
| + const GrFragmentProcessor* clipCoverageFragmentProcessor() const { return fClipCoverageFP; } |
| + |
| +private: |
| + SkAutoTUnref<const GrFragmentProcessor> fClipCoverageFP; |
| + friend GrClipMaskManager; |
| + |
| + typedef SkNoncopyable INHERITED; |
| +}; |
| + |
| /** |
| * The clip mask creator handles the generation of the clip mask. If anti |
| * aliasing is requested it will (in the future) generate a single channel |
| @@ -43,10 +56,10 @@ public: |
| * clip. devBounds is optional but can help optimize clipping. |
| */ |
| bool setupClipping(const GrPipelineBuilder&, |
| - GrPipelineBuilder::AutoRestoreFragmentProcessorState*, |
| GrPipelineBuilder::AutoRestoreStencil*, |
| GrScissorState*, |
| - const SkRect* devBounds); |
| + const SkRect* devBounds, |
| + GrAppliedClip*); |
| bool isClipInStencil() const { |
| return kStencil_ClipMaskType == fCurrClipMaskType; |
| @@ -77,11 +90,9 @@ private: |
| // Attempts to install a series of coverage effects to implement the clip. Return indicates |
| // whether the element list was successfully converted to effects. |
| - bool installClipEffects(const GrPipelineBuilder&, |
| - GrPipelineBuilder::AutoRestoreFragmentProcessorState*, |
| - const GrReducedClip::ElementList&, |
| - const SkVector& clipOffset, |
| - const SkRect* devBounds); |
| + const GrFragmentProcessor* getAnalyticClipProcessor(const GrReducedClip::ElementList&, |
| + const SkVector& clipOffset, |
| + const SkRect* devBounds); |
| // Draws the clip into the stencil buffer |
| bool createStencilClipMask(GrRenderTarget*, |
| @@ -164,6 +175,8 @@ private: |
| kAlpha_ClipMaskType, |
| } fCurrClipMaskType; |
| + static const int kMaxAnalyticElements = 4; |
| + |
| GrDrawTarget* fDrawTarget; // This is our owning draw target. |
| StencilClipMode fClipMode; |