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 | |
79 private: | 71 private: |
80 /** | 72 /** |
81 * Called by emitCode() when the XP will not be performing a dst read. This
method is | 73 * Called by emitCode() when the XP will not be performing a dst read. This
method is |
82 * responsible for both blending and coverage. A subclass only needs to impl
ement this method if | 74 * responsible for both blending and coverage. A subclass only needs to impl
ement this method if |
83 * it can construct a GrXferProcessor that will not read the dst color. | 75 * it can construct a GrXferProcessor that will not read the dst color. |
84 */ | 76 */ |
85 virtual void emitOutputsForBlendState(const EmitArgs&) { | 77 virtual void emitOutputsForBlendState(const EmitArgs&) { |
86 SkFAIL("emitOutputsForBlendState not implemented."); | 78 SkFAIL("emitOutputsForBlendState not implemented."); |
87 } | 79 } |
88 | 80 |
(...skipping 12 matching lines...) Expand all Loading... |
101 const GrXferProcessor&) { | 93 const GrXferProcessor&) { |
102 SkFAIL("emitBlendCodeForDstRead not implemented."); | 94 SkFAIL("emitBlendCodeForDstRead not implemented."); |
103 } | 95 } |
104 | 96 |
105 virtual void onSetData(const GrGLSLProgramDataManager&, const GrXferProcesso
r&) = 0; | 97 virtual void onSetData(const GrGLSLProgramDataManager&, const GrXferProcesso
r&) = 0; |
106 | 98 |
107 GrGLSLProgramDataManager::UniformHandle fDstTopLeftUni; | 99 GrGLSLProgramDataManager::UniformHandle fDstTopLeftUni; |
108 GrGLSLProgramDataManager::UniformHandle fDstScaleUni; | 100 GrGLSLProgramDataManager::UniformHandle fDstScaleUni; |
109 }; | 101 }; |
110 #endif | 102 #endif |
OLD | NEW |