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 |
(...skipping 15 matching lines...) Expand all Loading... |
26 struct EmitArgs { | 26 struct EmitArgs { |
27 EmitArgs(GrGLSLXPFragmentBuilder* fragBuilder, | 27 EmitArgs(GrGLSLXPFragmentBuilder* fragBuilder, |
28 GrGLSLUniformHandler* uniformHandler, | 28 GrGLSLUniformHandler* uniformHandler, |
29 const GrGLSLCaps* caps, | 29 const GrGLSLCaps* caps, |
30 const GrXferProcessor& xp, | 30 const GrXferProcessor& xp, |
31 const char* inputColor, | 31 const char* inputColor, |
32 const char* inputCoverage, | 32 const char* inputCoverage, |
33 const char* outputPrimary, | 33 const char* outputPrimary, |
34 const char* outputSecondary, | 34 const char* outputSecondary, |
35 const SamplerArray& texSamplers, | 35 const SamplerArray& texSamplers, |
| 36 const SamplerArray& bufferSamplers, |
36 const bool usePLSDstRead) | 37 const bool usePLSDstRead) |
37 : fXPFragBuilder(fragBuilder) | 38 : fXPFragBuilder(fragBuilder) |
38 , fUniformHandler(uniformHandler) | 39 , fUniformHandler(uniformHandler) |
39 , fGLSLCaps(caps) | 40 , fGLSLCaps(caps) |
40 , fXP(xp) | 41 , fXP(xp) |
41 , fInputColor(inputColor) | 42 , fInputColor(inputColor) |
42 , fInputCoverage(inputCoverage) | 43 , fInputCoverage(inputCoverage) |
43 , fOutputPrimary(outputPrimary) | 44 , fOutputPrimary(outputPrimary) |
44 , fOutputSecondary(outputSecondary) | 45 , fOutputSecondary(outputSecondary) |
45 , fTexSamplers(texSamplers) | 46 , fTexSamplers(texSamplers) |
| 47 , fBufferSamplers(bufferSamplers) |
46 , fUsePLSDstRead(usePLSDstRead) {} | 48 , fUsePLSDstRead(usePLSDstRead) {} |
47 | 49 |
48 GrGLSLXPFragmentBuilder* fXPFragBuilder; | 50 GrGLSLXPFragmentBuilder* fXPFragBuilder; |
49 GrGLSLUniformHandler* fUniformHandler; | 51 GrGLSLUniformHandler* fUniformHandler; |
50 const GrGLSLCaps* fGLSLCaps; | 52 const GrGLSLCaps* fGLSLCaps; |
51 const GrXferProcessor& fXP; | 53 const GrXferProcessor& fXP; |
52 const char* fInputColor; | 54 const char* fInputColor; |
53 const char* fInputCoverage; | 55 const char* fInputCoverage; |
54 const char* fOutputPrimary; | 56 const char* fOutputPrimary; |
55 const char* fOutputSecondary; | 57 const char* fOutputSecondary; |
56 const SamplerArray& fTexSamplers; | 58 const SamplerArray& fTexSamplers; |
| 59 const SamplerArray& fBufferSamplers; |
57 bool fUsePLSDstRead; | 60 bool fUsePLSDstRead; |
58 }; | 61 }; |
59 /** | 62 /** |
60 * This is similar to emitCode() in the base class, except it takes a full s
hader builder. | 63 * This is similar to emitCode() in the base class, except it takes a full s
hader builder. |
61 * This allows the effect subclass to emit vertex code. | 64 * This allows the effect subclass to emit vertex code. |
62 */ | 65 */ |
63 void emitCode(const EmitArgs&); | 66 void emitCode(const EmitArgs&); |
64 | 67 |
65 /** A GrGLSLXferProcessor instance can be reused with any GrGLSLXferProcesso
r that produces | 68 /** A GrGLSLXferProcessor instance can be reused with any GrGLSLXferProcesso
r that produces |
66 the same stage key; this function reads data from a GrGLSLXferProcessor
and uploads any | 69 the same stage key; this function reads data from a GrGLSLXferProcessor
and uploads any |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 const GrXferProcessor&) { | 107 const GrXferProcessor&) { |
105 SkFAIL("emitBlendCodeForDstRead not implemented."); | 108 SkFAIL("emitBlendCodeForDstRead not implemented."); |
106 } | 109 } |
107 | 110 |
108 virtual void onSetData(const GrGLSLProgramDataManager&, const GrXferProcesso
r&) = 0; | 111 virtual void onSetData(const GrGLSLProgramDataManager&, const GrXferProcesso
r&) = 0; |
109 | 112 |
110 GrGLSLProgramDataManager::UniformHandle fDstTopLeftUni; | 113 GrGLSLProgramDataManager::UniformHandle fDstTopLeftUni; |
111 GrGLSLProgramDataManager::UniformHandle fDstScaleUni; | 114 GrGLSLProgramDataManager::UniformHandle fDstScaleUni; |
112 }; | 115 }; |
113 #endif | 116 #endif |
OLD | NEW |