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 GrProgramDesc_DEFINED | 8 #ifndef GrProgramDesc_DEFINED |
9 #define GrProgramDesc_DEFINED | 9 #define GrProgramDesc_DEFINED |
10 | 10 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 const uint32_t* bKey = b.asKey(); | 63 const uint32_t* bKey = b.asKey(); |
64 for (int i = 0; i < l; ++i) { | 64 for (int i = 0; i < l; ++i) { |
65 if (aKey[i] != bKey[i]) { | 65 if (aKey[i] != bKey[i]) { |
66 return aKey[i] < bKey[i] ? true : false; | 66 return aKey[i] < bKey[i] ? true : false; |
67 } | 67 } |
68 } | 68 } |
69 return false; | 69 return false; |
70 } | 70 } |
71 | 71 |
72 struct KeyHeader { | 72 struct KeyHeader { |
| 73 // Used to handle swizzles because of mismatch between GrPixelConfig of
the dst and its |
| 74 // actual format. |
| 75 uint8_t fSwapDstRedAndAlpha; |
73 uint8_t fFragPosKey; // set by GrGLShaderBuilder i
f there are | 76 uint8_t fFragPosKey; // set by GrGLShaderBuilder i
f there are |
74 // effects that read the frag
ment position. | 77 // effects that read the frag
ment position. |
75 // Otherwise, 0. | 78 // Otherwise, 0. |
76 uint8_t fSnapVerticesToPixelCenters; | 79 uint8_t fSnapVerticesToPixelCenters; |
77 int8_t fColorEffectCnt; | 80 int8_t fColorEffectCnt; |
78 int8_t fCoverageEffectCnt; | 81 int8_t fCoverageEffectCnt; |
79 uint8_t fIgnoresCoverage; | 82 uint8_t fIgnoresCoverage; |
80 }; | 83 }; |
81 GR_STATIC_ASSERT(sizeof(KeyHeader) == 5); | |
82 | 84 |
83 int numColorEffects() const { | 85 int numColorEffects() const { |
84 return this->header().fColorEffectCnt; | 86 return this->header().fColorEffectCnt; |
85 } | 87 } |
86 | 88 |
87 int numCoverageEffects() const { | 89 int numCoverageEffects() const { |
88 return this->header().fCoverageEffectCnt; | 90 return this->header().fCoverageEffectCnt; |
89 } | 91 } |
90 | 92 |
91 int numTotalEffects() const { return this->numColorEffects() + this->numCove
rageEffects(); } | 93 int numTotalEffects() const { return this->numColorEffects() + this->numCove
rageEffects(); } |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 }; | 137 }; |
136 | 138 |
137 SkSTArray<kPreAllocSize, uint8_t, true>& key() { return fKey; } | 139 SkSTArray<kPreAllocSize, uint8_t, true>& key() { return fKey; } |
138 const SkSTArray<kPreAllocSize, uint8_t, true>& key() const { return fKey; } | 140 const SkSTArray<kPreAllocSize, uint8_t, true>& key() const { return fKey; } |
139 | 141 |
140 private: | 142 private: |
141 SkSTArray<kPreAllocSize, uint8_t, true> fKey; | 143 SkSTArray<kPreAllocSize, uint8_t, true> fKey; |
142 }; | 144 }; |
143 | 145 |
144 #endif | 146 #endif |
OLD | NEW |