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 GrOptDrawState_DEFINED | 8 #ifndef GrOptDrawState_DEFINED |
9 #define GrOptDrawState_DEFINED | 9 #define GrOptDrawState_DEFINED |
10 | 10 |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 | 187 |
188 // Finalize *MUST* be called before programDesc() | 188 // Finalize *MUST* be called before programDesc() |
189 void finalize(GrGpu*); | 189 void finalize(GrGpu*); |
190 | 190 |
191 const GrProgramDesc& programDesc() const { SkASSERT(fFinalized); return fDes
c; } | 191 const GrProgramDesc& programDesc() const { SkASSERT(fFinalized); return fDes
c; } |
192 | 192 |
193 private: | 193 private: |
194 /** | 194 /** |
195 * Alter the program desc and inputs (attribs and processors) based on the b
lend optimization. | 195 * Alter the program desc and inputs (attribs and processors) based on the b
lend optimization. |
196 */ | 196 */ |
197 void adjustProgramFromOptimizations(const GrDrawState& ds, | 197 void adjustProgramForBlendOpt(const GrDrawState& ds, GrDrawState::BlendOpt, |
198 GrXferProcessor::OptFlags, | 198 int* firstColorStageIdx, int* firstCoverageSta
geIdx); |
199 const GrProcOptInfo& colorPOI, | 199 |
200 const GrProcOptInfo& coveragePOI, | 200 /** |
201 int* firstColorStageIdx, | 201 * Loop over the effect stages to determine various info like what data they
will read and what |
202 int* firstCoverageStageIdx); | 202 * shaders they require. |
| 203 */ |
| 204 void getStageStats(const GrDrawState& ds, int firstColorStageIdx, int firstC
overageStageIdx, |
| 205 bool hasLocalCoords); |
203 | 206 |
204 /** | 207 /** |
205 * Calculates the primary and secondary output types of the shader. For cert
ain output types | 208 * Calculates the primary and secondary output types of the shader. For cert
ain output types |
206 * the function may adjust the blend coefficients. After this function is ca
lled the src and dst | 209 * the function may adjust the blend coefficients. After this function is ca
lled the src and dst |
207 * blend coeffs will represent those used by backend API. | 210 * blend coeffs will represent those used by backend API. |
208 */ | 211 */ |
209 void setOutputStateInfo(const GrDrawState& ds, GrXferProcessor::OptFlags, | 212 void setOutputStateInfo(const GrDrawState& ds, GrDrawState::BlendOpt, const
GrDrawTargetCaps&); |
210 const GrDrawTargetCaps&); | |
211 | 213 |
212 enum Flags { | 214 enum Flags { |
213 kDither_Flag = 0x1, | 215 kDither_Flag = 0x1, |
214 kHWAA_Flag = 0x2, | 216 kHWAA_Flag = 0x2, |
215 kDisableColorWrite_Flag = 0x4, | 217 kDisableColorWrite_Flag = 0x4, |
216 }; | 218 }; |
217 | 219 |
218 typedef GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> RenderTarget; | 220 typedef GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> RenderTarget; |
219 typedef SkSTArray<8, GrPendingFragmentStage> FragmentStageArray; | 221 typedef SkSTArray<8, GrPendingFragmentStage> FragmentStageArray; |
220 typedef GrPendingProgramElement<const GrGeometryProcessor> ProgramGeometryPr
ocessor; | 222 typedef GrPendingProgramElement<const GrGeometryProcessor> ProgramGeometryPr
ocessor; |
(...skipping 20 matching lines...) Expand all Loading... |
241 | 243 |
242 // This function is equivalent to the offset into fFragmentStages where cove
rage stages begin. | 244 // This function is equivalent to the offset into fFragmentStages where cove
rage stages begin. |
243 int fNumColorStages; | 245 int fNumColorStages; |
244 | 246 |
245 GrProgramDesc fDesc; | 247 GrProgramDesc fDesc; |
246 | 248 |
247 typedef SkRefCnt INHERITED; | 249 typedef SkRefCnt INHERITED; |
248 }; | 250 }; |
249 | 251 |
250 #endif | 252 #endif |
OLD | NEW |