OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "GrSimpleTextureEffect.h" | 8 #include "GrSimpleTextureEffect.h" |
9 #include "gl/GrGLEffect.h" | 9 #include "gl/GrGLEffect.h" |
10 #include "gl/GrGLEffectMatrix.h" | 10 #include "gl/GrGLEffectMatrix.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 } | 96 } |
97 | 97 |
98 const GrBackendEffectFactory& GrSimpleTextureEffect::getFactory() const { | 98 const GrBackendEffectFactory& GrSimpleTextureEffect::getFactory() const { |
99 return GrTBackendEffectFactory<GrSimpleTextureEffect>::getInstance(); | 99 return GrTBackendEffectFactory<GrSimpleTextureEffect>::getInstance(); |
100 } | 100 } |
101 | 101 |
102 /////////////////////////////////////////////////////////////////////////////// | 102 /////////////////////////////////////////////////////////////////////////////// |
103 | 103 |
104 GR_DEFINE_EFFECT_TEST(GrSimpleTextureEffect); | 104 GR_DEFINE_EFFECT_TEST(GrSimpleTextureEffect); |
105 | 105 |
106 GrEffectRef* GrSimpleTextureEffect::TestCreate(SkMWCRandom* random, | 106 GrEffectRef* GrSimpleTextureEffect::TestCreate(SkRandom* random, |
107 GrContext*, | 107 GrContext*, |
108 const GrDrawTargetCaps&, | 108 const GrDrawTargetCaps&, |
109 GrTexture* textures[]) { | 109 GrTexture* textures[]) { |
110 int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx : | 110 int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx : |
111 GrEffectUnitTest::kAlphaTextureIdx; | 111 GrEffectUnitTest::kAlphaTextureIdx; |
112 static const SkShader::TileMode kTileModes[] = { | 112 static const SkShader::TileMode kTileModes[] = { |
113 SkShader::kClamp_TileMode, | 113 SkShader::kClamp_TileMode, |
114 SkShader::kRepeat_TileMode, | 114 SkShader::kRepeat_TileMode, |
115 SkShader::kMirror_TileMode, | 115 SkShader::kMirror_TileMode, |
116 }; | 116 }; |
(...skipping 11 matching lines...) Expand all Loading... |
128 }; | 128 }; |
129 CoordsType coordsType = kCoordsTypes[random->nextULessThan(GR_ARRAY_COUNT(kC
oordsTypes))]; | 129 CoordsType coordsType = kCoordsTypes[random->nextULessThan(GR_ARRAY_COUNT(kC
oordsTypes))]; |
130 | 130 |
131 if (kCustom_CoordsType == coordsType) { | 131 if (kCustom_CoordsType == coordsType) { |
132 return GrSimpleTextureEffect::CreateWithCustomCoords(textures[texIdx], p
arams); | 132 return GrSimpleTextureEffect::CreateWithCustomCoords(textures[texIdx], p
arams); |
133 } else { | 133 } else { |
134 const SkMatrix& matrix = GrEffectUnitTest::TestMatrix(random); | 134 const SkMatrix& matrix = GrEffectUnitTest::TestMatrix(random); |
135 return GrSimpleTextureEffect::Create(textures[texIdx], matrix); | 135 return GrSimpleTextureEffect::Create(textures[texIdx], matrix); |
136 } | 136 } |
137 } | 137 } |
OLD | NEW |