| 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 14 matching lines...) Expand all Loading... |
| 25 typedef GrGLSLTextureSampler::TextureSamplerArray TextureSamplerArray; | 25 typedef GrGLSLTextureSampler::TextureSamplerArray TextureSamplerArray; |
| 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 TextureSamplerArray& samplers, | 35 const TextureSamplerArray& samplers) |
| 36 const bool usePLSDstRead) | |
| 37 : fXPFragBuilder(fragBuilder) | 36 : fXPFragBuilder(fragBuilder) |
| 38 , fUniformHandler(uniformHandler) | 37 , fUniformHandler(uniformHandler) |
| 39 , fGLSLCaps(caps) | 38 , fGLSLCaps(caps) |
| 40 , fXP(xp) | 39 , fXP(xp) |
| 41 , fInputColor(inputColor) | 40 , fInputColor(inputColor) |
| 42 , fInputCoverage(inputCoverage) | 41 , fInputCoverage(inputCoverage) |
| 43 , fOutputPrimary(outputPrimary) | 42 , fOutputPrimary(outputPrimary) |
| 44 , fOutputSecondary(outputSecondary) | 43 , fOutputSecondary(outputSecondary) |
| 45 , fSamplers(samplers) | 44 , fSamplers(samplers) {} |
| 46 , fUsePLSDstRead(usePLSDstRead) {} | |
| 47 | 45 |
| 48 GrGLSLXPFragmentBuilder* fXPFragBuilder; | 46 GrGLSLXPFragmentBuilder* fXPFragBuilder; |
| 49 GrGLSLUniformHandler* fUniformHandler; | 47 GrGLSLUniformHandler* fUniformHandler; |
| 50 const GrGLSLCaps* fGLSLCaps; | 48 const GrGLSLCaps* fGLSLCaps; |
| 51 const GrXferProcessor& fXP; | 49 const GrXferProcessor& fXP; |
| 52 const char* fInputColor; | 50 const char* fInputColor; |
| 53 const char* fInputCoverage; | 51 const char* fInputCoverage; |
| 54 const char* fOutputPrimary; | 52 const char* fOutputPrimary; |
| 55 const char* fOutputSecondary; | 53 const char* fOutputSecondary; |
| 56 const TextureSamplerArray& fSamplers; | 54 const TextureSamplerArray& fSamplers; |
| 57 bool fUsePLSDstRead; | |
| 58 }; | 55 }; |
| 59 /** | 56 /** |
| 60 * This is similar to emitCode() in the base class, except it takes a full s
hader builder. | 57 * 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. | 58 * This allows the effect subclass to emit vertex code. |
| 62 */ | 59 */ |
| 63 void emitCode(const EmitArgs&); | 60 void emitCode(const EmitArgs&); |
| 64 | 61 |
| 65 /** A GrGLSLXferProcessor instance can be reused with any GrGLSLXferProcesso
r that produces | 62 /** 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 | 63 the same stage key; this function reads data from a GrGLSLXferProcessor
and uploads any |
| 67 uniform variables required by the shaders created in emitCode(). The Gr
XferProcessor | 64 uniform variables required by the shaders created in emitCode(). The Gr
XferProcessor |
| (...skipping 28 matching lines...) Expand all Loading... |
| 96 const GrXferProcessor&) { | 93 const GrXferProcessor&) { |
| 97 SkFAIL("emitBlendCodeForDstRead not implemented."); | 94 SkFAIL("emitBlendCodeForDstRead not implemented."); |
| 98 } | 95 } |
| 99 | 96 |
| 100 virtual void onSetData(const GrGLSLProgramDataManager&, const GrXferProcesso
r&) = 0; | 97 virtual void onSetData(const GrGLSLProgramDataManager&, const GrXferProcesso
r&) = 0; |
| 101 | 98 |
| 102 GrGLSLProgramDataManager::UniformHandle fDstTopLeftUni; | 99 GrGLSLProgramDataManager::UniformHandle fDstTopLeftUni; |
| 103 GrGLSLProgramDataManager::UniformHandle fDstScaleUni; | 100 GrGLSLProgramDataManager::UniformHandle fDstScaleUni; |
| 104 }; | 101 }; |
| 105 #endif | 102 #endif |
| OLD | NEW |