| 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 "GrCustomCoordsTextureEffect.h" | 8 #include "GrCustomCoordsTextureEffect.h" |
| 9 #include "gl/GrGLEffect.h" | 9 #include "gl/GrGLEffect.h" |
| 10 #include "gl/GrGLSL.h" | 10 #include "gl/GrGLSL.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 } | 77 } |
| 78 | 78 |
| 79 const GrBackendEffectFactory& GrCustomCoordsTextureEffect::getFactory() const { | 79 const GrBackendEffectFactory& GrCustomCoordsTextureEffect::getFactory() const { |
| 80 return GrTBackendEffectFactory<GrCustomCoordsTextureEffect>::getInstance(); | 80 return GrTBackendEffectFactory<GrCustomCoordsTextureEffect>::getInstance(); |
| 81 } | 81 } |
| 82 | 82 |
| 83 /////////////////////////////////////////////////////////////////////////////// | 83 /////////////////////////////////////////////////////////////////////////////// |
| 84 | 84 |
| 85 GR_DEFINE_EFFECT_TEST(GrCustomCoordsTextureEffect); | 85 GR_DEFINE_EFFECT_TEST(GrCustomCoordsTextureEffect); |
| 86 | 86 |
| 87 GrEffectRef* GrCustomCoordsTextureEffect::TestCreate(SkRandom* random, | 87 GrEffect* GrCustomCoordsTextureEffect::TestCreate(SkRandom* random, |
| 88 GrContext*, | 88 GrContext*, |
| 89 const GrDrawTargetCaps&, | 89 const GrDrawTargetCaps&, |
| 90 GrTexture* textures[]) { | 90 GrTexture* textures[]) { |
| 91 int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx : | 91 int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx : |
| 92 GrEffectUnitTest::kAlphaTextureIdx; | 92 GrEffectUnitTest::kAlphaTextureIdx; |
| 93 static const SkShader::TileMode kTileModes[] = { | 93 static const SkShader::TileMode kTileModes[] = { |
| 94 SkShader::kClamp_TileMode, | 94 SkShader::kClamp_TileMode, |
| 95 SkShader::kRepeat_TileMode, | 95 SkShader::kRepeat_TileMode, |
| 96 SkShader::kMirror_TileMode, | 96 SkShader::kMirror_TileMode, |
| 97 }; | 97 }; |
| 98 SkShader::TileMode tileModes[] = { | 98 SkShader::TileMode tileModes[] = { |
| 99 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], | 99 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], |
| 100 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], | 100 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], |
| 101 }; | 101 }; |
| 102 GrTextureParams params(tileModes, random->nextBool() ? GrTextureParams::kBil
erp_FilterMode : | 102 GrTextureParams params(tileModes, random->nextBool() ? GrTextureParams::kBil
erp_FilterMode : |
| 103 GrTextureParams::kNon
e_FilterMode); | 103 GrTextureParams::kNon
e_FilterMode); |
| 104 | 104 |
| 105 return GrCustomCoordsTextureEffect::Create(textures[texIdx], params); | 105 return GrCustomCoordsTextureEffect::Create(textures[texIdx], params); |
| 106 } | 106 } |
| OLD | NEW |