aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrFixedClip.h
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2016-08-26 10:48:19 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-08-26 10:48:19 -0700
commitcb31e51d9355adb1d25ce3e121cde21b05ecf63e (patch)
tree7a99387e384262d2c33f68301a42dc7911d4b3cc /src/gpu/GrFixedClip.h
parente3031b607c7816980d13a3805382afb403fdfa04 (diff)
Converts a drawPaint through a rrect clip to a drawRRect in GrDrawContext.
Diffstat (limited to 'src/gpu/GrFixedClip.h')
-rw-r--r--src/gpu/GrFixedClip.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gpu/GrFixedClip.h b/src/gpu/GrFixedClip.h
index 01498c1161..705b2eada9 100644
--- a/src/gpu/GrFixedClip.h
+++ b/src/gpu/GrFixedClip.h
@@ -39,6 +39,22 @@ public:
void getConservativeBounds(int width, int height, SkIRect* devResult,
bool* isIntersectionOfRects) const final;
+ bool isRRect(const SkRect& rtBounds, SkRRect* rr, bool* aa) const override {
+ if (fHasStencilClip) {
+ return false;
+ }
+ if (fScissorState.enabled()) {
+ SkRect rect = SkRect::Make(fScissorState.rect());
+ if (!rect.intersects(rtBounds)) {
+ return false;
+ }
+ rr->setRect(rect);
+ *aa = false;
+ return true;
+ }
+ return false;
+ };
+
private:
bool apply(GrContext*, GrDrawContext*, bool useHWAA, bool hasUserStencilSettings,
GrAppliedClip* out) const final;