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

Side by Side Diff: src/gpu/GrDefaultPathRenderer.cpp

Issue 418073002: Alter Default & Software path renderers to better handle AA hairline paths (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update to ToT Created 6 years, 4 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/GrSoftwarePathRenderer.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 * Copyright 2011 Google Inc. 2 * Copyright 2011 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 "GrDefaultPathRenderer.h" 8 #include "GrDefaultPathRenderer.h"
9 9
10 #include "GrContext.h" 10 #include "GrContext.h"
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 } 506 }
507 return true; 507 return true;
508 } 508 }
509 509
510 bool GrDefaultPathRenderer::canDrawPath(const SkPath& path, 510 bool GrDefaultPathRenderer::canDrawPath(const SkPath& path,
511 const SkStrokeRec& stroke, 511 const SkStrokeRec& stroke,
512 const GrDrawTarget* target, 512 const GrDrawTarget* target,
513 bool antiAlias) const { 513 bool antiAlias) const {
514 // this class can draw any path with any fill but doesn't do any anti-aliasi ng. 514 // this class can draw any path with any fill but doesn't do any anti-aliasi ng.
515 515
516 return !antiAlias && 516 return !antiAlias && !(SkPath::kConic_SegmentMask & path.getSegmentMasks()) &&
517 (stroke.isFillStyle() || 517 (stroke.isFillStyle() ||
518 IsStrokeHairlineOrEquivalent(stroke, target->getDrawState().getViewMatr ix(), NULL)); 518 IsStrokeHairlineOrEquivalent(stroke, target->getDrawState().getViewMatr ix(), NULL));
519 } 519 }
520 520
521 bool GrDefaultPathRenderer::onDrawPath(const SkPath& path, 521 bool GrDefaultPathRenderer::onDrawPath(const SkPath& path,
522 const SkStrokeRec& stroke, 522 const SkStrokeRec& stroke,
523 GrDrawTarget* target, 523 GrDrawTarget* target,
524 bool antiAlias) { 524 bool antiAlias) {
525 return this->internalDrawPath(path, 525 return this->internalDrawPath(path,
526 stroke, 526 stroke,
527 target, 527 target,
528 false); 528 false);
529 } 529 }
530 530
531 void GrDefaultPathRenderer::onStencilPath(const SkPath& path, 531 void GrDefaultPathRenderer::onStencilPath(const SkPath& path,
532 const SkStrokeRec& stroke, 532 const SkStrokeRec& stroke,
533 GrDrawTarget* target) { 533 GrDrawTarget* target) {
534 SkASSERT(SkPath::kInverseEvenOdd_FillType != path.getFillType()); 534 SkASSERT(SkPath::kInverseEvenOdd_FillType != path.getFillType());
535 SkASSERT(SkPath::kInverseWinding_FillType != path.getFillType()); 535 SkASSERT(SkPath::kInverseWinding_FillType != path.getFillType());
536 this->internalDrawPath(path, stroke, target, true); 536 this->internalDrawPath(path, stroke, target, true);
537 } 537 }
OLDNEW
« no previous file with comments | « no previous file | src/gpu/GrSoftwarePathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698