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 |
11 #include "GrContext.h" | 11 #include "GrContext.h" |
12 #include "GrDrawState.h" | 12 #include "GrDrawState.h" |
13 #include "GrDrawTargetCaps.h" | 13 #include "GrDrawTargetCaps.h" |
14 #include "GrGeometryProcessor.h" | 14 #include "GrGeometryProcessor.h" |
15 #include "GrInvariantOutput.h" | 15 #include "GrInvariantOutput.h" |
16 #include "GrProcessor.h" | 16 #include "GrProcessor.h" |
17 #include "GrPathUtils.h" | 17 #include "GrPathUtils.h" |
18 #include "SkGeometry.h" | |
18 #include "SkString.h" | 19 #include "SkString.h" |
19 #include "SkStrokeRec.h" | 20 #include "SkStrokeRec.h" |
20 #include "SkTraceEvent.h" | 21 #include "SkTraceEvent.h" |
21 #include "gl/GrGLProcessor.h" | 22 #include "gl/GrGLProcessor.h" |
22 #include "gl/GrGLSL.h" | 23 #include "gl/GrGLSL.h" |
23 #include "gl/GrGLGeometryProcessor.h" | 24 #include "gl/GrGLGeometryProcessor.h" |
24 #include "gl/builders/GrGLProgramBuilder.h" | 25 #include "gl/builders/GrGLProgramBuilder.h" |
25 | 26 |
26 GrAAConvexPathRenderer::GrAAConvexPathRenderer() { | 27 GrAAConvexPathRenderer::GrAAConvexPathRenderer() { |
27 } | 28 } |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
300 update_degenerate_test(°enerateData, pts[1]); | 301 update_degenerate_test(°enerateData, pts[1]); |
301 add_line_to_segment(pts[1], segments, devBounds); | 302 add_line_to_segment(pts[1], segments, devBounds); |
302 break; | 303 break; |
303 } | 304 } |
304 case SkPath::kQuad_Verb: | 305 case SkPath::kQuad_Verb: |
305 m.mapPoints(pts, 3); | 306 m.mapPoints(pts, 3); |
306 update_degenerate_test(°enerateData, pts[1]); | 307 update_degenerate_test(°enerateData, pts[1]); |
307 update_degenerate_test(°enerateData, pts[2]); | 308 update_degenerate_test(°enerateData, pts[2]); |
308 add_quad_segment(pts, segments, devBounds); | 309 add_quad_segment(pts, segments, devBounds); |
309 break; | 310 break; |
311 case SkPath::kConic_Verb: { | |
312 m.mapPoints(pts, 3); | |
313 SkScalar weight = iter.conicWeight(); | |
314 SkAutoConicToQuads converter; | |
315 const SkPoint* quadPts = converter.computeQuads(pts, weight, 0.5 f); | |
316 for (int i = 0; i < converter.countQuads(); ++i) { | |
317 add_quad_segment(quadPts + 2*i, segments, devBounds); | |
reed1
2014/12/22 20:04:09
update_degenerate_test twice?
egdaniel
2014/12/22 21:37:13
Done.
| |
318 } | |
319 break; | |
320 } | |
310 case SkPath::kCubic_Verb: { | 321 case SkPath::kCubic_Verb: { |
311 m.mapPoints(pts, 4); | 322 m.mapPoints(pts, 4); |
312 update_degenerate_test(°enerateData, pts[1]); | 323 update_degenerate_test(°enerateData, pts[1]); |
313 update_degenerate_test(°enerateData, pts[2]); | 324 update_degenerate_test(°enerateData, pts[2]); |
314 update_degenerate_test(°enerateData, pts[3]); | 325 update_degenerate_test(°enerateData, pts[3]); |
315 add_cubic_segments(pts, dir, segments, devBounds); | 326 add_cubic_segments(pts, dir, segments, devBounds); |
316 break; | 327 break; |
317 }; | 328 }; |
318 case SkPath::kDone_Verb: | 329 case SkPath::kDone_Verb: |
319 if (degenerateData.isDegenerate()) { | 330 if (degenerateData.isDegenerate()) { |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
758 vOffset, // start vertex | 769 vOffset, // start vertex |
759 0, // start index | 770 0, // start index |
760 draw.fVertexCnt, | 771 draw.fVertexCnt, |
761 draw.fIndexCnt, | 772 draw.fIndexCnt, |
762 &devBounds); | 773 &devBounds); |
763 vOffset += draw.fVertexCnt; | 774 vOffset += draw.fVertexCnt; |
764 } | 775 } |
765 | 776 |
766 return true; | 777 return true; |
767 } | 778 } |
OLD | NEW |