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

Side by Side Diff: src/effects/SkArithmeticMode_gpu.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/effects/SkAlphaThresholdFilter.cpp ('k') | src/effects/SkAvoidXfermode.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 * 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 "SkArithmeticMode_gpu.h" 8 #include "SkArithmeticMode_gpu.h"
9 9
10 #if SK_SUPPORT_GPU 10 #if SK_SUPPORT_GPU
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 fragBuilder->codeAppendf("%s.rgb = min(%s.rgb, %s.a);", 51 fragBuilder->codeAppendf("%s.rgb = min(%s.rgb, %s.a);",
52 outputColor, outputColor, outputColor); 52 outputColor, outputColor, outputColor);
53 } 53 }
54 } 54 }
55 55
56 class GLArithmeticFP : public GrGLSLFragmentProcessor { 56 class GLArithmeticFP : public GrGLSLFragmentProcessor {
57 public: 57 public:
58 void emitCode(EmitArgs& args) override { 58 void emitCode(EmitArgs& args) override {
59 const GrArithmeticFP& arith = args.fFp.cast<GrArithmeticFP>(); 59 const GrArithmeticFP& arith = args.fFp.cast<GrArithmeticFP>();
60 60
61 GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder; 61 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder;
62 SkString dstColor("dstColor"); 62 SkString dstColor("dstColor");
63 this->emitChild(0, nullptr, &dstColor, args); 63 this->emitChild(0, nullptr, &dstColor, args);
64 64
65 fKUni = args.fUniformHandler->addUniform(kFragment_GrShaderFlag, 65 fKUni = args.fUniformHandler->addUniform(kFragment_GrShaderFlag,
66 kVec4f_GrSLType, kDefault_GrSLP recision, 66 kVec4f_GrSLType, kDefault_GrSLP recision,
67 "k"); 67 "k");
68 const char* kUni = args.fUniformHandler->getUniformCStr(fKUni); 68 const char* kUni = args.fUniformHandler->getUniformCStr(fKUni);
69 69
70 add_arithmetic_code(fragBuilder, 70 add_arithmetic_code(fragBuilder,
71 args.fInputColor, 71 args.fInputColor,
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 float k1 = d->fRandom->nextF(); 298 float k1 = d->fRandom->nextF();
299 float k2 = d->fRandom->nextF(); 299 float k2 = d->fRandom->nextF();
300 float k3 = d->fRandom->nextF(); 300 float k3 = d->fRandom->nextF();
301 float k4 = d->fRandom->nextF(); 301 float k4 = d->fRandom->nextF();
302 bool enforcePMColor = d->fRandom->nextBool(); 302 bool enforcePMColor = d->fRandom->nextBool();
303 303
304 return GrArithmeticXPFactory::Create(k1, k2, k3, k4, enforcePMColor); 304 return GrArithmeticXPFactory::Create(k1, k2, k3, k4, enforcePMColor);
305 } 305 }
306 306
307 #endif 307 #endif
OLDNEW
« no previous file with comments | « src/effects/SkAlphaThresholdFilter.cpp ('k') | src/effects/SkAvoidXfermode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698