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

Unified Diff: src/core/SkEdgeBuilder.cpp

Issue 913503002: cull edges that are to the right of the clip (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 | « no previous file | src/core/SkEdgeClipper.h » ('j') | src/core/SkScan_Path.cpp » ('J')
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 00811203b4edd24ccbf39b19113d912a43c79c53..6a8ea8926aa1f47f6bded526f7b5ba92b6337ad7 100644
--- a/src/core/SkEdgeBuilder.cpp
+++ b/src/core/SkEdgeBuilder.cpp
@@ -80,7 +80,7 @@ static void setShiftedClip(SkRect* dst, const SkIRect& src, int shift) {
}
int SkEdgeBuilder::buildPoly(const SkPath& path, const SkIRect* iclip, int shiftUp,
- bool clipToTheRight) {
+ bool canCullToTheRight) {
SkPath::Iter iter(path, true);
SkPoint pts[4];
SkPath::Verb verb;
@@ -115,7 +115,7 @@ int SkEdgeBuilder::buildPoly(const SkPath& path, const SkIRect* iclip, int shift
break;
case SkPath::kLine_Verb: {
SkPoint lines[SkLineClipper::kMaxPoints];
- int lineCount = SkLineClipper::ClipLine(pts, clip, lines, clipToTheRight);
+ int lineCount = SkLineClipper::ClipLine(pts, clip, lines, canCullToTheRight);
SkASSERT(lineCount <= SkLineClipper::kMaxClippedLineSegments);
for (int i = 0; i < lineCount; i++) {
if (edge->setLine(lines[i], lines[i + 1], shiftUp)) {
@@ -162,13 +162,13 @@ static void handle_quad(SkEdgeBuilder* builder, const SkPoint pts[3]) {
}
int SkEdgeBuilder::build(const SkPath& path, const SkIRect* iclip, int shiftUp,
- bool clipToTheRight) {
+ bool canCullToTheRight) {
fAlloc.reset();
fList.reset();
fShiftUp = shiftUp;
if (SkPath::kLine_SegmentMask == path.getSegmentMasks()) {
- return this->buildPoly(path, iclip, shiftUp, clipToTheRight);
+ return this->buildPoly(path, iclip, shiftUp, canCullToTheRight);
}
SkAutoConicToQuads quadder;
@@ -181,7 +181,7 @@ int SkEdgeBuilder::build(const SkPath& path, const SkIRect* iclip, int shiftUp,
if (iclip) {
SkRect clip;
setShiftedClip(&clip, *iclip, shiftUp);
- SkEdgeClipper clipper;
+ SkEdgeClipper clipper(canCullToTheRight);
while ((verb = iter.next(pts, false)) != SkPath::kDone_Verb) {
switch (verb) {
@@ -192,7 +192,7 @@ int SkEdgeBuilder::build(const SkPath& path, const SkIRect* iclip, int shiftUp,
break;
case SkPath::kLine_Verb: {
SkPoint lines[SkLineClipper::kMaxPoints];
- int lineCount = SkLineClipper::ClipLine(pts, clip, lines, clipToTheRight);
+ int lineCount = SkLineClipper::ClipLine(pts, clip, lines, canCullToTheRight);
for (int i = 0; i < lineCount; i++) {
this->addLine(&lines[i]);
}
« no previous file with comments | « no previous file | src/core/SkEdgeClipper.h » ('j') | src/core/SkScan_Path.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698