| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "SkLumaColorFilter.h" | 8 #include "SkLumaColorFilter.h" |
| 9 | 9 |
| 10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 fsBuilder->codeAppendf("\t%s = vec4(0, 0, 0, luma);\n", | 102 fsBuilder->codeAppendf("\t%s = vec4(0, 0, 0, luma);\n", |
| 103 outputColor); | 103 outputColor); |
| 104 | 104 |
| 105 } | 105 } |
| 106 | 106 |
| 107 private: | 107 private: |
| 108 typedef GrGLFragmentProcessor INHERITED; | 108 typedef GrGLFragmentProcessor INHERITED; |
| 109 }; | 109 }; |
| 110 | 110 |
| 111 private: | 111 private: |
| 112 virtual bool onIsEqual(const GrFragmentProcessor&) const SK_OVERRIDE { | 112 virtual bool onIsEqual(const GrFragmentProcessor&) const SK_OVERRIDE { retur
n true; } |
| 113 return true; | |
| 114 } | |
| 115 | 113 |
| 116 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR
IDE { | 114 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR
IDE { |
| 117 // The output is always black. The alpha value for the color passed in i
s arbitrary. | 115 // The output is always black. The alpha value for the color passed in i
s arbitrary. |
| 118 inout->setToOther(kRGB_GrColorComponentFlags, GrColorPackRGBA(0, 0, 0, 0
)); | 116 inout->setToOther(kRGB_GrColorComponentFlags, GrColorPackRGBA(0, 0, 0, 0
)); |
| 119 } | 117 } |
| 120 }; | 118 }; |
| 121 | 119 |
| 122 GrFragmentProcessor* SkLumaColorFilter::asFragmentProcessor(GrContext*) const { | 120 GrFragmentProcessor* SkLumaColorFilter::asFragmentProcessor(GrContext*) const { |
| 123 return LumaColorFilterEffect::Create(); | 121 return LumaColorFilterEffect::Create(); |
| 124 } | 122 } |
| 125 #endif | 123 #endif |
| OLD | NEW |