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

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

Issue 1291803006: Simplify parameters passed to path renderers (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add more validate methods Created 5 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 | « src/gpu/GrAADistanceFieldPathRenderer.cpp ('k') | src/gpu/GrDashLinePathRenderer.h » ('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 "GrAAHairLinePathRenderer.h" 8 #include "GrAAHairLinePathRenderer.h"
9 9
10 #include "GrBatchTarget.h" 10 #include "GrBatchTarget.h"
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 bool GrAAHairLinePathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const { 620 bool GrAAHairLinePathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const {
621 if (!args.fAntiAlias) { 621 if (!args.fAntiAlias) {
622 return false; 622 return false;
623 } 623 }
624 624
625 if (!IsStrokeHairlineOrEquivalent(*args.fStroke, *args.fViewMatrix, NULL)) { 625 if (!IsStrokeHairlineOrEquivalent(*args.fStroke, *args.fViewMatrix, NULL)) {
626 return false; 626 return false;
627 } 627 }
628 628
629 if (SkPath::kLine_SegmentMask == args.fPath->getSegmentMasks() || 629 if (SkPath::kLine_SegmentMask == args.fPath->getSegmentMasks() ||
630 args.fTarget->caps()->shaderCaps()->shaderDerivativeSupport()) { 630 args.fShaderCaps->shaderDerivativeSupport()) {
631 return true; 631 return true;
632 } 632 }
633 return false; 633 return false;
634 } 634 }
635 635
636 template <class VertexType> 636 template <class VertexType>
637 bool check_bounds(const SkMatrix& viewMatrix, const SkRect& devBounds, void* ver tices, int vCount) 637 bool check_bounds(const SkMatrix& viewMatrix, const SkRect& devBounds, void* ver tices, int vCount)
638 { 638 {
639 SkRect tolDevBounds = devBounds; 639 SkRect tolDevBounds = devBounds;
640 // The bounds ought to be tight, but in perspective the below code runs the verts 640 // The bounds ought to be tight, but in perspective the below code runs the verts
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
990 GrColor color = GrRandomColor(random); 990 GrColor color = GrRandomColor(random);
991 SkMatrix viewMatrix = GrTest::TestMatrix(random); 991 SkMatrix viewMatrix = GrTest::TestMatrix(random);
992 GrStrokeInfo stroke(SkStrokeRec::kHairline_InitStyle); 992 GrStrokeInfo stroke(SkStrokeRec::kHairline_InitStyle);
993 SkPath path = GrTest::TestPath(random); 993 SkPath path = GrTest::TestPath(random);
994 SkIRect devClipBounds; 994 SkIRect devClipBounds;
995 devClipBounds.setEmpty(); 995 devClipBounds.setEmpty();
996 return create_hairline_batch(color, viewMatrix, path, stroke, devClipBounds) ; 996 return create_hairline_batch(color, viewMatrix, path, stroke, devClipBounds) ;
997 } 997 }
998 998
999 #endif 999 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrAADistanceFieldPathRenderer.cpp ('k') | src/gpu/GrDashLinePathRenderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698