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

Unified Diff: src/core/SkEdgeBuilder.cpp

Issue 882733004: Faster edge re-sort (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 10 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/core/SkEdgeBuilder.h ('k') | src/core/SkLineClipper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkEdgeBuilder.cpp
diff --git a/src/core/SkEdgeBuilder.cpp b/src/core/SkEdgeBuilder.cpp
index 8dcc47a6ce2ccf87a0ce34e5e969817e76c68dad..00811203b4edd24ccbf39b19113d912a43c79c53 100644
--- a/src/core/SkEdgeBuilder.cpp
+++ b/src/core/SkEdgeBuilder.cpp
@@ -79,8 +79,8 @@ static void setShiftedClip(SkRect* dst, const SkIRect& src, int shift) {
SkIntToScalar(src.fBottom >> shift));
}
-int SkEdgeBuilder::buildPoly(const SkPath& path, const SkIRect* iclip,
- int shiftUp) {
+int SkEdgeBuilder::buildPoly(const SkPath& path, const SkIRect* iclip, int shiftUp,
+ bool clipToTheRight) {
SkPath::Iter iter(path, true);
SkPoint pts[4];
SkPath::Verb verb;
@@ -115,7 +115,7 @@ int SkEdgeBuilder::buildPoly(const SkPath& path, const SkIRect* iclip,
break;
case SkPath::kLine_Verb: {
SkPoint lines[SkLineClipper::kMaxPoints];
- int lineCount = SkLineClipper::ClipLine(pts, clip, lines);
+ int lineCount = SkLineClipper::ClipLine(pts, clip, lines, clipToTheRight);
SkASSERT(lineCount <= SkLineClipper::kMaxClippedLineSegments);
for (int i = 0; i < lineCount; i++) {
if (edge->setLine(lines[i], lines[i + 1], shiftUp)) {
@@ -161,14 +161,14 @@ static void handle_quad(SkEdgeBuilder* builder, const SkPoint pts[3]) {
}
}
-int SkEdgeBuilder::build(const SkPath& path, const SkIRect* iclip,
- int shiftUp) {
+int SkEdgeBuilder::build(const SkPath& path, const SkIRect* iclip, int shiftUp,
+ bool clipToTheRight) {
fAlloc.reset();
fList.reset();
fShiftUp = shiftUp;
if (SkPath::kLine_SegmentMask == path.getSegmentMasks()) {
- return this->buildPoly(path, iclip, shiftUp);
+ return this->buildPoly(path, iclip, shiftUp, clipToTheRight);
}
SkAutoConicToQuads quadder;
@@ -192,7 +192,7 @@ int SkEdgeBuilder::build(const SkPath& path, const SkIRect* iclip,
break;
case SkPath::kLine_Verb: {
SkPoint lines[SkLineClipper::kMaxPoints];
- int lineCount = SkLineClipper::ClipLine(pts, clip, lines);
+ int lineCount = SkLineClipper::ClipLine(pts, clip, lines, clipToTheRight);
for (int i = 0; i < lineCount; i++) {
this->addLine(&lines[i]);
}
« no previous file with comments | « src/core/SkEdgeBuilder.h ('k') | src/core/SkLineClipper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698