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

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

Issue 746423007: Draft change to start pulling uniform color into GP (Closed) Base URL: https://skia.googlesource.com/skia.git@no_factories
Patch Set: cleanup 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
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 GrProgramDesc_DEFINED 8 #ifndef GrProgramDesc_DEFINED
9 #define GrProgramDesc_DEFINED 9 #define GrProgramDesc_DEFINED
10 10
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 }; 65 };
66 66
67 struct KeyHeader { 67 struct KeyHeader {
68 uint8_t fDstReadKey; // set by GrGLShaderBuilder i f there 68 uint8_t fDstReadKey; // set by GrGLShaderBuilder i f there
69 // are effects that must read the dst. 69 // are effects that must read the dst.
70 // Otherwise, 0. 70 // Otherwise, 0.
71 uint8_t fFragPosKey; // set by GrGLShaderBuilder i f there are 71 uint8_t fFragPosKey; // set by GrGLShaderBuilder i f there are
72 // effects that read the frag ment position. 72 // effects that read the frag ment position.
73 // Otherwise, 0. 73 // Otherwise, 0.
74 74
75 ColorInput fColorInput : 8;
76 ColorInput fCoverageInput : 8;
77
78 SkBool8 fHasGeometryProcessor;
79 int8_t fColorEffectCnt; 75 int8_t fColorEffectCnt;
80 int8_t fCoverageEffectCnt; 76 int8_t fCoverageEffectCnt;
81 }; 77 };
82 78
83
84 bool hasGeometryProcessor() const {
85 return SkToBool(this->header().fHasGeometryProcessor);
86 }
87
88 int numColorEffects() const { 79 int numColorEffects() const {
89 return this->header().fColorEffectCnt; 80 return this->header().fColorEffectCnt;
90 } 81 }
91 82
92 int numCoverageEffects() const { 83 int numCoverageEffects() const {
93 return this->header().fCoverageEffectCnt; 84 return this->header().fCoverageEffectCnt;
94 } 85 }
95 86
96 int numTotalEffects() const { return this->numColorEffects() + this->numCove rageEffects(); } 87 int numTotalEffects() const { return this->numColorEffects() + this->numCove rageEffects(); }
97 88
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 kPreAllocSize = kHeaderOffset + kHeaderSize + 159 kPreAllocSize = kHeaderOffset + kHeaderSize +
169 kMaxPreallocProcessors * sizeof(uint32_t) * kIntsPerProc essor, 160 kMaxPreallocProcessors * sizeof(uint32_t) * kIntsPerProc essor,
170 }; 161 };
171 162
172 SkSTArray<kPreAllocSize, uint8_t, true> fKey; 163 SkSTArray<kPreAllocSize, uint8_t, true> fKey;
173 164
174 friend class GrGLProgramDescBuilder; 165 friend class GrGLProgramDescBuilder;
175 }; 166 };
176 167
177 #endif 168 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698