Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(230)

Unified Diff: src/gpu/GrClipStackClip.cpp

Issue 2271053004: Convert drawPaint to drawRRect in simple cases (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: fix another msvs warning Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrClipStackClip.h ('k') | src/gpu/GrDrawContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrClipStackClip.cpp
diff --git a/src/gpu/GrClipStackClip.cpp b/src/gpu/GrClipStackClip.cpp
index 7138f4b68a1d42bf6211b2a9f1dd36adf556a494..8233786ba2d1686edeedcc4955fdc73f38c7c2cb 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) {
« no previous file with comments | « src/gpu/GrClipStackClip.h ('k') | src/gpu/GrDrawContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698