OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 "GrMSAAPathRenderer.h" | 8 #include "GrMSAAPathRenderer.h" |
9 | 9 |
10 #include "GrAuditTrail.h" | 10 #include "GrAuditTrail.h" |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 } | 255 } |
256 | 256 |
257 void computeWorstCasePointCount(const SkPath& path, int* subpaths, int* outL
inePointCount, | 257 void computeWorstCasePointCount(const SkPath& path, int* subpaths, int* outL
inePointCount, |
258 int* outQuadPointCount) const { | 258 int* outQuadPointCount) const { |
259 int linePointCount = 0; | 259 int linePointCount = 0; |
260 int quadPointCount = 0; | 260 int quadPointCount = 0; |
261 *subpaths = 1; | 261 *subpaths = 1; |
262 | 262 |
263 bool first = true; | 263 bool first = true; |
264 | 264 |
265 SkPath::Iter iter(path, false); | 265 SkPath::Iter iter(path, true); |
266 SkPath::Verb verb; | 266 SkPath::Verb verb; |
267 | 267 |
268 SkPoint pts[4]; | 268 SkPoint pts[4]; |
269 while ((verb = iter.next(pts)) != SkPath::kDone_Verb) { | 269 while ((verb = iter.next(pts)) != SkPath::kDone_Verb) { |
270 switch (verb) { | 270 switch (verb) { |
271 case SkPath::kLine_Verb: | 271 case SkPath::kLine_Verb: |
272 linePointCount += 1; | 272 linePointCount += 1; |
273 break; | 273 break; |
274 case SkPath::kConic_Verb: { | 274 case SkPath::kConic_Verb: { |
275 SkScalar weight = iter.conicWeight(); | 275 SkScalar weight = iter.conicWeight(); |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 const SkPath& path, | 467 const SkPath& path, |
468 const SkMatrix& m, | 468 const SkMatrix& m, |
469 SkColor color, | 469 SkColor color, |
470 bool isIndexed) const { | 470 bool isIndexed) const { |
471 { | 471 { |
472 uint16_t subpathIdxStart = (uint16_t) (lines.nextVertex - lines.vert
ices); | 472 uint16_t subpathIdxStart = (uint16_t) (lines.nextVertex - lines.vert
ices); |
473 | 473 |
474 SkPoint pts[4]; | 474 SkPoint pts[4]; |
475 | 475 |
476 bool first = true; | 476 bool first = true; |
477 SkPath::Iter iter(path, false); | 477 SkPath::Iter iter(path, true); |
478 | 478 |
479 bool done = false; | 479 bool done = false; |
480 while (!done) { | 480 while (!done) { |
481 SkPath::Verb verb = iter.next(pts); | 481 SkPath::Verb verb = iter.next(pts); |
482 switch (verb) { | 482 switch (verb) { |
483 case SkPath::kMove_Verb: | 483 case SkPath::kMove_Verb: |
484 if (!first) { | 484 if (!first) { |
485 uint16_t currIdx = (uint16_t) (lines.nextVertex - li
nes.vertices); | 485 uint16_t currIdx = (uint16_t) (lines.nextVertex - li
nes.vertices); |
486 subpathIdxStart = currIdx; | 486 subpathIdxStart = currIdx; |
487 } | 487 } |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
707 | 707 |
708 GrPaint paint; | 708 GrPaint paint; |
709 paint.setXPFactory(GrDisableColorXPFactory::Make()); | 709 paint.setXPFactory(GrDisableColorXPFactory::Make()); |
710 paint.setAntiAlias(args.fIsAA); | 710 paint.setAntiAlias(args.fIsAA); |
711 | 711 |
712 this->internalDrawPath(args.fDrawContext, paint, GrUserStencilSettings::kUnu
sed, *args.fClip, | 712 this->internalDrawPath(args.fDrawContext, paint, GrUserStencilSettings::kUnu
sed, *args.fClip, |
713 *args.fViewMatrix, *args.fShape, true); | 713 *args.fViewMatrix, *args.fShape, true); |
714 } | 714 } |
715 | 715 |
716 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 716 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
OLD | NEW |