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

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

Issue 806653007: Fix up all the easy virtual ... SK_OVERRIDE cases. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 years, 11 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/gpu/effects/GrOvalEffect.cpp ('k') | src/gpu/effects/GrRRectEffect.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 20 matching lines...) Expand all
31 kISA_GrBlendCoeff == dstCoeff || 31 kISA_GrBlendCoeff == dstCoeff ||
32 kISC_GrBlendCoeff == dstCoeff; 32 kISC_GrBlendCoeff == dstCoeff;
33 } 33 }
34 34
35 class GrGLPorterDuffXferProcessor : public GrGLXferProcessor { 35 class GrGLPorterDuffXferProcessor : public GrGLXferProcessor {
36 public: 36 public:
37 GrGLPorterDuffXferProcessor(const GrProcessor&) {} 37 GrGLPorterDuffXferProcessor(const GrProcessor&) {}
38 38
39 virtual ~GrGLPorterDuffXferProcessor() {} 39 virtual ~GrGLPorterDuffXferProcessor() {}
40 40
41 virtual void emitCode(const EmitArgs& args) SK_OVERRIDE { 41 void emitCode(const EmitArgs& args) SK_OVERRIDE {
42 const GrPorterDuffXferProcessor& xp = args.fXP.cast<GrPorterDuffXferProc essor>(); 42 const GrPorterDuffXferProcessor& xp = args.fXP.cast<GrPorterDuffXferProc essor>();
43 GrGLFPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder(); 43 GrGLFPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
44 if (xp.hasSecondaryOutput()) { 44 if (xp.hasSecondaryOutput()) {
45 switch(xp.secondaryOutputType()) { 45 switch(xp.secondaryOutputType()) {
46 case GrPorterDuffXferProcessor::kCoverage_SecondaryOutputType: 46 case GrPorterDuffXferProcessor::kCoverage_SecondaryOutputType:
47 fsBuilder->codeAppendf("%s = %s;", args.fOutputSecondary, ar gs.fInputCoverage); 47 fsBuilder->codeAppendf("%s = %s;", args.fOutputSecondary, ar gs.fInputCoverage);
48 break; 48 break;
49 case GrPorterDuffXferProcessor::kCoverageISA_SecondaryOutputType : 49 case GrPorterDuffXferProcessor::kCoverageISA_SecondaryOutputType :
50 fsBuilder->codeAppendf("%s = (1.0 - %s.a) * %s;", 50 fsBuilder->codeAppendf("%s = (1.0 - %s.a) * %s;",
51 args.fOutputSecondary, args.fInputCol or, 51 args.fOutputSecondary, args.fInputCol or,
(...skipping 27 matching lines...) Expand all
79 xp.primaryOutputType()){ 79 xp.primaryOutputType()){
80 fsBuilder->codeAppendf("%s += (vec4(1.0) - %s) * %s;", args. fOutputPrimary, 80 fsBuilder->codeAppendf("%s += (vec4(1.0) - %s) * %s;", args. fOutputPrimary,
81 args.fInputCoverage, fsBuilder->dstCo lor()); 81 args.fInputCoverage, fsBuilder->dstCo lor());
82 } 82 }
83 break; 83 break;
84 default: 84 default:
85 SkFAIL("Unexpected Primary Output"); 85 SkFAIL("Unexpected Primary Output");
86 } 86 }
87 } 87 }
88 88
89 virtual void setData(const GrGLProgramDataManager&, const GrXferProcessor&) SK_OVERRIDE {}; 89 void setData(const GrGLProgramDataManager&, const GrXferProcessor&) SK_OVERR IDE {};
90 90
91 static void GenKey(const GrProcessor& processor, const GrGLCaps& caps, 91 static void GenKey(const GrProcessor& processor, const GrGLCaps& caps,
92 GrProcessorKeyBuilder* b) { 92 GrProcessorKeyBuilder* b) {
93 const GrPorterDuffXferProcessor& xp = processor.cast<GrPorterDuffXferPro cessor>(); 93 const GrPorterDuffXferProcessor& xp = processor.cast<GrPorterDuffXferPro cessor>();
94 b->add32(xp.primaryOutputType()); 94 b->add32(xp.primaryOutputType());
95 b->add32(xp.secondaryOutputType()); 95 b->add32(xp.secondaryOutputType());
96 }; 96 };
97 97
98 private: 98 private:
99 typedef GrGLXferProcessor INHERITED; 99 typedef GrGLXferProcessor INHERITED;
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 } while (GrBlendCoeffRefsSrc(src)); 525 } while (GrBlendCoeffRefsSrc(src));
526 526
527 GrBlendCoeff dst; 527 GrBlendCoeff dst;
528 do { 528 do {
529 dst = GrBlendCoeff(random->nextRangeU(kFirstPublicGrBlendCoeff, kLastPub licGrBlendCoeff)); 529 dst = GrBlendCoeff(random->nextRangeU(kFirstPublicGrBlendCoeff, kLastPub licGrBlendCoeff));
530 } while (GrBlendCoeffRefsDst(dst)); 530 } while (GrBlendCoeffRefsDst(dst));
531 531
532 return GrPorterDuffXPFactory::Create(src, dst); 532 return GrPorterDuffXPFactory::Create(src, dst);
533 } 533 }
534 534
OLDNEW
« no previous file with comments | « src/gpu/effects/GrOvalEffect.cpp ('k') | src/gpu/effects/GrRRectEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698