OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "effects/GrConstColorProcessor.h" | 8 #include "effects/GrConstColorProcessor.h" |
9 #include "GrInvariantOutput.h" | 9 #include "GrInvariantOutput.h" |
10 #include "glsl/GrGLSLFragmentProcessor.h" | 10 #include "glsl/GrGLSLFragmentProcessor.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 GrColorUnpackB(color) * scale, | 56 GrColorUnpackB(color) * scale, |
57 GrColorUnpackA(color) * scale, | 57 GrColorUnpackA(color) * scale, |
58 }; | 58 }; |
59 pdm.set4fv(fColorUniform, 1, floatColor); | 59 pdm.set4fv(fColorUniform, 1, floatColor); |
60 fPrevColor = color; | 60 fPrevColor = color; |
61 } | 61 } |
62 } | 62 } |
63 | 63 |
64 private: | 64 private: |
65 GrGLSLProgramDataManager::UniformHandle fColorUniform; | 65 GrGLSLProgramDataManager::UniformHandle fColorUniform; |
66 GrColor fPrevColor; | 66 GrColor fPrevColor; |
67 | 67 |
68 typedef GrGLSLFragmentProcessor INHERITED; | 68 typedef GrGLSLFragmentProcessor INHERITED; |
69 }; | 69 }; |
70 | 70 |
71 /////////////////////////////////////////////////////////////////////////////// | 71 /////////////////////////////////////////////////////////////////////////////// |
72 | 72 |
73 void GrConstColorProcessor::onComputeInvariantOutput(GrInvariantOutput* inout) c
onst { | 73 void GrConstColorProcessor::onComputeInvariantOutput(GrInvariantOutput* inout) c
onst { |
74 if (kIgnore_InputMode == fMode) { | 74 if (kIgnore_InputMode == fMode) { |
75 inout->setToOther(kRGBA_GrColorComponentFlags, fColor, | 75 inout->setToOther(kRGBA_GrColorComponentFlags, fColor, |
76 GrInvariantOutput::kWillNot_ReadInput); | 76 GrInvariantOutput::kWillNot_ReadInput); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 color = 0; | 128 color = 0; |
129 break; | 129 break; |
130 case 2: | 130 case 2: |
131 color = d->fRandom->nextULessThan(0x100); | 131 color = d->fRandom->nextULessThan(0x100); |
132 color = color | (color << 8) | (color << 16) | (color << 24); | 132 color = color | (color << 8) | (color << 16) | (color << 24); |
133 break; | 133 break; |
134 } | 134 } |
135 InputMode mode = static_cast<InputMode>(d->fRandom->nextULessThan(kInputMode
Cnt)); | 135 InputMode mode = static_cast<InputMode>(d->fRandom->nextULessThan(kInputMode
Cnt)); |
136 return GrConstColorProcessor::Create(color, mode); | 136 return GrConstColorProcessor::Create(color, mode); |
137 } | 137 } |
OLD | NEW |