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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 | 183 |
184 void onPrepareDraws(Target* target) const override { | 184 void onPrepareDraws(Target* target) const override { |
185 int instanceCount = fGeoData.count(); | 185 int instanceCount = fGeoData.count(); |
186 | 186 |
187 SkMatrix invert; | 187 SkMatrix invert; |
188 if (this->usesLocalCoords() && !this->viewMatrix().invert(&invert)) { | 188 if (this->usesLocalCoords() && !this->viewMatrix().invert(&invert)) { |
189 SkDebugf("Could not invert viewmatrix\n"); | 189 SkDebugf("Could not invert viewmatrix\n"); |
190 return; | 190 return; |
191 } | 191 } |
192 | 192 |
| 193 const SkMatrix& ctm = this->viewMatrix(); |
193 uint32_t flags = 0; | 194 uint32_t flags = 0; |
194 flags |= this->viewMatrix().isSimilarity() ? kSimilarity_DistanceFieldEf
fectFlag : 0; | 195 flags |= ctm.isScaleTranslate() ? kScaleOnly_DistanceFieldEffectFlag : 0
; |
| 196 flags |= ctm.isSimilarity() ? kSimilarity_DistanceFieldEffectFlag : 0; |
195 | 197 |
196 GrTextureParams params(SkShader::kRepeat_TileMode, GrTextureParams::kBil
erp_FilterMode); | 198 GrTextureParams params(SkShader::kRepeat_TileMode, GrTextureParams::kBil
erp_FilterMode); |
197 | 199 |
198 // Setup GrGeometryProcessor | 200 // Setup GrGeometryProcessor |
199 GrBatchAtlas* atlas = fAtlas; | 201 GrBatchAtlas* atlas = fAtlas; |
200 SkAutoTUnref<GrGeometryProcessor> dfProcessor( | 202 SkAutoTUnref<GrGeometryProcessor> dfProcessor( |
201 GrDistanceFieldPathGeoProc::Create(this->color(), | 203 GrDistanceFieldPathGeoProc::Create(this->color(), |
202 this->viewMatrix(), | 204 this->viewMatrix(), |
203 atlas->getTexture(), | 205 atlas->getTexture(), |
204 params, | 206 params, |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
643 geometry.fAntiAlias = random->nextBool(); | 645 geometry.fAntiAlias = random->nextBool(); |
644 geometry.fGenID = random->nextU(); | 646 geometry.fGenID = random->nextU(); |
645 | 647 |
646 return AADistanceFieldPathBatch::Create(geometry, viewMatrix, | 648 return AADistanceFieldPathBatch::Create(geometry, viewMatrix, |
647 gTestStruct.fAtlas, | 649 gTestStruct.fAtlas, |
648 &gTestStruct.fPathCache, | 650 &gTestStruct.fPathCache, |
649 &gTestStruct.fPathList); | 651 &gTestStruct.fPathList); |
650 } | 652 } |
651 | 653 |
652 #endif | 654 #endif |
OLD | NEW |