diff options
author | Brian Salomon <bsalomon@google.com> | 2018-07-09 10:31:47 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-07-09 14:54:16 +0000 |
commit | 1354048c8fa885b83e414532c011d710590d6b46 (patch) | |
tree | e3fd906497340adbd73e5a1bbebc50c4f4ef4d15 /src/gpu/GrAppliedClip.h | |
parent | 373224c9ab3ae3f13c45f61521e01c282016fde0 (diff) |
Add genIDs from all contributing elements to GrReducedClip's mask key.
Change-Id: I3fed124ba3fefd1ef82acdb4ace9531d0c89ad8b
Reviewed-on: https://skia-review.googlesource.com/138586
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrAppliedClip.h')
-rw-r--r-- | src/gpu/GrAppliedClip.h | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/gpu/GrAppliedClip.h b/src/gpu/GrAppliedClip.h index bfe3383e16..eb136eaccb 100644 --- a/src/gpu/GrAppliedClip.h +++ b/src/gpu/GrAppliedClip.h @@ -27,8 +27,7 @@ public: const GrScissorState& scissorState() const { return fScissorState; } const GrWindowRectsState& windowRectsState() const { return fWindowRectsState; } - uint32_t stencilStackID() const { return fStencilStackID; } - bool hasStencilClip() const { return SkClipStack::kInvalidGenID != fStencilStackID; } + bool hasStencilClip() const { return fHasStencilClip; } /** * Intersects the applied clip with the provided rect. Returns false if the draw became empty. @@ -49,9 +48,9 @@ public: fWindowRectsState.set(windows, mode); } - void addStencilClip(uint32_t stencilStackID) { - SkASSERT(SkClipStack::kInvalidGenID == fStencilStackID); - fStencilStackID = stencilStackID; + void addStencilClip() { + SkASSERT(!fHasStencilClip); + fHasStencilClip = true; } bool doesClip() const { @@ -59,16 +58,15 @@ public: } bool operator==(const GrAppliedHardClip& that) const { - return fScissorState == that.fScissorState && - fWindowRectsState == that.fWindowRectsState && - fStencilStackID == that.fStencilStackID; + return fScissorState == that.fScissorState && fWindowRectsState == that.fWindowRectsState && + fHasStencilClip == that.fHasStencilClip; } bool operator!=(const GrAppliedHardClip& that) const { return !(*this == that); } private: GrScissorState fScissorState; GrWindowRectsState fWindowRectsState; - uint32_t fStencilStackID = SkClipStack::kInvalidGenID; + bool fHasStencilClip = false; }; /** @@ -82,7 +80,6 @@ public: const GrScissorState& scissorState() const { return fHardClip.scissorState(); } const GrWindowRectsState& windowRectsState() const { return fHardClip.windowRectsState(); } - uint32_t stencilStackID() const { return fHardClip.stencilStackID(); } bool hasStencilClip() const { return fHardClip.hasStencilClip(); } int numClipCoverageFragmentProcessors() const { return fClipCoverageFPs.count(); } const GrFragmentProcessor* clipCoverageFragmentProcessor(int i) const { |