Chromium Code Reviews| Index: src/gpu/GrClipMaskManager.h |
| diff --git a/src/gpu/GrClipMaskManager.h b/src/gpu/GrClipMaskManager.h |
| index 6995b28276c2b9d218b11a78d9d324b8c7261fe0..ce6cf3fc9210a17875b27a2ef282645ba67089a9 100644 |
| --- a/src/gpu/GrClipMaskManager.h |
| +++ b/src/gpu/GrClipMaskManager.h |
| @@ -22,7 +22,7 @@ |
| #include "SkTLList.h" |
| #include "SkTypes.h" |
| -class GrGpu; |
| +class GrClipTarget; |
| class GrPathRenderer; |
| class GrPathRendererChain; |
| class GrTexture; |
| @@ -39,8 +39,8 @@ class SkPath; |
| class GrClipMaskManager : SkNoncopyable { |
| public: |
| GrClipMaskManager() |
| - : fGpu(NULL) |
| - , fCurrClipMaskType(kNone_ClipMaskType) { |
| + : fCurrClipMaskType(kNone_ClipMaskType) |
| + , fClipTarget(NULL) { |
| } |
| // The state of the scissor is controlled by the clip manager, no one else should set |
| @@ -63,7 +63,7 @@ public: |
| const SkRect* devBounds, |
| GrDrawState::AutoRestoreEffects*, |
| GrDrawState::AutoRestoreStencil*, |
| - ScissorState* scissorState); |
| + ScissorState*); |
| /** |
| * Purge resources to free up memory. TODO: This class shouldn't hold any long lived refs |
| @@ -88,10 +88,19 @@ public: |
| return fAACache.getContext(); |
| } |
| - void setGpu(GrGpu* gpu); |
| + void setClipTarget(GrClipTarget*); |
| + |
| + void adjustPathStencilParams(GrStencilSettings*); |
| - void adjustPathStencilParams(GrStencilSettings* settings); |
| private: |
| + enum PrivateDrawStateStateBits { |
|
bsalomon
2014/10/28 17:53:28
Maybe this sbould be in ClipTarget? Or does clip t
joshualitt
2014/10/28 19:50:30
I'm not sure what you mean, I thought these are on
bsalomon
2014/10/28 19:54:09
Right. Since this bit provides access to setting t
|
| + kFirstBit = (GrDrawState::kLastPublicStateBit << 1), |
| + |
| + kModifyStencilClip_StateBit = kFirstBit, // allows draws to modify |
| + // stencil bits used for |
| + // clipping. |
| + }; |
| + |
| /** |
| * Informs the helper function adjustStencilParams() about how the stencil |
| * buffer clip is being used. |
| @@ -106,21 +115,6 @@ private: |
| kIgnoreClip_StencilClipMode, |
| }; |
| - GrGpu* fGpu; |
| - |
| - /** |
| - * We may represent the clip as a mask in the stencil buffer or as an alpha |
| - * texture. It may be neither because the scissor rect suffices or we |
| - * haven't yet examined the clip. |
| - */ |
| - enum ClipMaskType { |
| - kNone_ClipMaskType, |
| - kStencil_ClipMaskType, |
| - kAlpha_ClipMaskType, |
| - } fCurrClipMaskType; |
| - |
| - GrClipMaskCache fAACache; // cache for the AA path |
| - |
| // 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 GrReducedClip::ElementList&, |
| @@ -195,6 +189,20 @@ private: |
| StencilClipMode mode, |
| int stencilBitCnt); |
| + /** |
| + * We may represent the clip as a mask in the stencil buffer or as an alpha |
| + * texture. It may be neither because the scissor rect suffices or we |
| + * haven't yet examined the clip. |
| + */ |
| + enum ClipMaskType { |
| + kNone_ClipMaskType, |
| + kStencil_ClipMaskType, |
| + kAlpha_ClipMaskType, |
| + } fCurrClipMaskType; |
| + |
| + GrClipMaskCache fAACache; // cache for the AA path |
| + GrClipTarget* fClipTarget; |
| + |
| typedef SkNoncopyable INHERITED; |
| }; |