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

Side by Side Diff: src/gpu/GrPathUtils.cpp

Issue 825443002: Add conic support to Default and AAConvex path redender. (Closed) Base URL: https://skia.googlesource.com/skia.git@conics
Patch Set: Rebase 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/gpu/GrDefaultPathRenderer.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 2011 Google Inc. 2 * Copyright 2011 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 7
8 #include "GrPathUtils.h" 8 #include "GrPathUtils.h"
9 9
10 #include "GrTypes.h" 10 #include "GrTypes.h"
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 SkPath::Iter iter(path, false); 159 SkPath::Iter iter(path, false);
160 SkPath::Verb verb; 160 SkPath::Verb verb;
161 161
162 SkPoint pts[4]; 162 SkPoint pts[4];
163 while ((verb = iter.next(pts)) != SkPath::kDone_Verb) { 163 while ((verb = iter.next(pts)) != SkPath::kDone_Verb) {
164 164
165 switch (verb) { 165 switch (verb) {
166 case SkPath::kLine_Verb: 166 case SkPath::kLine_Verb:
167 pointCount += 1; 167 pointCount += 1;
168 break; 168 break;
169 case SkPath::kConic_Verb: {
170 SkScalar weight = iter.conicWeight();
171 SkAutoConicToQuads converter;
172 const SkPoint* quadPts = converter.computeQuads(pts, weight, 0.2 5f);
173 for (int i = 0; i < converter.countQuads(); ++i) {
174 pointCount += quadraticPointCount(quadPts + 2*i, tol);
175 }
176 }
169 case SkPath::kQuad_Verb: 177 case SkPath::kQuad_Verb:
170 pointCount += quadraticPointCount(pts, tol); 178 pointCount += quadraticPointCount(pts, tol);
171 break; 179 break;
172 case SkPath::kCubic_Verb: 180 case SkPath::kCubic_Verb:
173 pointCount += cubicPointCount(pts, tol); 181 pointCount += cubicPointCount(pts, tol);
174 break; 182 break;
175 case SkPath::kMove_Verb: 183 case SkPath::kMove_Verb:
176 pointCount += 1; 184 pointCount += 1;
177 if (!first) { 185 if (!first) {
178 ++(*subpaths); 186 ++(*subpaths);
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 set_loop_klm(d, controlK, controlL, controlM); 798 set_loop_klm(d, controlK, controlL, controlM);
791 } else if (kCusp_SkCubicType == cType) { 799 } else if (kCusp_SkCubicType == cType) {
792 SkASSERT(0.f == d[0]); 800 SkASSERT(0.f == d[0]);
793 set_cusp_klm(d, controlK, controlL, controlM); 801 set_cusp_klm(d, controlK, controlL, controlM);
794 } else if (kQuadratic_SkCubicType == cType) { 802 } else if (kQuadratic_SkCubicType == cType) {
795 set_quadratic_klm(d, controlK, controlL, controlM); 803 set_quadratic_klm(d, controlK, controlL, controlM);
796 } 804 }
797 805
798 calc_cubic_klm(p, controlK, controlL, controlM, klm, &klm[3], &klm[6]); 806 calc_cubic_klm(p, controlK, controlL, controlM, klm, &klm[3], &klm[6]);
799 } 807 }
OLDNEW
« no previous file with comments | « src/gpu/GrDefaultPathRenderer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698