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 "gl/GrGLProcessor.h" | 9 #include "gl/GrGLFragmentProcessor.h" |
10 #include "gl/builders/GrGLProgramBuilder.h" | 10 #include "gl/builders/GrGLProgramBuilder.h" |
11 | 11 |
12 class GLConstColorProcessor : public GrGLFragmentProcessor { | 12 class GLConstColorProcessor : public GrGLFragmentProcessor { |
13 public: | 13 public: |
14 GLConstColorProcessor() : fPrevColor(GrColor_ILLEGAL) {} | 14 GLConstColorProcessor() : fPrevColor(GrColor_ILLEGAL) {} |
15 | 15 |
16 void emitCode(GrGLFPBuilder* builder, | 16 void emitCode(GrGLFPBuilder* builder, |
17 const GrFragmentProcessor& fp, | 17 const GrFragmentProcessor& fp, |
18 const char* outputColor, | 18 const char* outputColor, |
19 const char* inputColor, | 19 const char* inputColor, |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 color = 0; | 121 color = 0; |
122 break; | 122 break; |
123 case 2: | 123 case 2: |
124 color = d->fRandom->nextULessThan(0x100); | 124 color = d->fRandom->nextULessThan(0x100); |
125 color = color | (color << 8) | (color << 16) | (color << 24); | 125 color = color | (color << 8) | (color << 16) | (color << 24); |
126 break; | 126 break; |
127 } | 127 } |
128 InputMode mode = static_cast<InputMode>(d->fRandom->nextULessThan(kInputMode
Cnt)); | 128 InputMode mode = static_cast<InputMode>(d->fRandom->nextULessThan(kInputMode
Cnt)); |
129 return GrConstColorProcessor::Create(color, mode); | 129 return GrConstColorProcessor::Create(color, mode); |
130 } | 130 } |
OLD | NEW |