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

Side by Side Diff: src/gpu/GrAAConvexPathRenderer.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 | « no previous file | src/gpu/GrDefaultPathRenderer.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
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
300 update_degenerate_test(&degenerateData, pts[1]); 301 update_degenerate_test(&degenerateData, 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(&degenerateData, pts[1]); 307 update_degenerate_test(&degenerateData, pts[1]);
307 update_degenerate_test(&degenerateData, pts[2]); 308 update_degenerate_test(&degenerateData, 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 update_degenerate_test(&degenerateData, quadPts[2*i + 1]);
318 update_degenerate_test(&degenerateData, quadPts[2*i + 2]);
319 add_quad_segment(quadPts + 2*i, segments, devBounds);
320 }
321 break;
322 }
310 case SkPath::kCubic_Verb: { 323 case SkPath::kCubic_Verb: {
311 m.mapPoints(pts, 4); 324 m.mapPoints(pts, 4);
312 update_degenerate_test(&degenerateData, pts[1]); 325 update_degenerate_test(&degenerateData, pts[1]);
313 update_degenerate_test(&degenerateData, pts[2]); 326 update_degenerate_test(&degenerateData, pts[2]);
314 update_degenerate_test(&degenerateData, pts[3]); 327 update_degenerate_test(&degenerateData, pts[3]);
315 add_cubic_segments(pts, dir, segments, devBounds); 328 add_cubic_segments(pts, dir, segments, devBounds);
316 break; 329 break;
317 }; 330 };
318 case SkPath::kDone_Verb: 331 case SkPath::kDone_Verb:
319 if (degenerateData.isDegenerate()) { 332 if (degenerateData.isDegenerate()) {
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
769 vOffset, // start vertex 782 vOffset, // start vertex
770 0, // start index 783 0, // start index
771 draw.fVertexCnt, 784 draw.fVertexCnt,
772 draw.fIndexCnt, 785 draw.fIndexCnt,
773 &devBounds); 786 &devBounds);
774 vOffset += draw.fVertexCnt; 787 vOffset += draw.fVertexCnt;
775 } 788 }
776 789
777 return true; 790 return true;
778 } 791 }
OLDNEW
« no previous file with comments | « no previous file | src/gpu/GrDefaultPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698