| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 } | 84 } |
| 85 } | 85 } |
| 86 } | 86 } |
| 87 } | 87 } |
| 88 | 88 |
| 89 void GrConstColorProcessor::onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKe
yBuilder* b) const { | 89 void GrConstColorProcessor::onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKe
yBuilder* b) const { |
| 90 b->add32(fMode); | 90 b->add32(fMode); |
| 91 } | 91 } |
| 92 | 92 |
| 93 GrGLFragmentProcessor* GrConstColorProcessor::onCreateGLInstance() const { | 93 GrGLFragmentProcessor* GrConstColorProcessor::onCreateGLInstance() const { |
| 94 return SkNEW(GLConstColorProcessor); | 94 return new GLConstColorProcessor; |
| 95 } | 95 } |
| 96 | 96 |
| 97 bool GrConstColorProcessor::onIsEqual(const GrFragmentProcessor& other) const { | 97 bool GrConstColorProcessor::onIsEqual(const GrFragmentProcessor& other) const { |
| 98 const GrConstColorProcessor& that = other.cast<GrConstColorProcessor>(); | 98 const GrConstColorProcessor& that = other.cast<GrConstColorProcessor>(); |
| 99 return fMode == that.fMode && fColor == that.fColor; | 99 return fMode == that.fMode && fColor == that.fColor; |
| 100 } | 100 } |
| 101 | 101 |
| 102 /////////////////////////////////////////////////////////////////////////////// | 102 /////////////////////////////////////////////////////////////////////////////// |
| 103 | 103 |
| 104 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrConstColorProcessor); | 104 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrConstColorProcessor); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 119 color = 0; | 119 color = 0; |
| 120 break; | 120 break; |
| 121 case 2: | 121 case 2: |
| 122 color = d->fRandom->nextULessThan(0x100); | 122 color = d->fRandom->nextULessThan(0x100); |
| 123 color = color | (color << 8) | (color << 16) | (color << 24); | 123 color = color | (color << 8) | (color << 16) | (color << 24); |
| 124 break; | 124 break; |
| 125 } | 125 } |
| 126 InputMode mode = static_cast<InputMode>(d->fRandom->nextULessThan(kInputMode
Cnt)); | 126 InputMode mode = static_cast<InputMode>(d->fRandom->nextULessThan(kInputMode
Cnt)); |
| 127 return GrConstColorProcessor::Create(color, mode); | 127 return GrConstColorProcessor::Create(color, mode); |
| 128 } | 128 } |
| OLD | NEW |