OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2015 Google Inc. | 3 * Copyright 2015 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "GrFragmentProcessor.h" | 9 #include "GrFragmentProcessor.h" |
10 #include "GrCoordTransform.h" | 10 #include "GrCoordTransform.h" |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 this->registerChildProcessor(processor); | 146 this->registerChildProcessor(processor); |
147 } | 147 } |
148 | 148 |
149 const char* name() const override { return "Premultiply"; } | 149 const char* name() const override { return "Premultiply"; } |
150 | 150 |
151 private: | 151 private: |
152 GrGLSLFragmentProcessor* onCreateGLSLInstance() const override { | 152 GrGLSLFragmentProcessor* onCreateGLSLInstance() const override { |
153 class GLFP : public GrGLSLFragmentProcessor { | 153 class GLFP : public GrGLSLFragmentProcessor { |
154 public: | 154 public: |
155 void emitCode(EmitArgs& args) override { | 155 void emitCode(EmitArgs& args) override { |
156 GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder; | 156 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; |
157 this->emitChild(0, nullptr, args); | 157 this->emitChild(0, nullptr, args); |
158 fragBuilder->codeAppendf("%s.rgb *= %s.rgb;", args.fOutputCo
lor, | 158 fragBuilder->codeAppendf("%s.rgb *= %s.rgb;", args.fOutputCo
lor, |
159 args.fInputColor
); | 159 args.fInputColor
); |
160 fragBuilder->codeAppendf("%s *= %s.a;", args.fOutputColor, a
rgs.fInputColor); | 160 fragBuilder->codeAppendf("%s *= %s.a;", args.fOutputColor, a
rgs.fInputColor); |
161 } | 161 } |
162 }; | 162 }; |
163 return new GLFP; | 163 return new GLFP; |
164 } | 164 } |
165 | 165 |
166 void onGetGLSLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) co
nst override {} | 166 void onGetGLSLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) co
nst override {} |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 } | 369 } |
370 } | 370 } |
371 | 371 |
372 if (1 == cnt) { | 372 if (1 == cnt) { |
373 return SkRef(series[0]); | 373 return SkRef(series[0]); |
374 } else { | 374 } else { |
375 return new SeriesFragmentProcessor(series, cnt); | 375 return new SeriesFragmentProcessor(series, cnt); |
376 } | 376 } |
377 } | 377 } |
378 | 378 |
OLD | NEW |