diff options
author | csmartdalton <csmartdalton@google.com> | 2016-11-01 07:03:03 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-11-01 07:03:03 -0700 |
commit | 7cdda99ac34dbe249640be04d2e61bfb0f4b3b09 (patch) | |
tree | 6c9ce4d6cb41534da18d086d7f2cf5f322faef6a /src/gpu/GrRenderTargetContextPriv.h | |
parent | 8a8668b4721097de657ad8b30d45f60f62433c6f (diff) |
TEMPORARY: track stencil clip state in GrRenderTargetOpList
Tracks the stencil clip state in GrRenderTargetOpList instead of
GrStencilAttachment. This is a temporary move to unblock MDB, after
which point we will be able to overhaul clipping.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2468743002
Review-Url: https://codereview.chromium.org/2468743002
Diffstat (limited to 'src/gpu/GrRenderTargetContextPriv.h')
-rw-r--r-- | src/gpu/GrRenderTargetContextPriv.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/gpu/GrRenderTargetContextPriv.h b/src/gpu/GrRenderTargetContextPriv.h index 092fd11c58..83a334b012 100644 --- a/src/gpu/GrRenderTargetContextPriv.h +++ b/src/gpu/GrRenderTargetContextPriv.h @@ -25,6 +25,28 @@ public: return fRenderTargetContext->getOpList()->instancedRendering(); } + // called to note the last clip drawn to the stencil buffer. + // TODO: remove after clipping overhaul. + void setLastClip(int32_t clipStackGenID, + const SkIRect& clipSpaceRect, + const SkIPoint clipOrigin) { + GrRenderTargetOpList* opList = fRenderTargetContext->getOpList(); + opList->fLastClipStackGenID = clipStackGenID; + opList->fLastClipStackRect = clipSpaceRect; + opList->fLastClipOrigin = clipOrigin; + } + + // called to determine if we have to render the clip into SB. + // TODO: remove after clipping overhaul. + bool mustRenderClip(int32_t clipStackGenID, + const SkIRect& clipSpaceRect, + const SkIPoint& clipOrigin) const { + GrRenderTargetOpList* opList = fRenderTargetContext->getOpList(); + return opList->fLastClipStackGenID != clipStackGenID || + opList->fLastClipOrigin != clipOrigin || + !opList->fLastClipStackRect.contains(clipSpaceRect); + } + void clear(const GrFixedClip&, const GrColor, bool canIgnoreClip); void clearStencilClip(const GrFixedClip&, bool insideStencilMask); |