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

Unified Diff: src/core/SkPath.cpp

Issue 15080010: Add special handling of rectori case for gpu (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Added unit test Created 7 years, 7 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 | « include/gpu/GrAARectRenderer.h ('k') | src/effects/SkDashPathEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPath.cpp
===================================================================
--- src/core/SkPath.cpp (revision 9163)
+++ src/core/SkPath.cpp (working copy)
@@ -600,17 +600,18 @@
return isRectContour(false, &currVerb, &pts, isClosed, direction);
}
-bool SkPath::isNestedRects(SkRect rects[2]) const {
+bool SkPath::isNestedRects(SkRect rects[2], Direction dirs[2]) const {
SkDEBUGCODE(this->validate();)
int currVerb = 0;
const SkPoint* pts = fPathRef->points();
const SkPoint* first = pts;
- if (!isRectContour(true, &currVerb, &pts, NULL, NULL)) {
+ Direction testDirs[2];
+ if (!isRectContour(true, &currVerb, &pts, NULL, &testDirs[0])) {
return false;
}
const SkPoint* last = pts;
SkRect testRects[2];
- if (isRectContour(false, &currVerb, &pts, NULL, NULL)) {
+ if (isRectContour(false, &currVerb, &pts, NULL, &testDirs[1])) {
testRects[0].set(first, SkToS32(last - first));
testRects[1].set(last, SkToS32(pts - last));
if (testRects[0].contains(testRects[1])) {
@@ -618,6 +619,10 @@
rects[0] = testRects[0];
rects[1] = testRects[1];
}
+ if (dirs) {
+ dirs[0] = testDirs[0];
+ dirs[1] = testDirs[1];
+ }
return true;
}
if (testRects[1].contains(testRects[0])) {
@@ -625,6 +630,10 @@
rects[0] = testRects[1];
rects[1] = testRects[0];
}
+ if (dirs) {
+ dirs[0] = testDirs[1];
+ dirs[1] = testDirs[0];
+ }
return true;
}
}
« no previous file with comments | « include/gpu/GrAARectRenderer.h ('k') | src/effects/SkDashPathEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698