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

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

Issue 783763002: Initial CL to move color / coverage off of drawstate (Closed) Base URL: https://skia.googlesource.com/skia.git@no-static-gp
Patch Set: bug fix 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/GrInOrderDrawBuffer.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 12 matching lines...) Expand all
23 /** 23 /**
24 * Class that holds an optimized version of a GrDrawState. It is meant to be an immutable class, 24 * Class that holds an optimized version of a GrDrawState. It is meant to be an immutable class,
25 * and contains all data needed to set the state for a gpu draw. 25 * and contains all data needed to set the state for a gpu draw.
26 */ 26 */
27 class GrOptDrawState { 27 class GrOptDrawState {
28 public: 28 public:
29 SK_DECLARE_INST_COUNT(GrOptDrawState) 29 SK_DECLARE_INST_COUNT(GrOptDrawState)
30 30
31 typedef GrClipMaskManager::ScissorState ScissorState; 31 typedef GrClipMaskManager::ScissorState ScissorState;
32 32
33 GrOptDrawState(const GrDrawState& drawState, const GrDrawTargetCaps&, const ScissorState&, 33 GrOptDrawState(const GrDrawState& drawState, GrColor, uint8_t coverage, cons t GrDrawTargetCaps&,
34 const GrDeviceCoordTexture* dstCopy, GrGpu::DrawType); 34 const ScissorState&, const GrDeviceCoordTexture* dstCopy, GrG pu::DrawType);
35 35
36 bool operator== (const GrOptDrawState& that) const; 36 bool operator== (const GrOptDrawState& that) const;
37 bool operator!= (const GrOptDrawState& that) const { return !(*this == that) ; } 37 bool operator!= (const GrOptDrawState& that) const { return !(*this == that) ; }
38 38
39 /// @} 39 /// @}
40 40
41 /////////////////////////////////////////////////////////////////////////// 41 ///////////////////////////////////////////////////////////////////////////
42 /// @name Color 42 /// @name Color
43 //// 43 ////
44 44
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 const GrProcOptInfo& colorPOI, 199 const GrProcOptInfo& colorPOI,
200 const GrProcOptInfo& coveragePOI, 200 const GrProcOptInfo& coveragePOI,
201 int* firstColorStageIdx, 201 int* firstColorStageIdx,
202 int* firstCoverageStageIdx); 202 int* firstCoverageStageIdx);
203 203
204 /** 204 /**
205 * 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
206 * 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
207 * blend coeffs will represent those used by backend API. 207 * blend coeffs will represent those used by backend API.
208 */ 208 */
209 void setOutputStateInfo(const GrDrawState& ds, GrXferProcessor::OptFlags, 209 void setOutputStateInfo(const GrDrawState& ds, GrColor coverage, GrXferProce ssor::OptFlags,
210 const GrDrawTargetCaps&); 210 const GrDrawTargetCaps&);
211 211
212 enum Flags { 212 enum Flags {
213 kDither_Flag = 0x1, 213 kDither_Flag = 0x1,
214 kHWAA_Flag = 0x2, 214 kHWAA_Flag = 0x2,
215 kDisableColorWrite_Flag = 0x4, 215 kDisableColorWrite_Flag = 0x4,
216 }; 216 };
217 217
218 typedef GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> RenderTarget; 218 typedef GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> RenderTarget;
219 typedef SkSTArray<8, GrPendingFragmentStage> FragmentStageArray; 219 typedef SkSTArray<8, GrPendingFragmentStage> FragmentStageArray;
(...skipping 21 matching lines...) Expand all
241 241
242 // 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.
243 int fNumColorStages; 243 int fNumColorStages;
244 244
245 GrProgramDesc fDesc; 245 GrProgramDesc fDesc;
246 246
247 typedef SkRefCnt INHERITED; 247 typedef SkRefCnt INHERITED;
248 }; 248 };
249 249
250 #endif 250 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrInOrderDrawBuffer.cpp ('k') | src/gpu/GrOptDrawState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698