OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "GrDistanceFieldGeoProc.h" | 8 #include "GrDistanceFieldGeoProc.h" |
9 #include "GrFontAtlasSizes.h" | 9 #include "GrFontAtlasSizes.h" |
10 #include "GrInvariantOutput.h" | 10 #include "GrInvariantOutput.h" |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 SkShader::kMirror_TileMode, | 276 SkShader::kMirror_TileMode, |
277 }; | 277 }; |
278 SkShader::TileMode tileModes[] = { | 278 SkShader::TileMode tileModes[] = { |
279 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], | 279 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], |
280 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], | 280 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], |
281 }; | 281 }; |
282 GrTextureParams params(tileModes, random->nextBool() ? GrTextureParams::kBil
erp_FilterMode : | 282 GrTextureParams params(tileModes, random->nextBool() ? GrTextureParams::kBil
erp_FilterMode : |
283 GrTextureParams::kNon
e_FilterMode); | 283 GrTextureParams::kNon
e_FilterMode); |
284 | 284 |
285 return GrDistanceFieldA8TextGeoProc::Create(GrRandomColor(random), | 285 return GrDistanceFieldA8TextGeoProc::Create(GrRandomColor(random), |
286 GrProcessorUnitTest::TestMatrix(
random), | 286 GrTest::TestMatrix(random), |
287 textures[texIdx], params, | 287 textures[texIdx], params, |
288 #ifdef SK_GAMMA_APPLY_TO_A8 | 288 #ifdef SK_GAMMA_APPLY_TO_A8 |
289 random->nextF(), | 289 random->nextF(), |
290 #endif | 290 #endif |
291 random->nextBool() ? | 291 random->nextBool() ? |
292 kSimilarity_DistanceFieldEff
ectFlag : 0, | 292 kSimilarity_DistanceFieldEff
ectFlag : 0, |
293 random->nextBool()); | 293 random->nextBool()); |
294 } | 294 } |
295 | 295 |
296 /////////////////////////////////////////////////////////////////////////////// | 296 /////////////////////////////////////////////////////////////////////////////// |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 SkShader::kMirror_TileMode, | 521 SkShader::kMirror_TileMode, |
522 }; | 522 }; |
523 SkShader::TileMode tileModes[] = { | 523 SkShader::TileMode tileModes[] = { |
524 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], | 524 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], |
525 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], | 525 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], |
526 }; | 526 }; |
527 GrTextureParams params(tileModes, random->nextBool() ? GrTextureParams::kBil
erp_FilterMode | 527 GrTextureParams params(tileModes, random->nextBool() ? GrTextureParams::kBil
erp_FilterMode |
528 : GrTextureParams::kNon
e_FilterMode); | 528 : GrTextureParams::kNon
e_FilterMode); |
529 | 529 |
530 return GrDistanceFieldPathGeoProc::Create(GrRandomColor(random), | 530 return GrDistanceFieldPathGeoProc::Create(GrRandomColor(random), |
531 GrProcessorUnitTest::TestMatrix(ra
ndom), | 531 GrTest::TestMatrix(random), |
532 textures[texIdx], | 532 textures[texIdx], |
533 params, | 533 params, |
534 random->nextBool() ? kSimilarity_DistanceFieldEffectFlag : 0, random->ne
xtBool()); | 534 random->nextBool() ? kSimilarity_DistanceFieldEffectFlag : 0, random->ne
xtBool()); |
535 } | 535 } |
536 | 536 |
537 /////////////////////////////////////////////////////////////////////////////// | 537 /////////////////////////////////////////////////////////////////////////////// |
538 | 538 |
539 struct DistanceFieldLCDBatchTracker { | 539 struct DistanceFieldLCDBatchTracker { |
540 GrGPInput fInputColorType; | 540 GrGPInput fInputColorType; |
541 GrColor fColor; | 541 GrColor fColor; |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
811 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], | 811 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], |
812 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], | 812 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], |
813 }; | 813 }; |
814 GrTextureParams params(tileModes, random->nextBool() ? GrTextureParams::kBil
erp_FilterMode : | 814 GrTextureParams params(tileModes, random->nextBool() ? GrTextureParams::kBil
erp_FilterMode : |
815 GrTextureParams::kNone_FilterMode); | 815 GrTextureParams::kNone_FilterMode); |
816 DistanceAdjust wa = { 0.0f, 0.1f, -0.1f }; | 816 DistanceAdjust wa = { 0.0f, 0.1f, -0.1f }; |
817 uint32_t flags = kUseLCD_DistanceFieldEffectFlag; | 817 uint32_t flags = kUseLCD_DistanceFieldEffectFlag; |
818 flags |= random->nextBool() ? kUniformScale_DistanceFieldEffectMask : 0; | 818 flags |= random->nextBool() ? kUniformScale_DistanceFieldEffectMask : 0; |
819 flags |= random->nextBool() ? kBGR_DistanceFieldEffectFlag : 0; | 819 flags |= random->nextBool() ? kBGR_DistanceFieldEffectFlag : 0; |
820 return GrDistanceFieldLCDTextGeoProc::Create(GrRandomColor(random), | 820 return GrDistanceFieldLCDTextGeoProc::Create(GrRandomColor(random), |
821 GrProcessorUnitTest::TestMatrix
(random), | 821 GrTest::TestMatrix(random), |
822 textures[texIdx], params, | 822 textures[texIdx], params, |
823 wa, | 823 wa, |
824 flags); | 824 flags); |
825 } | 825 } |
OLD | NEW |