| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |