| 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/GrGLFragmentProcessor.h" | 9 #include "gl/GrGLFragmentProcessor.h" |
| 10 #include "gl/builders/GrGLProgramBuilder.h" | 10 #include "gl/builders/GrGLProgramBuilder.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 } else { | 78 } else { |
| 79 if (colorIsSingleChannel) { | 79 if (colorIsSingleChannel) { |
| 80 inout->mulAlphaByKnownSingleComponent(r); | 80 inout->mulAlphaByKnownSingleComponent(r); |
| 81 } else { | 81 } else { |
| 82 inout->mulAlphaByKnownFourComponents(fColor); | 82 inout->mulAlphaByKnownFourComponents(fColor); |
| 83 } | 83 } |
| 84 } | 84 } |
| 85 } | 85 } |
| 86 } | 86 } |
| 87 | 87 |
| 88 void GrConstColorProcessor::getGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyB
uilder* b) const { | 88 void GrConstColorProcessor::onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKe
yBuilder* b) const { |
| 89 b->add32(fMode); | 89 b->add32(fMode); |
| 90 } | 90 } |
| 91 | 91 |
| 92 GrGLFragmentProcessor* GrConstColorProcessor::createGLInstance() const { | 92 GrGLFragmentProcessor* GrConstColorProcessor::createGLInstance() const { |
| 93 return SkNEW(GLConstColorProcessor); | 93 return SkNEW(GLConstColorProcessor); |
| 94 } | 94 } |
| 95 | 95 |
| 96 bool GrConstColorProcessor::onIsEqual(const GrFragmentProcessor& other) const { | 96 bool GrConstColorProcessor::onIsEqual(const GrFragmentProcessor& other) const { |
| 97 const GrConstColorProcessor& that = other.cast<GrConstColorProcessor>(); | 97 const GrConstColorProcessor& that = other.cast<GrConstColorProcessor>(); |
| 98 return fMode == that.fMode && fColor == that.fColor; | 98 return fMode == that.fMode && fColor == that.fColor; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 118 color = 0; | 118 color = 0; |
| 119 break; | 119 break; |
| 120 case 2: | 120 case 2: |
| 121 color = d->fRandom->nextULessThan(0x100); | 121 color = d->fRandom->nextULessThan(0x100); |
| 122 color = color | (color << 8) | (color << 16) | (color << 24); | 122 color = color | (color << 8) | (color << 16) | (color << 24); |
| 123 break; | 123 break; |
| 124 } | 124 } |
| 125 InputMode mode = static_cast<InputMode>(d->fRandom->nextULessThan(kInputMode
Cnt)); | 125 InputMode mode = static_cast<InputMode>(d->fRandom->nextULessThan(kInputMode
Cnt)); |
| 126 return GrConstColorProcessor::Create(color, mode); | 126 return GrConstColorProcessor::Create(color, mode); |
| 127 } | 127 } |
| OLD | NEW |