OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "effects/GrPorterDuffXferProcessor.h" | 8 #include "effects/GrPorterDuffXferProcessor.h" |
9 | 9 |
10 #include "GrBlend.h" | 10 #include "GrBlend.h" |
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 /////////////////////////////////////////////////////////////////////////////// | 536 /////////////////////////////////////////////////////////////////////////////// |
537 | 537 |
538 class GLShaderPDXferProcessor : public GrGLXferProcessor { | 538 class GLShaderPDXferProcessor : public GrGLXferProcessor { |
539 public: | 539 public: |
540 static void GenKey(const GrProcessor& processor, GrProcessorKeyBuilder* b) { | 540 static void GenKey(const GrProcessor& processor, GrProcessorKeyBuilder* b) { |
541 const ShaderPDXferProcessor& xp = processor.cast<ShaderPDXferProcessor>(
); | 541 const ShaderPDXferProcessor& xp = processor.cast<ShaderPDXferProcessor>(
); |
542 b->add32(xp.getXfermode()); | 542 b->add32(xp.getXfermode()); |
543 } | 543 } |
544 | 544 |
545 private: | 545 private: |
546 void emitBlendCodeForDstRead(GrGLXPBuilder* pb, const char* srcColor, const
char* dstColor, | 546 void emitBlendCodeForDstRead(GrGLSLXPBuilder* pb, const char* srcColor, cons
t char* dstColor, |
547 const char* outColor, const GrXferProcessor& pr
oc) override { | 547 const char* outColor, const GrXferProcessor& pr
oc) override { |
548 const ShaderPDXferProcessor& xp = proc.cast<ShaderPDXferProcessor>(); | 548 const ShaderPDXferProcessor& xp = proc.cast<ShaderPDXferProcessor>(); |
549 GrGLXPFragmentBuilder* fsBuilder = pb->getFragmentShaderBuilder(); | 549 GrGLXPFragmentBuilder* fsBuilder = pb->getFragmentShaderBuilder(); |
550 | 550 |
551 GrGLSLBlend::AppendMode(fsBuilder, srcColor, dstColor, outColor, xp.getX
fermode()); | 551 GrGLSLBlend::AppendMode(fsBuilder, srcColor, dstColor, outColor, xp.getX
fermode()); |
552 } | 552 } |
553 | 553 |
554 void onSetData(const GrGLSLProgramDataManager&, const GrXferProcessor&) over
ride {} | 554 void onSetData(const GrGLSLProgramDataManager&, const GrXferProcessor&) over
ride {} |
555 | 555 |
556 typedef GrGLXferProcessor INHERITED; | 556 typedef GrGLXferProcessor INHERITED; |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
819 int* outPrimary, | 819 int* outPrimary, |
820 int* outSecondary) { | 820 int* outSecondary) { |
821 if (!!strcmp(xp->name(), "Porter Duff")) { | 821 if (!!strcmp(xp->name(), "Porter Duff")) { |
822 *outPrimary = *outSecondary = -1; | 822 *outPrimary = *outSecondary = -1; |
823 return; | 823 return; |
824 } | 824 } |
825 BlendFormula blendFormula = static_cast<const PorterDuffXferProcessor*>(xp)-
>getBlendFormula(); | 825 BlendFormula blendFormula = static_cast<const PorterDuffXferProcessor*>(xp)-
>getBlendFormula(); |
826 *outPrimary = blendFormula.fPrimaryOutputType; | 826 *outPrimary = blendFormula.fPrimaryOutputType; |
827 *outSecondary = blendFormula.fSecondaryOutputType; | 827 *outSecondary = blendFormula.fSecondaryOutputType; |
828 } | 828 } |
OLD | NEW |