OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "GrAADistanceFieldPathRenderer.h" | 8 #include "GrAADistanceFieldPathRenderer.h" |
9 | 9 |
10 #include "GrBatchFlushState.h" | 10 #include "GrBatchFlushState.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 } | 102 } |
103 // currently don't support perspective | 103 // currently don't support perspective |
104 if (args.fViewMatrix->hasPerspective()) { | 104 if (args.fViewMatrix->hasPerspective()) { |
105 return false; | 105 return false; |
106 } | 106 } |
107 | 107 |
108 // only support paths with bounds within kMediumMIP by kMediumMIP, | 108 // only support paths with bounds within kMediumMIP by kMediumMIP, |
109 // scaled to have bounds within 2.0f*kLargeMIP by 2.0f*kLargeMIP | 109 // scaled to have bounds within 2.0f*kLargeMIP by 2.0f*kLargeMIP |
110 // the goal is to accelerate rendering of lots of small paths that may be sc
aling | 110 // the goal is to accelerate rendering of lots of small paths that may be sc
aling |
111 SkScalar maxScale = args.fViewMatrix->getMaxScale(); | 111 SkScalar maxScale = args.fViewMatrix->getMaxScale(); |
112 SkRect bounds = args.fShape->styledBounds(); | 112 SkRect bounds; |
| 113 args.fShape->styledBounds(&bounds); |
113 SkScalar maxDim = SkMaxScalar(bounds.width(), bounds.height()); | 114 SkScalar maxDim = SkMaxScalar(bounds.width(), bounds.height()); |
114 | 115 |
115 return maxDim <= kMediumMIP && maxDim * maxScale <= 2.0f*kLargeMIP; | 116 return maxDim <= kMediumMIP && maxDim * maxScale <= 2.0f*kLargeMIP; |
116 } | 117 } |
117 | 118 |
118 //////////////////////////////////////////////////////////////////////////////// | 119 //////////////////////////////////////////////////////////////////////////////// |
119 | 120 |
120 // padding around path bounds to allow for antialiased pixels | 121 // padding around path bounds to allow for antialiased pixels |
121 static const SkScalar kAntiAliasPad = 1.0f; | 122 static const SkScalar kAntiAliasPad = 1.0f; |
122 | 123 |
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
627 geometry.fAntiAlias = random->nextBool(); | 628 geometry.fAntiAlias = random->nextBool(); |
628 | 629 |
629 return AADistanceFieldPathBatch::Create(geometry, viewMatrix, | 630 return AADistanceFieldPathBatch::Create(geometry, viewMatrix, |
630 gTestStruct.fAtlas, | 631 gTestStruct.fAtlas, |
631 &gTestStruct.fShapeCache, | 632 &gTestStruct.fShapeCache, |
632 &gTestStruct.fShapeList, | 633 &gTestStruct.fShapeList, |
633 gammaCorrect); | 634 gammaCorrect); |
634 } | 635 } |
635 | 636 |
636 #endif | 637 #endif |
OLD | NEW |