| Index: src/gpu/GrReducedClip.h
|
| diff --git a/src/gpu/GrReducedClip.h b/src/gpu/GrReducedClip.h
|
| index 731d58f61c561d44e15f5ec6ada527d84c81027f..b8413e6df419172a13be12b0f1f9d2b58b1625b2 100644
|
| --- a/src/gpu/GrReducedClip.h
|
| +++ b/src/gpu/GrReducedClip.h
|
| @@ -8,6 +8,7 @@
|
| #ifndef GrReducedClip_DEFINED
|
| #define GrReducedClip_DEFINED
|
|
|
| +#include "GrWindowRectangles.h"
|
| #include "SkClipStack.h"
|
| #include "SkTLList.h"
|
|
|
| @@ -20,11 +21,11 @@ class GrDrawContext;
|
| */
|
| class SK_API GrReducedClip {
|
| public:
|
| - GrReducedClip(const SkClipStack& stack, const SkRect& queryBounds);
|
| + GrReducedClip(const SkClipStack&, const SkRect& queryBounds, int maxWindowRectangles = 0);
|
|
|
| /**
|
| - * If hasIBounds() is true, this is the bounding box within which the reduced clip is valid, and
|
| - * the caller must not modify any pixels outside this box. Undefined if hasIBounds() is false.
|
| + * If hasIBounds() is true, this is the bounding box within which the clip elements are valid.
|
| + * The caller must not modify any pixels outside this box. Undefined if hasIBounds() is false.
|
| */
|
| const SkIRect& ibounds() const { SkASSERT(fHasIBounds); return fIBounds; }
|
| int left() const { return this->ibounds().left(); }
|
| @@ -38,10 +39,16 @@ public:
|
| */
|
| bool hasIBounds() const { return fHasIBounds; }
|
|
|
| + /**
|
| + * If nonempty, this is a set of "exclusive" windows within which the clip elements are NOT
|
| + * valid. The caller must not modify any pixels inside these windows.
|
| + */
|
| + const GrWindowRectangles& windowRectangles() const { return fWindowRects; }
|
| +
|
| typedef SkTLList<SkClipStack::Element, 16> ElementList;
|
|
|
| /**
|
| - * Populated with a minimal list of elements that implement the clip.
|
| + * Populated with a minimal list of elements required to fully implement the clip.
|
| */
|
| const ElementList& elements() const { return fElements; }
|
|
|
| @@ -67,15 +74,18 @@ public:
|
| bool drawStencilClipMask(GrContext*, GrDrawContext*, const SkIPoint& clipOrigin) const;
|
|
|
| private:
|
| - void walkStack(const SkClipStack&, const SkRect& queryBounds);
|
| + void walkStack(const SkClipStack&, const SkRect& queryBounds, int maxWindowRectangles);
|
| + void addInteriorWindowRectangles(int maxWindowRectangles);
|
| + void addWindowRectangle(const SkRect& elementInteriorRect, bool elementIsAA);
|
| bool intersectIBounds(const SkIRect&);
|
|
|
| - SkIRect fIBounds;
|
| - bool fHasIBounds;
|
| - ElementList fElements;
|
| - int32_t fElementsGenID;
|
| - bool fRequiresAA;
|
| - InitialState fInitialState;
|
| + SkIRect fIBounds;
|
| + bool fHasIBounds;
|
| + GrWindowRectangles fWindowRects;
|
| + ElementList fElements;
|
| + int32_t fElementsGenID;
|
| + bool fRequiresAA;
|
| + InitialState fInitialState;
|
| };
|
|
|
| #endif
|
|
|