Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Side by Side Diff: src/gpu/GrFragmentProcessor.cpp

Issue 1709153002: Add more specialized fragment builders (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Make MSVC happy Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/GrDefaultGeoProcFactory.cpp ('k') | src/gpu/GrOvalRenderer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/gpu/GrDefaultGeoProcFactory.cpp ('k') | src/gpu/GrOvalRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698