OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 GrXferProcessor_DEFINED | 8 #ifndef GrXferProcessor_DEFINED |
9 #define GrXferProcessor_DEFINED | 9 #define GrXferProcessor_DEFINED |
10 | 10 |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 protected: | 127 protected: |
128 GrXferProcessor() : fWillReadDstColor(false) {} | 128 GrXferProcessor() : fWillReadDstColor(false) {} |
129 | 129 |
130 /** | 130 /** |
131 * If the prceossor subclass will read the destination pixel value then it m
ust call this | 131 * If the prceossor subclass will read the destination pixel value then it m
ust call this |
132 * function from its constructor. Otherwise, when its generated backend-spec
ific prceossor class | 132 * function from its constructor. Otherwise, when its generated backend-spec
ific prceossor class |
133 * attempts to generate code that reads the destination pixel it will fail. | 133 * attempts to generate code that reads the destination pixel it will fail. |
134 */ | 134 */ |
135 void setWillReadDstColor() { fWillReadDstColor = true; } | 135 void setWillReadDstColor() { fWillReadDstColor = true; } |
136 | 136 |
| 137 /** |
| 138 * Subclass implements this to support getConstantColorComponents(...). |
| 139 */ |
| 140 virtual void onComputeInvariantOutput(GrInvariantOutput* inout) const = 0; |
| 141 |
137 private: | 142 private: |
138 virtual bool onIsEqual(const GrXferProcessor&) const = 0; | 143 virtual bool onIsEqual(const GrXferProcessor&) const = 0; |
139 | 144 |
140 bool fWillReadDstColor; | 145 bool fWillReadDstColor; |
141 | 146 |
142 typedef GrFragmentProcessor INHERITED; | 147 typedef GrFragmentProcessor INHERITED; |
143 }; | 148 }; |
144 | 149 |
145 GR_MAKE_BITFIELD_OPS(GrXferProcessor::OptFlags); | 150 GR_MAKE_BITFIELD_OPS(GrXferProcessor::OptFlags); |
146 | 151 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 enum { | 248 enum { |
244 kIllegalXPFClassID = 0, | 249 kIllegalXPFClassID = 0, |
245 }; | 250 }; |
246 static int32_t gCurrXPFClassID; | 251 static int32_t gCurrXPFClassID; |
247 | 252 |
248 typedef GrProgramElement INHERITED; | 253 typedef GrProgramElement INHERITED; |
249 }; | 254 }; |
250 | 255 |
251 #endif | 256 #endif |
252 | 257 |
OLD | NEW |