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

Side by Side Diff: src/gpu/effects/GrPorterDuffXferProcessor.cpp

Issue 1416423003: Make GrGLSLProgramBuilder base class for ProgramBuilder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: nit Created 5 years, 1 month 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/gpu/effects/GrDistanceFieldGeoProc.cpp ('k') | src/gpu/effects/GrTextureDomain.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 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
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
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 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrDistanceFieldGeoProc.cpp ('k') | src/gpu/effects/GrTextureDomain.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698