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

Unified Diff: src/pathops/SkOpContour.cpp

Issue 1096923003: working on initial winding for cubics (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 8 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/pathops/SkOpContour.h ('k') | src/pathops/SkOpEdgeBuilder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkOpContour.cpp
diff --git a/src/pathops/SkOpContour.cpp b/src/pathops/SkOpContour.cpp
index ab1a37b09a95f68716a76eec5a81d9d0391c9827..ce9439ac2663594f695d749818708c02b0abe6f9 100644
--- a/src/pathops/SkOpContour.cpp
+++ b/src/pathops/SkOpContour.cpp
@@ -10,17 +10,18 @@
#include "SkReduceOrder.h"
#include "SkTSort.h"
-void SkOpContour::addCurve(SkPath::Verb verb, const SkPoint pts[4], SkChunkAlloc* allocator) {
+SkOpSegment* SkOpContour::addCurve(SkPath::Verb verb, const SkPoint pts[4],
+ SkChunkAlloc* allocator) {
switch (verb) {
case SkPath::kLine_Verb: {
SkPoint* ptStorage = SkOpTAllocator<SkPoint>::AllocateArray(allocator, 2);
memcpy(ptStorage, pts, sizeof(SkPoint) * 2);
- appendSegment(allocator).addLine(ptStorage, this);
+ return appendSegment(allocator).addLine(ptStorage, this);
} break;
case SkPath::kQuad_Verb: {
SkPoint* ptStorage = SkOpTAllocator<SkPoint>::AllocateArray(allocator, 3);
memcpy(ptStorage, pts, sizeof(SkPoint) * 3);
- appendSegment(allocator).addQuad(ptStorage, this);
+ return appendSegment(allocator).addQuad(ptStorage, this);
} break;
case SkPath::kConic_Verb: {
SkASSERT(0); // the original curve is a cubic, which will never reduce to a conic
@@ -28,11 +29,12 @@ void SkOpContour::addCurve(SkPath::Verb verb, const SkPoint pts[4], SkChunkAlloc
case SkPath::kCubic_Verb: {
SkPoint* ptStorage = SkOpTAllocator<SkPoint>::AllocateArray(allocator, 4);
memcpy(ptStorage, pts, sizeof(SkPoint) * 4);
- appendSegment(allocator).addCubic(ptStorage, this);
+ return appendSegment(allocator).addCubic(ptStorage, this);
} break;
default:
SkASSERT(0);
}
+ return NULL;
}
SkOpSegment* SkOpContour::nonVerticalSegment(SkOpSpanBase** start, SkOpSpanBase** end) {
« no previous file with comments | « src/pathops/SkOpContour.h ('k') | src/pathops/SkOpEdgeBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698