Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Side by Side Diff: src/gpu/GrOptDrawState.h

Issue 759713002: Make all blending up to GrOptDrawState be handled by the xp/xp factory. (Closed) Base URL: https://skia.googlesource.com/skia.git@xferFactorySolo
Patch Set: rebase Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/GrDrawState.cpp ('k') | src/gpu/GrOptDrawState.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 adjustProgramForBlendOpt(const GrDrawState& ds, GrDrawState::BlendOpt, 197 void adjustProgramFromOptimizations(const GrDrawState& ds,
198 int* firstColorStageIdx, int* firstCoverageSta geIdx); 198 GrXferProcessor::OptFlags,
199 199 const GrProcOptInfo& colorPOI,
200 /** 200 const GrProcOptInfo& coveragePOI,
201 * Loop over the effect stages to determine various info like what data they will read and what 201 int* firstColorStageIdx,
202 * shaders they require. 202 int* firstCoverageStageIdx);
203 */
204 void getStageStats(const GrDrawState& ds, int firstColorStageIdx, int firstC overageStageIdx,
205 bool hasLocalCoords);
206 203
207 /** 204 /**
208 * Calculates the primary and secondary output types of the shader. For cert ain output types 205 * Calculates the primary and secondary output types of the shader. For cert ain output types
209 * the function may adjust the blend coefficients. After this function is ca lled the src and dst 206 * the function may adjust the blend coefficients. After this function is ca lled the src and dst
210 * blend coeffs will represent those used by backend API. 207 * blend coeffs will represent those used by backend API.
211 */ 208 */
212 void setOutputStateInfo(const GrDrawState& ds, GrDrawState::BlendOpt, const GrDrawTargetCaps&); 209 void setOutputStateInfo(const GrDrawState& ds, GrXferProcessor::OptFlags,
210 const GrDrawTargetCaps&);
213 211
214 enum Flags { 212 enum Flags {
215 kDither_Flag = 0x1, 213 kDither_Flag = 0x1,
216 kHWAA_Flag = 0x2, 214 kHWAA_Flag = 0x2,
217 kDisableColorWrite_Flag = 0x4, 215 kDisableColorWrite_Flag = 0x4,
218 }; 216 };
219 217
220 typedef GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> RenderTarget; 218 typedef GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> RenderTarget;
221 typedef SkSTArray<8, GrPendingFragmentStage> FragmentStageArray; 219 typedef SkSTArray<8, GrPendingFragmentStage> FragmentStageArray;
222 typedef GrPendingProgramElement<const GrGeometryProcessor> ProgramGeometryPr ocessor; 220 typedef GrPendingProgramElement<const GrGeometryProcessor> ProgramGeometryPr ocessor;
(...skipping 20 matching lines...) Expand all
243 241
244 // This function is equivalent to the offset into fFragmentStages where cove rage stages begin. 242 // This function is equivalent to the offset into fFragmentStages where cove rage stages begin.
245 int fNumColorStages; 243 int fNumColorStages;
246 244
247 GrProgramDesc fDesc; 245 GrProgramDesc fDesc;
248 246
249 typedef SkRefCnt INHERITED; 247 typedef SkRefCnt INHERITED;
250 }; 248 };
251 249
252 #endif 250 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrDrawState.cpp ('k') | src/gpu/GrOptDrawState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698