| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |