OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2014 Google Inc. | 3 * Copyright 2014 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 "GrAADistanceFieldPathRenderer.h" | 9 #include "GrAADistanceFieldPathRenderer.h" |
10 | 10 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 //////////////////////////////////////////////////////////////////////////////// | 85 //////////////////////////////////////////////////////////////////////////////// |
86 bool GrAADistanceFieldPathRenderer::canDrawPath(const GrDrawTarget* target, | 86 bool GrAADistanceFieldPathRenderer::canDrawPath(const GrDrawTarget* target, |
87 const GrPipelineBuilder* pipelin
eBuilder, | 87 const GrPipelineBuilder* pipelin
eBuilder, |
88 const SkMatrix& viewMatrix, | 88 const SkMatrix& viewMatrix, |
89 const SkPath& path, | 89 const SkPath& path, |
90 const GrStrokeInfo& stroke, | 90 const GrStrokeInfo& stroke, |
91 bool antiAlias) const { | 91 bool antiAlias) const { |
92 | 92 |
93 // TODO: Support inverse fill | 93 // TODO: Support inverse fill |
94 // TODO: Support strokes | 94 // TODO: Support strokes |
95 if (!target->caps()->shaderDerivativeSupport() || !antiAlias || path.isInver
seFillType() | 95 if (!target->caps()->shaderCaps()->shaderDerivativeSupport() || !antiAlias |
96 || path.isVolatile() || !stroke.isFillStyle()) { | 96 || path.isInverseFillType() || path.isVolatile() || !stroke.isFillStyle(
)) { |
97 return false; | 97 return false; |
98 } | 98 } |
99 | 99 |
100 // currently don't support perspective | 100 // currently don't support perspective |
101 if (viewMatrix.hasPerspective()) { | 101 if (viewMatrix.hasPerspective()) { |
102 return false; | 102 return false; |
103 } | 103 } |
104 | 104 |
105 // only support paths smaller than 64x64, scaled to less than 256x256 | 105 // only support paths smaller than 64x64, scaled to less than 256x256 |
106 // the goal is to accelerate rendering of lots of small paths that may be sc
aling | 106 // the goal is to accelerate rendering of lots of small paths that may be sc
aling |
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
608 SkAutoTUnref<GrBatch> batch(AADistanceFieldPathBatch::Create(geometry, color
, viewMatrix, | 608 SkAutoTUnref<GrBatch> batch(AADistanceFieldPathBatch::Create(geometry, color
, viewMatrix, |
609 fAtlas, &fPathC
ache, &fPathList)); | 609 fAtlas, &fPathC
ache, &fPathList)); |
610 | 610 |
611 SkRect bounds = path.getBounds(); | 611 SkRect bounds = path.getBounds(); |
612 viewMatrix.mapRect(&bounds); | 612 viewMatrix.mapRect(&bounds); |
613 target->drawBatch(pipelineBuilder, batch, &bounds); | 613 target->drawBatch(pipelineBuilder, batch, &bounds); |
614 | 614 |
615 return true; | 615 return true; |
616 } | 616 } |
617 | 617 |
OLD | NEW |