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

Side by Side Diff: src/effects/SkPixelXorXfermode.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/SkPerlinNoiseShader.cpp ('k') | src/effects/SkTableColorFilter.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 2011 Google Inc. 2 * Copyright 2011 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 "SkPixelXorXfermode.h" 8 #include "SkPixelXorXfermode.h"
9 #include "SkColorPriv.h" 9 #include "SkColorPriv.h"
10 #include "SkReadBuffer.h" 10 #include "SkReadBuffer.h"
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 165
166 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; 166 GR_DECLARE_FRAGMENT_PROCESSOR_TEST;
167 typedef GrFragmentProcessor INHERITED; 167 typedef GrFragmentProcessor INHERITED;
168 }; 168 };
169 169
170 /////////////////////////////////////////////////////////////////////////////// 170 ///////////////////////////////////////////////////////////////////////////////
171 171
172 class GLPixelXorFP : public GrGLSLFragmentProcessor { 172 class GLPixelXorFP : public GrGLSLFragmentProcessor {
173 public: 173 public:
174 void emitCode(EmitArgs& args) override { 174 void emitCode(EmitArgs& args) override {
175 GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder; 175 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder;
176 SkString dstColor("dstColor"); 176 SkString dstColor("dstColor");
177 this->emitChild(0, nullptr, &dstColor, args); 177 this->emitChild(0, nullptr, &dstColor, args);
178 178
179 fOpColorUni = args.fUniformHandler->addUniform(kFragment_GrShaderFlag, 179 fOpColorUni = args.fUniformHandler->addUniform(kFragment_GrShaderFlag,
180 kVec3f_GrSLType, kHigh_Gr SLPrecision, 180 kVec3f_GrSLType, kHigh_Gr SLPrecision,
181 "opColor"); 181 "opColor");
182 const char* kOpColorUni = args.fUniformHandler->getUniformCStr(fOpColorU ni); 182 const char* kOpColorUni = args.fUniformHandler->getUniformCStr(fOpColorU ni);
183 183
184 add_pixelxor_code(fragBuilder, args.fInputColor, dstColor.c_str(), 184 add_pixelxor_code(fragBuilder, args.fInputColor, dstColor.c_str(),
185 args.fOutputColor, kOpColorUni); 185 args.fOutputColor, kOpColorUni);
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 const GrFragmentProcessor* SkPixelXorXfermode::getFragmentProcessorForImageFilte r( 371 const GrFragmentProcessor* SkPixelXorXfermode::getFragmentProcessorForImageFilte r(
372 const GrFragmentProcesso r* dst) const { 372 const GrFragmentProcesso r* dst) const {
373 return PixelXorFP::Create(fOpColor, dst); 373 return PixelXorFP::Create(fOpColor, dst);
374 } 374 }
375 375
376 GrXPFactory* SkPixelXorXfermode::asXPFactory() const { 376 GrXPFactory* SkPixelXorXfermode::asXPFactory() const {
377 return GrPixelXorXPFactory::Create(fOpColor); 377 return GrPixelXorXPFactory::Create(fOpColor);
378 } 378 }
379 379
380 #endif 380 #endif
OLDNEW
« no previous file with comments | « src/effects/SkPerlinNoiseShader.cpp ('k') | src/effects/SkTableColorFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698