OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |