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

Side by Side Diff: src/gpu/batches/GrAAConvexPathRenderer.cpp

Issue 1694403003: Modify interface to GrPathUtils::convertCubicToQuads (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: whitespace Created 4 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 unified diff | Download patch
« no previous file with comments | « src/gpu/GrPathUtils.cpp ('k') | src/gpu/batches/GrAAHairLinePathRenderer.cpp » ('j') | 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 /* 2 /*
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "GrAAConvexPathRenderer.h" 9 #include "GrAAConvexPathRenderer.h"
10 10
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 segments->back().fType = Segment::kQuad; 247 segments->back().fType = Segment::kQuad;
248 segments->back().fPts[0] = pts[1]; 248 segments->back().fPts[0] = pts[1];
249 segments->back().fPts[1] = pts[2]; 249 segments->back().fPts[1] = pts[2];
250 } 250 }
251 } 251 }
252 252
253 static inline void add_cubic_segments(const SkPoint pts[4], 253 static inline void add_cubic_segments(const SkPoint pts[4],
254 SkPathPriv::FirstDirection dir, 254 SkPathPriv::FirstDirection dir,
255 SegmentArray* segments) { 255 SegmentArray* segments) {
256 SkSTArray<15, SkPoint, true> quads; 256 SkSTArray<15, SkPoint, true> quads;
257 GrPathUtils::convertCubicToQuads(pts, SK_Scalar1, true, dir, &quads); 257 GrPathUtils::convertCubicToQuadsConstrainToTangents(pts, SK_Scalar1, dir, &q uads);
258 int count = quads.count(); 258 int count = quads.count();
259 for (int q = 0; q < count; q += 3) { 259 for (int q = 0; q < count; q += 3) {
260 add_quad_segment(&quads[q], segments); 260 add_quad_segment(&quads[q], segments);
261 } 261 }
262 } 262 }
263 263
264 static bool get_segments(const SkPath& path, 264 static bool get_segments(const SkPath& path,
265 const SkMatrix& m, 265 const SkMatrix& m,
266 SegmentArray* segments, 266 SegmentArray* segments,
267 SkPoint* fanPt, 267 SkPoint* fanPt,
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after
1025 DRAW_BATCH_TEST_DEFINE(AAConvexPathBatch) { 1025 DRAW_BATCH_TEST_DEFINE(AAConvexPathBatch) {
1026 AAConvexPathBatch::Geometry geometry; 1026 AAConvexPathBatch::Geometry geometry;
1027 geometry.fColor = GrRandomColor(random); 1027 geometry.fColor = GrRandomColor(random);
1028 geometry.fViewMatrix = GrTest::TestMatrixInvertible(random); 1028 geometry.fViewMatrix = GrTest::TestMatrixInvertible(random);
1029 geometry.fPath = GrTest::TestPathConvex(random); 1029 geometry.fPath = GrTest::TestPathConvex(random);
1030 1030
1031 return AAConvexPathBatch::Create(geometry); 1031 return AAConvexPathBatch::Create(geometry);
1032 } 1032 }
1033 1033
1034 #endif 1034 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrPathUtils.cpp ('k') | src/gpu/batches/GrAAHairLinePathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698