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

Side by Side Diff: src/effects/SkAvoidXfermode.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/SkArithmeticMode_gpu.cpp ('k') | src/effects/SkBlurMaskFilter.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 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 "SkAvoidXfermode.h" 8 #include "SkAvoidXfermode.h"
9 #include "SkColorPriv.h" 9 #include "SkColorPriv.h"
10 #include "SkReadBuffer.h" 10 #include "SkReadBuffer.h"
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 if (srcCoverage) { 265 if (srcCoverage) {
266 fragBuilder->codeAppendf("%s *= %s;", kCoverageName, srcCoverage); 266 fragBuilder->codeAppendf("%s *= %s;", kCoverageName, srcCoverage);
267 } 267 }
268 } 268 }
269 269
270 class GLAvoidFP : public GrGLSLFragmentProcessor { 270 class GLAvoidFP : public GrGLSLFragmentProcessor {
271 public: 271 public:
272 void emitCode(EmitArgs& args) override { 272 void emitCode(EmitArgs& args) override {
273 const AvoidFP& avoid = args.fFp.cast<AvoidFP>(); 273 const AvoidFP& avoid = args.fFp.cast<AvoidFP>();
274 274
275 GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder; 275 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder;
276 SkString dstColor("dstColor"); 276 SkString dstColor("dstColor");
277 this->emitChild(0, nullptr, &dstColor, args); 277 this->emitChild(0, nullptr, &dstColor, args);
278 278
279 fColorAndTolUni = args.fUniformHandler->addUniform( 279 fColorAndTolUni = args.fUniformHandler->addUniform(
280 kFragment_GrShaderFlag, 280 kFragment_GrShaderFlag,
281 kVec4f_GrSLType, kDefault_GrSLP recision, 281 kVec4f_GrSLType, kDefault_GrSLP recision,
282 "colorAndTol"); 282 "colorAndTol");
283 const char* kColorAndTolUni = args.fUniformHandler->getUniformCStr(fColo rAndTolUni); 283 const char* kColorAndTolUni = args.fUniformHandler->getUniformCStr(fColo rAndTolUni);
284 284
285 const char* kCoverageName = "newCoverage"; 285 const char* kCoverageName = "newCoverage";
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 void SkAvoidXfermode::toString(SkString* str) const { 535 void SkAvoidXfermode::toString(SkString* str) const {
536 str->append("AvoidXfermode: opColor: "); 536 str->append("AvoidXfermode: opColor: ");
537 str->appendHex(fOpColor); 537 str->appendHex(fOpColor);
538 str->appendf("tolerance: %d ", fTolerance); 538 str->appendf("tolerance: %d ", fTolerance);
539 539
540 static const char* gModeStrings[] = { "Avoid", "Target" }; 540 static const char* gModeStrings[] = { "Avoid", "Target" };
541 541
542 str->appendf("mode: %s", gModeStrings[fMode]); 542 str->appendf("mode: %s", gModeStrings[fMode]);
543 } 543 }
544 #endif 544 #endif
OLDNEW
« no previous file with comments | « src/effects/SkArithmeticMode_gpu.cpp ('k') | src/effects/SkBlurMaskFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698