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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
80 GrBlendCoeff fSrcBlend; | 80 GrBlendCoeff fSrcBlend; |
81 GrBlendCoeff fDstBlend; | 81 GrBlendCoeff fDstBlend; |
82 GrColor fBlendConstant; | 82 GrColor fBlendConstant; |
83 }; | 83 }; |
84 | 84 |
85 virtual void getBlendInfo(BlendInfo* blendInfo) const = 0; | 85 virtual void getBlendInfo(BlendInfo* blendInfo) const = 0; |
86 | 86 |
87 /** Will this prceossor read the destination pixel value? */ | 87 /** Will this prceossor read the destination pixel value? */ |
88 bool willReadDstColor() const { return fWillReadDstColor; } | 88 bool willReadDstColor() const { return fWillReadDstColor; } |
89 | 89 |
90 /** | |
91 * This function is used to perform optimizations. When called the invarient Ouput param | |
92 * indicate whether the input components to this processor in the FS will ha ve known values. | |
93 * In inout the validFlags member is a bitfield of GrColorComponentFlags. Th e isSingleComponent | |
94 * member indicates whether the input will be 1 or 4 bytes. The function upd ates the members of | |
95 * inout to indicate known values of its output. A component of the color me mber only has | |
96 * meaning if the corresponding bit in validFlags is set. | |
97 */ | |
98 void computeInvariantOutput(GrInvariantOutput* inout) const; | |
bsalomon
2014/12/09 20:39:50
Do we need this at all?
| |
99 | |
90 protected: | 100 protected: |
91 GrXferProcessor() : fWillReadDstColor(false) {} | 101 GrXferProcessor() : fWillReadDstColor(false) {} |
92 | 102 |
93 /** | 103 /** |
94 * If the prceossor subclass will read the destination pixel value then it m ust call this | 104 * If the prceossor subclass will read the destination pixel value then it m ust call this |
95 * function from its constructor. Otherwise, when its generated backend-spec ific prceossor class | 105 * function from its constructor. Otherwise, when its generated backend-spec ific prceossor class |
96 * attempts to generate code that reads the destination pixel it will fail. | 106 * attempts to generate code that reads the destination pixel it will fail. |
97 */ | 107 */ |
98 void setWillReadDstColor() { fWillReadDstColor = true; } | 108 void setWillReadDstColor() { fWillReadDstColor = true; } |
99 | 109 |
110 /** | |
111 * Subclass implements this to support getConstantColorComponents(...). | |
bsalomon
2014/12/09 20:39:50
comment is wrong?
| |
112 */ | |
113 virtual void onComputeInvariantOutput(GrInvariantOutput* inout) const = 0; | |
114 | |
100 private: | 115 private: |
101 | 116 |
102 bool fWillReadDstColor; | 117 bool fWillReadDstColor; |
103 | 118 |
104 typedef GrFragmentProcessor INHERITED; | 119 typedef GrFragmentProcessor INHERITED; |
105 }; | 120 }; |
106 | 121 |
107 GR_MAKE_BITFIELD_OPS(GrXferProcessor::OptFlags); | 122 GR_MAKE_BITFIELD_OPS(GrXferProcessor::OptFlags); |
108 | 123 |
109 /** | 124 /** |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
205 enum { | 220 enum { |
206 kIllegalXPFClassID = 0, | 221 kIllegalXPFClassID = 0, |
207 }; | 222 }; |
208 static int32_t gCurrXPFClassID; | 223 static int32_t gCurrXPFClassID; |
209 | 224 |
210 typedef GrProgramElement INHERITED; | 225 typedef GrProgramElement INHERITED; |
211 }; | 226 }; |
212 | 227 |
213 #endif | 228 #endif |
214 | 229 |
OLD | NEW |