aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrClip.h
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-03-14 13:42:58 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-14 18:51:49 +0000
commit97180af7f5e577a451367aa0c15cfaff1b6076f5 (patch)
treecd1f78c7a03f0b38306a15a819a25fe7df3aa6f1 /src/gpu/GrClip.h
parent1619c2241ab9d00b0615ef6a63a553e9fe04962c (diff)
Compute clipped draw bounds outside GrAppliedClip.
We will be storing GrAppliedClips alongside ops. The op already stores the clipped bounds. If GrAppliedClip has draw bounds then as ops combine the GrAppliedClip's bounds should be merged to be consistent. However, we won't actually ever use those bounds again so it would be wasteful to merge them. Change-Id: I4ef3010dc04761e256120a2e0e074bc3c6ff6ca1 Reviewed-on: https://skia-review.googlesource.com/9642 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'src/gpu/GrClip.h')
-rw-r--r--src/gpu/GrClip.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/gpu/GrClip.h b/src/gpu/GrClip.h
index eb4eab2d0c..c44653baad 100644
--- a/src/gpu/GrClip.h
+++ b/src/gpu/GrClip.h
@@ -28,8 +28,17 @@ public:
}
virtual void getConservativeBounds(int width, int height, SkIRect* devResult,
bool* isIntersectionOfRects = nullptr) const = 0;
+ /**
+ * This computes a GrAppliedClip from the clip which in turn can be used to build a GrPipeline.
+ * To determine the appropriate clipping implementation the GrClip subclass must know whether
+ * the draw will enable HW AA or uses the stencil buffer. On input 'bounds' is a conservative
+ * bounds of the draw that is to be clipped. After return 'bounds' has been intersected with a
+ * conservative bounds of the clip. A return value of false indicates that the draw can be
+ * skipped as it is fully clipped out.
+ */
virtual bool apply(GrContext*, GrRenderTargetContext*, bool useHWAA,
- bool hasUserStencilSettings, GrAppliedClip* out) const = 0;
+ bool hasUserStencilSettings, GrAppliedClip* result,
+ SkRect* bounds) const = 0;
virtual ~GrClip() {}
@@ -134,7 +143,8 @@ private:
*isIntersectionOfRects = true;
}
}
- bool apply(GrContext*, GrRenderTargetContext*, bool, bool, GrAppliedClip*) const final {
+ bool apply(GrContext*, GrRenderTargetContext*, bool, bool, GrAppliedClip*,
+ SkRect*) const final {
return true;
}
bool isRRect(const SkRect&, SkRRect*, GrAA*) const override { return false; }