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