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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 virtual void getConstantColorComponents(GrColor* color, | 76 virtual void getConstantColorComponents(GrColor* color, |
77 uint32_t* validFlags) const SK_OVERR
IDE { | 77 uint32_t* validFlags) const SK_OVERR
IDE { |
78 // The output is always black. | 78 // The output is always black. |
79 *color = GrColorPackRGBA(0, 0, 0, GrColorUnpackA(*color)); | 79 *color = GrColorPackRGBA(0, 0, 0, GrColorUnpackA(*color)); |
80 *validFlags = kRGB_GrColorComponentFlags; | 80 *validFlags = kRGB_GrColorComponentFlags; |
81 } | 81 } |
82 | 82 |
83 class GLEffect : public GrGLEffect { | 83 class GLEffect : public GrGLEffect { |
84 public: | 84 public: |
85 GLEffect(const GrBackendEffectFactory& factory, | 85 GLEffect(const GrBackendEffectFactory& factory, |
86 const GrEffect&) | 86 const GrDrawEffect&) |
87 : INHERITED(factory) { | 87 : INHERITED(factory) { |
88 } | 88 } |
89 | 89 |
90 static void GenKey(const GrEffect&, const GrGLCaps&, GrEffectKeyBuilder*
b) {} | 90 static void GenKey(const GrDrawEffect&, const GrGLCaps&, GrEffectKeyBuil
der* b) {} |
91 | 91 |
92 virtual void emitCode(GrGLProgramBuilder* builder, | 92 virtual void emitCode(GrGLProgramBuilder* builder, |
93 const GrEffect&, | 93 const GrDrawEffect&, |
94 const GrEffectKey&, | 94 const GrEffectKey&, |
95 const char* outputColor, | 95 const char* outputColor, |
96 const char* inputColor, | 96 const char* inputColor, |
97 const TransformedCoordsArray&, | 97 const TransformedCoordsArray&, |
98 const TextureSamplerArray&) SK_OVERRIDE { | 98 const TextureSamplerArray&) SK_OVERRIDE { |
99 if (NULL == inputColor) { | 99 if (NULL == inputColor) { |
100 inputColor = "vec4(1)"; | 100 inputColor = "vec4(1)"; |
101 } | 101 } |
102 | 102 |
103 GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBui
lder(); | 103 GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBui
lder(); |
(...skipping 14 matching lines...) Expand all Loading... |
118 private: | 118 private: |
119 virtual bool onIsEqual(const GrEffect&) const SK_OVERRIDE { | 119 virtual bool onIsEqual(const GrEffect&) const SK_OVERRIDE { |
120 return true; | 120 return true; |
121 } | 121 } |
122 }; | 122 }; |
123 | 123 |
124 GrEffect* SkLumaColorFilter::asNewEffect(GrContext*) const { | 124 GrEffect* SkLumaColorFilter::asNewEffect(GrContext*) const { |
125 return LumaColorFilterEffect::Create(); | 125 return LumaColorFilterEffect::Create(); |
126 } | 126 } |
127 #endif | 127 #endif |
OLD | NEW |