diff options
author | bsalomon <bsalomon@google.com> | 2016-08-26 10:48:19 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-08-26 10:48:19 -0700 |
commit | cb31e51d9355adb1d25ce3e121cde21b05ecf63e (patch) | |
tree | 7a99387e384262d2c33f68301a42dc7911d4b3cc /src/gpu/GrFixedClip.h | |
parent | e3031b607c7816980d13a3805382afb403fdfa04 (diff) |
Converts a drawPaint through a rrect clip to a drawRRect in GrDrawContext.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2271053004
Review-Url: https://codereview.chromium.org/2271053004
Diffstat (limited to 'src/gpu/GrFixedClip.h')
-rw-r--r-- | src/gpu/GrFixedClip.h | 16 |
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; |