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

Side by Side Diff: src/gpu/glsl/GrGLSLXferProcessor.h

Issue 1453623003: Move glsl onto EmitArgs struct for emitCode (Closed) Base URL: https://skia.googlesource.com/skia.git@moveShaders
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/glsl/GrGLSLProgramBuilder.h ('k') | no next file » | 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 2015 Google Inc. 2 * Copyright 2015 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 #ifndef GrGLSLXferProcessor_DEFINED 8 #ifndef GrGLSLXferProcessor_DEFINED
9 #define GrGLSLXferProcessor_DEFINED 9 #define GrGLSLXferProcessor_DEFINED
10 10
11 #include "glsl/GrGLSLProgramDataManager.h" 11 #include "glsl/GrGLSLProgramDataManager.h"
12 #include "glsl/GrGLSLTextureSampler.h" 12 #include "glsl/GrGLSLTextureSampler.h"
13 13
14 class GrXferProcessor;
15 class GrGLSLXPBuilder;
14 class GrGLSLXPFragmentBuilder; 16 class GrGLSLXPFragmentBuilder;
15 class GrGLSLXPBuilder; 17 class GrGLSLCaps;
16 class GrXferProcessor;
17 18
18 class GrGLSLXferProcessor { 19 class GrGLSLXferProcessor {
19 public: 20 public:
20 GrGLSLXferProcessor() {} 21 GrGLSLXferProcessor() {}
21 virtual ~GrGLSLXferProcessor() {} 22 virtual ~GrGLSLXferProcessor() {}
22 23
23 typedef GrGLSLTextureSampler::TextureSamplerArray TextureSamplerArray; 24 typedef GrGLSLTextureSampler::TextureSamplerArray TextureSamplerArray;
24 struct EmitArgs { 25 struct EmitArgs {
25 EmitArgs(GrGLSLXPBuilder* pb, 26 EmitArgs(GrGLSLXPBuilder* pb,
26 GrGLSLXPFragmentBuilder* fragBuilder, 27 GrGLSLXPFragmentBuilder* fragBuilder,
28 const GrGLSLCaps* caps,
27 const GrXferProcessor& xp, 29 const GrXferProcessor& xp,
28 const char* inputColor, 30 const char* inputColor,
29 const char* inputCoverage, 31 const char* inputCoverage,
30 const char* outputPrimary, 32 const char* outputPrimary,
31 const char* outputSecondary, 33 const char* outputSecondary,
32 const TextureSamplerArray& samplers) 34 const TextureSamplerArray& samplers)
33 : fPB(pb) 35 : fPB(pb)
34 , fXPFragBuilder(fragBuilder) 36 , fXPFragBuilder(fragBuilder)
37 , fGLSLCaps(caps)
35 , fXP(xp) 38 , fXP(xp)
36 , fInputColor(inputColor) 39 , fInputColor(inputColor)
37 , fInputCoverage(inputCoverage) 40 , fInputCoverage(inputCoverage)
38 , fOutputPrimary(outputPrimary) 41 , fOutputPrimary(outputPrimary)
39 , fOutputSecondary(outputSecondary) 42 , fOutputSecondary(outputSecondary)
40 , fSamplers(samplers) {} 43 , fSamplers(samplers) {}
41 44
42 GrGLSLXPBuilder* fPB; 45 GrGLSLXPBuilder* fPB;
43 GrGLSLXPFragmentBuilder* fXPFragBuilder; 46 GrGLSLXPFragmentBuilder* fXPFragBuilder;
47 const GrGLSLCaps* fGLSLCaps;
44 const GrXferProcessor& fXP; 48 const GrXferProcessor& fXP;
45 const char* fInputColor; 49 const char* fInputColor;
46 const char* fInputCoverage; 50 const char* fInputCoverage;
47 const char* fOutputPrimary; 51 const char* fOutputPrimary;
48 const char* fOutputSecondary; 52 const char* fOutputSecondary;
49 const TextureSamplerArray& fSamplers; 53 const TextureSamplerArray& fSamplers;
50 }; 54 };
51 /** 55 /**
52 * This is similar to emitCode() in the base class, except it takes a full s hader builder. 56 * This is similar to emitCode() in the base class, except it takes a full s hader builder.
53 * This allows the effect subclass to emit vertex code. 57 * This allows the effect subclass to emit vertex code.
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 const GrXferProcessor&) { 90 const GrXferProcessor&) {
87 SkFAIL("emitBlendCodeForDstRead not implemented."); 91 SkFAIL("emitBlendCodeForDstRead not implemented.");
88 } 92 }
89 93
90 virtual void onSetData(const GrGLSLProgramDataManager&, const GrXferProcesso r&) = 0; 94 virtual void onSetData(const GrGLSLProgramDataManager&, const GrXferProcesso r&) = 0;
91 95
92 GrGLSLProgramDataManager::UniformHandle fDstTopLeftUni; 96 GrGLSLProgramDataManager::UniformHandle fDstTopLeftUni;
93 GrGLSLProgramDataManager::UniformHandle fDstScaleUni; 97 GrGLSLProgramDataManager::UniformHandle fDstScaleUni;
94 }; 98 };
95 #endif 99 #endif
OLDNEW
« no previous file with comments | « src/gpu/glsl/GrGLSLProgramBuilder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698