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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 | 61 |
62 /** 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 |
63 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 |
64 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 |
65 parameter is guaranteed to be of the same type that created this GrGLSLX
ferProcessor and | 65 parameter is guaranteed to be of the same type that created this GrGLSLX
ferProcessor and |
66 to have an identical processor key as the one that created this GrGLSLXf
erProcessor. This | 66 to have an identical processor key as the one that created this GrGLSLXf
erProcessor. This |
67 function calls onSetData on the subclass of GrGLSLXferProcessor | 67 function calls onSetData on the subclass of GrGLSLXferProcessor |
68 */ | 68 */ |
69 void setData(const GrGLSLProgramDataManager& pdm, const GrXferProcessor& xp)
; | 69 void setData(const GrGLSLProgramDataManager& pdm, const GrXferProcessor& xp)
; |
70 | 70 |
| 71 protected: |
| 72 static void DefaultCoverageModulation(GrGLSLXPFragmentBuilder* fragBuilder, |
| 73 const char* srcCoverage, |
| 74 const char* dstColor, |
| 75 const char* outColor, |
| 76 const char* outColorSecondary, |
| 77 const GrXferProcessor& proc); |
| 78 |
71 private: | 79 private: |
72 /** | 80 /** |
73 * Called by emitCode() when the XP will not be performing a dst read. This
method is | 81 * Called by emitCode() when the XP will not be performing a dst read. This
method is |
74 * responsible for both blending and coverage. A subclass only needs to impl
ement this method if | 82 * responsible for both blending and coverage. A subclass only needs to impl
ement this method if |
75 * it can construct a GrXferProcessor that will not read the dst color. | 83 * it can construct a GrXferProcessor that will not read the dst color. |
76 */ | 84 */ |
77 virtual void emitOutputsForBlendState(const EmitArgs&) { | 85 virtual void emitOutputsForBlendState(const EmitArgs&) { |
78 SkFAIL("emitOutputsForBlendState not implemented."); | 86 SkFAIL("emitOutputsForBlendState not implemented."); |
79 } | 87 } |
80 | 88 |
(...skipping 12 matching lines...) Expand all Loading... |
93 const GrXferProcessor&) { | 101 const GrXferProcessor&) { |
94 SkFAIL("emitBlendCodeForDstRead not implemented."); | 102 SkFAIL("emitBlendCodeForDstRead not implemented."); |
95 } | 103 } |
96 | 104 |
97 virtual void onSetData(const GrGLSLProgramDataManager&, const GrXferProcesso
r&) = 0; | 105 virtual void onSetData(const GrGLSLProgramDataManager&, const GrXferProcesso
r&) = 0; |
98 | 106 |
99 GrGLSLProgramDataManager::UniformHandle fDstTopLeftUni; | 107 GrGLSLProgramDataManager::UniformHandle fDstTopLeftUni; |
100 GrGLSLProgramDataManager::UniformHandle fDstScaleUni; | 108 GrGLSLProgramDataManager::UniformHandle fDstScaleUni; |
101 }; | 109 }; |
102 #endif | 110 #endif |
OLD | NEW |