aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrAppliedClip.h
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-03-21 14:22:38 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-21 23:55:32 +0000
commit54d212e1bfaea0be88c3c40820d0b1ae0daebecf (patch)
treece606e9d88dfd04d592d406881b7e6e5d9a855cf /src/gpu/GrAppliedClip.h
parent337432dc092619431eaa62f13e6347f2272f1fa7 (diff)
Revert "Revert "Remove GrPipeline from GrDrawOp.""
This reverts commit c48af934608bbb65650641f66adb51f2102d4274. Change-Id: I4ba78fd7e5a7d406b88223ca6f7245c029b60f76 Reviewed-on: https://skia-review.googlesource.com/9981 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/GrAppliedClip.h')
-rw-r--r--src/gpu/GrAppliedClip.h28
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