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 "gl/builders/GrGLProgramBuilder.h" | 8 #include "gl/builders/GrGLProgramBuilder.h" |
9 #include "GrSimpleTextureEffect.h" | 9 #include "GrSimpleTextureEffect.h" |
10 #include "gl/GrGLProcessor.h" | 10 #include "gl/GrGLProcessor.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 coords[0].getType()); | 34 coords[0].getType()); |
35 fsBuilder->codeAppend(";\n"); | 35 fsBuilder->codeAppend(";\n"); |
36 } | 36 } |
37 | 37 |
38 private: | 38 private: |
39 typedef GrGLFragmentProcessor INHERITED; | 39 typedef GrGLFragmentProcessor INHERITED; |
40 }; | 40 }; |
41 | 41 |
42 /////////////////////////////////////////////////////////////////////////////// | 42 /////////////////////////////////////////////////////////////////////////////// |
43 | 43 |
44 void GrSimpleTextureEffect::getConstantColorComponents(GrColor* color, uint32_t*
validFlags) const { | 44 void GrSimpleTextureEffect::onComputeInvariantOutput(InvariantOutput* inout) con
st { |
45 this->updateConstantColorComponentsForModulation(color, validFlags); | 45 this->updateInvariantOutputForModulation(inout); |
| 46 inout->fIsSingleComponent = false; |
46 } | 47 } |
47 | 48 |
48 const GrBackendFragmentProcessorFactory& GrSimpleTextureEffect::getFactory() con
st { | 49 const GrBackendFragmentProcessorFactory& GrSimpleTextureEffect::getFactory() con
st { |
49 return GrTBackendFragmentProcessorFactory<GrSimpleTextureEffect>::getInstanc
e(); | 50 return GrTBackendFragmentProcessorFactory<GrSimpleTextureEffect>::getInstanc
e(); |
50 } | 51 } |
51 | 52 |
52 /////////////////////////////////////////////////////////////////////////////// | 53 /////////////////////////////////////////////////////////////////////////////// |
53 | 54 |
54 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrSimpleTextureEffect); | 55 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrSimpleTextureEffect); |
55 | 56 |
(...skipping 17 matching lines...) Expand all Loading... |
73 | 74 |
74 static const GrCoordSet kCoordSets[] = { | 75 static const GrCoordSet kCoordSets[] = { |
75 kLocal_GrCoordSet, | 76 kLocal_GrCoordSet, |
76 kPosition_GrCoordSet | 77 kPosition_GrCoordSet |
77 }; | 78 }; |
78 GrCoordSet coordSet = kCoordSets[random->nextULessThan(SK_ARRAY_COUNT(kCoord
Sets))]; | 79 GrCoordSet coordSet = kCoordSets[random->nextULessThan(SK_ARRAY_COUNT(kCoord
Sets))]; |
79 | 80 |
80 const SkMatrix& matrix = GrProcessorUnitTest::TestMatrix(random); | 81 const SkMatrix& matrix = GrProcessorUnitTest::TestMatrix(random); |
81 return GrSimpleTextureEffect::Create(textures[texIdx], matrix, coordSet); | 82 return GrSimpleTextureEffect::Create(textures[texIdx], matrix, coordSet); |
82 } | 83 } |
OLD | NEW |