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 "GrTextureDomainEffect.h" | 8 #include "GrTextureDomainEffect.h" |
9 #include "GrSimpleTextureEffect.h" | 9 #include "GrSimpleTextureEffect.h" |
10 #include "GrTBackendEffectFactory.h" | 10 #include "GrTBackendEffectFactory.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 GrGLUniformManager::UniformHandle fNameUni; | 31 GrGLUniformManager::UniformHandle fNameUni; |
32 GrGLEffectMatrix fEffectMatrix; | 32 GrGLEffectMatrix fEffectMatrix; |
33 GrGLfloat fPrevDomain[4]; | 33 GrGLfloat fPrevDomain[4]; |
34 | 34 |
35 typedef GrGLEffect INHERITED; | 35 typedef GrGLEffect INHERITED; |
36 }; | 36 }; |
37 | 37 |
38 GrGLTextureDomainEffect::GrGLTextureDomainEffect(const GrBackendEffectFactory& f
actory, | 38 GrGLTextureDomainEffect::GrGLTextureDomainEffect(const GrBackendEffectFactory& f
actory, |
39 const GrDrawEffect& drawEffect) | 39 const GrDrawEffect& drawEffect) |
40 : INHERITED(factory) | 40 : INHERITED(factory) |
41 , fNameUni(GrGLUniformManager::kInvalidUniformHandle) | |
42 , fEffectMatrix(drawEffect.castEffect<GrTextureDomainEffect>().coordsType())
{ | 41 , fEffectMatrix(drawEffect.castEffect<GrTextureDomainEffect>().coordsType())
{ |
43 fPrevDomain[0] = SK_FloatNaN; | 42 fPrevDomain[0] = SK_FloatNaN; |
44 } | 43 } |
45 | 44 |
46 void GrGLTextureDomainEffect::emitCode(GrGLShaderBuilder* builder, | 45 void GrGLTextureDomainEffect::emitCode(GrGLShaderBuilder* builder, |
47 const GrDrawEffect& drawEffect, | 46 const GrDrawEffect& drawEffect, |
48 EffectKey key, | 47 EffectKey key, |
49 const char* outputColor, | 48 const char* outputColor, |
50 const char* inputColor, | 49 const char* inputColor, |
51 const TextureSamplerArray& samplers) { | 50 const TextureSamplerArray& samplers) { |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 const SkMatrix& matrix = GrEffectUnitTest::TestMatrix(random); | 234 const SkMatrix& matrix = GrEffectUnitTest::TestMatrix(random); |
236 bool bilerp = random->nextBool(); | 235 bool bilerp = random->nextBool(); |
237 CoordsType coords = random->nextBool() ? kLocal_CoordsType : kPosition_Coord
sType; | 236 CoordsType coords = random->nextBool() ? kLocal_CoordsType : kPosition_Coord
sType; |
238 return GrTextureDomainEffect::Create(textures[texIdx], | 237 return GrTextureDomainEffect::Create(textures[texIdx], |
239 matrix, | 238 matrix, |
240 domain, | 239 domain, |
241 wrapMode, | 240 wrapMode, |
242 bilerp ? GrTextureParams::kBilerp_Filte
rMode : GrTextureParams::kNone_FilterMode, | 241 bilerp ? GrTextureParams::kBilerp_Filte
rMode : GrTextureParams::kNone_FilterMode, |
243 coords); | 242 coords); |
244 } | 243 } |
OLD | NEW |