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