aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrClipStackClip.cpp
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/GrClipStackClip.cpp
parente3031b607c7816980d13a3805382afb403fdfa04 (diff)
Converts a drawPaint through a rrect clip to a drawRRect in GrDrawContext.
Diffstat (limited to 'src/gpu/GrClipStackClip.cpp')
-rw-r--r--src/gpu/GrClipStackClip.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/gpu/GrClipStackClip.cpp b/src/gpu/GrClipStackClip.cpp
index 7138f4b68a..8233786ba2 100644
--- a/src/gpu/GrClipStackClip.cpp
+++ b/src/gpu/GrClipStackClip.cpp
@@ -41,6 +41,27 @@ bool GrClipStackClip::quickContains(const SkRRect& rrect) const {
SkIntToScalar(fOrigin.fY)));
}
+bool GrClipStackClip::isRRect(const SkRect& origRTBounds, SkRRect* rr, bool* aa) const {
+ if (!fStack) {
+ return false;
+ }
+ const SkRect* rtBounds = &origRTBounds;
+ SkRect tempRTBounds;
+ bool origin = fOrigin.fX || fOrigin.fY;
+ if (origin) {
+ tempRTBounds = origRTBounds;
+ tempRTBounds.offset(SkIntToScalar(fOrigin.fX), SkIntToScalar(fOrigin.fY));
+ rtBounds = &tempRTBounds;
+ }
+ if (fStack->isRRect(*rtBounds, rr, aa)) {
+ if (origin) {
+ rr->offset(-SkIntToScalar(fOrigin.fX), -SkIntToScalar(fOrigin.fY));
+ }
+ return true;
+ }
+ return false;
+}
+
void GrClipStackClip::getConservativeBounds(int width, int height, SkIRect* devResult,
bool* isIntersectionOfRects) const {
if (!fStack) {