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

Side by Side Diff: src/pathops/SkOpEdgeBuilder.cpp

Issue 817283005: use conics for ovals and roundrects (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 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 unified diff | Download patch
« no previous file with comments | « src/core/SkPath.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 #include "SkGeometry.h" 7 #include "SkGeometry.h"
8 #include "SkOpEdgeBuilder.h" 8 #include "SkOpEdgeBuilder.h"
9 #include "SkReduceOrder.h" 9 #include "SkReduceOrder.h"
10 10
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 continue; // skip degenerate points 104 continue; // skip degenerate points
105 } 105 }
106 break; 106 break;
107 case SkPath::kConic_Verb: { 107 case SkPath::kConic_Verb: {
108 const SkPoint* quadPts = quadder.computeQuads(pts, iter.coni cWeight(), 108 const SkPoint* quadPts = quadder.computeQuads(pts, iter.coni cWeight(),
109 quadderTol); 109 quadderTol);
110 const int nQuads = quadder.countQuads(); 110 const int nQuads = quadder.countQuads();
111 for (int i = 0; i < nQuads; ++i) { 111 for (int i = 0; i < nQuads; ++i) {
112 fPathVerbs.push_back(SkPath::kQuad_Verb); 112 fPathVerbs.push_back(SkPath::kQuad_Verb);
113 } 113 }
114 fPathPts.push_back_n(nQuads * 2, quadPts); 114 fPathPts.push_back_n(nQuads * 2, &quadPts[1]);
115 curve[0] = quadPts[nQuads * 2 - 1]; 115 curve[0] = pts[2];
116 lastCurve = true; 116 lastCurve = true;
117 } 117 }
118 continue; 118 continue;
119 case SkPath::kCubic_Verb: 119 case SkPath::kCubic_Verb:
120 force_small_to_zero(&pts[1]); 120 force_small_to_zero(&pts[1]);
121 force_small_to_zero(&pts[2]); 121 force_small_to_zero(&pts[2]);
122 force_small_to_zero(&pts[3]); 122 force_small_to_zero(&pts[3]);
123 curve[1] = pts[1]; 123 curve[1] = pts[1];
124 curve[2] = pts[2]; 124 curve[2] = pts[2];
125 curve[3] = pts[3]; 125 curve[3] = pts[3];
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 return false; 199 return false;
200 } 200 }
201 pointsPtr += SkPathOpsVerbToPoints(verb); 201 pointsPtr += SkPathOpsVerbToPoints(verb);
202 SkASSERT(fCurrentContour); 202 SkASSERT(fCurrentContour);
203 } 203 }
204 if (fCurrentContour && !fAllowOpenContours && !close()) { 204 if (fCurrentContour && !fAllowOpenContours && !close()) {
205 return false; 205 return false;
206 } 206 }
207 return true; 207 return true;
208 } 208 }
OLDNEW
« no previous file with comments | « src/core/SkPath.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698