diff options
author | Brian Salomon <bsalomon@google.com> | 2017-03-16 14:19:07 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-03-16 19:10:15 +0000 |
commit | 2bf4b3a97b770811d9e0558dbbfbdb57cfafbdb7 (patch) | |
tree | 3e73ebe67a871db43e4ba9f0a9df3edf15361bca /src/gpu/GrAppliedClip.h | |
parent | 1165b1ef6f069d512c6d5a43ef431b3be6f8c80f (diff) |
Remove GrPipeline from GrDrawOp.
GrDrawOp subclasses are now free to construct their pipelines at flush time and now in theory could use multiple GrPipelines for multipass rendering.
GrProcessorSet may be used to retain the processors from a GrPaint with "pending execution" style refs.
NVPR and Instanced rendering are updated to create their pipelines at flush time without a GrPipelineBuilder.
The monolithic pipeline creation/management that was on GrDrawOp is moved to GrMeshDrawOp. However, this is temporary and will be removed in coming changes.
Change-Id: I124282e3cea5d070970b5460c8a679fcaf7a8eff
Reviewed-on: https://skia-review.googlesource.com/7279
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 | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/src/gpu/GrAppliedClip.h b/src/gpu/GrAppliedClip.h index 57314ec7d4..8488dc4d5d 100644 --- a/src/gpu/GrAppliedClip.h +++ b/src/gpu/GrAppliedClip.h @@ -16,8 +16,12 @@ * Produced by GrClip. It provides a set of modifications to the drawing state that are used to * create the final GrPipeline for a GrOp. */ -class GrAppliedClip : public SkNoncopyable { +class GrAppliedClip { public: + GrAppliedClip() = default; + GrAppliedClip(GrAppliedClip&& that) = default; + GrAppliedClip(const GrAppliedClip&) = delete; + const GrScissorState& scissorState() const { return fScissorState; } const GrWindowRectsState& windowRectsState() const { return fWindowRectsState; } GrFragmentProcessor* clipCoverageFragmentProcessor() const { return fClipCoverageFP.get(); } @@ -52,12 +56,32 @@ public: fHasStencilClip = true; } + bool doesClip() const { + return fScissorState.enabled() || fClipCoverageFP || fHasStencilClip || + fWindowRectsState.enabled(); + } + + bool operator==(const GrAppliedClip& that) const { + if (fScissorState != that.fScissorState || fHasStencilClip != that.fHasStencilClip) { + return false; + } + if (SkToBool(fClipCoverageFP)) { + if (!SkToBool(that.fClipCoverageFP) || + !that.fClipCoverageFP->isEqual(*fClipCoverageFP)) { + return false; + } + } else if (SkToBool(that.fClipCoverageFP)) { + return false; + } + return fWindowRectsState == that.fWindowRectsState; + } + bool operator!=(const GrAppliedClip& that) const { return !(*this == that); } + private: GrScissorState fScissorState; GrWindowRectsState fWindowRectsState; sk_sp<GrFragmentProcessor> fClipCoverageFP; bool fHasStencilClip = false; - typedef SkNoncopyable INHERITED; }; #endif |