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 "GrInvariantOutput.h" | 9 #include "GrInvariantOutput.h" |
10 #include "GrTexture.h" | 10 #include "GrTexture.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 static inline void GenKey(const GrProcessor& effect, const GrGLSLCaps&, | 33 static inline void GenKey(const GrProcessor& effect, const GrGLSLCaps&, |
34 GrProcessorKeyBuilder* b) { | 34 GrProcessorKeyBuilder* b) { |
35 const GrSimpleTextureEffect& textureEffect = effect.cast<GrSimpleTexture
Effect>(); | 35 const GrSimpleTextureEffect& textureEffect = effect.cast<GrSimpleTexture
Effect>(); |
36 b->add32(GrColorSpaceXform::XformKey(textureEffect.colorSpaceXform())); | 36 b->add32(GrColorSpaceXform::XformKey(textureEffect.colorSpaceXform())); |
37 } | 37 } |
38 | 38 |
39 protected: | 39 protected: |
40 void onSetData(const GrGLSLProgramDataManager& pdman, const GrProcessor& pro
cessor) override { | 40 void onSetData(const GrGLSLProgramDataManager& pdman, const GrProcessor& pro
cessor) override { |
41 const GrSimpleTextureEffect& textureEffect = processor.cast<GrSimpleText
ureEffect>(); | 41 const GrSimpleTextureEffect& textureEffect = processor.cast<GrSimpleText
ureEffect>(); |
42 if (SkToBool(textureEffect.colorSpaceXform())) { | 42 if (SkToBool(textureEffect.colorSpaceXform())) { |
43 pdman.setMatrix4f(fColorSpaceXformUni, textureEffect.colorSpaceXform
()->srcToDst()); | 43 pdman.setSkMatrix44(fColorSpaceXformUni, textureEffect.colorSpaceXfo
rm()->srcToDst()); |
44 } | 44 } |
45 } | 45 } |
46 | 46 |
47 private: | 47 private: |
48 typedef GrGLSLFragmentProcessor INHERITED; | 48 typedef GrGLSLFragmentProcessor INHERITED; |
49 | 49 |
50 UniformHandle fColorSpaceXformUni; | 50 UniformHandle fColorSpaceXformUni; |
51 }; | 51 }; |
52 | 52 |
53 /////////////////////////////////////////////////////////////////////////////// | 53 /////////////////////////////////////////////////////////////////////////////// |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 | 86 |
87 static const GrCoordSet kCoordSets[] = { | 87 static const GrCoordSet kCoordSets[] = { |
88 kLocal_GrCoordSet, | 88 kLocal_GrCoordSet, |
89 kDevice_GrCoordSet | 89 kDevice_GrCoordSet |
90 }; | 90 }; |
91 GrCoordSet coordSet = kCoordSets[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kC
oordSets))]; | 91 GrCoordSet coordSet = kCoordSets[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kC
oordSets))]; |
92 | 92 |
93 const SkMatrix& matrix = GrTest::TestMatrix(d->fRandom); | 93 const SkMatrix& matrix = GrTest::TestMatrix(d->fRandom); |
94 return GrSimpleTextureEffect::Make(d->fTextures[texIdx], nullptr, matrix, co
ordSet); | 94 return GrSimpleTextureEffect::Make(d->fTextures[texIdx], nullptr, matrix, co
ordSet); |
95 } | 95 } |
OLD | NEW |