| 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 // Set by GrGLShaderBuilder if there are effects that read the fragment
position. Otherwise, | 73 // Set to uniquely identify the rt's origin, or 0 if the shader does not
require this info. |
| 74 // 0. | 74 uint8_t fSurfaceOriginKey; |
| 75 uint8_t fFragPosKey; | 75 // Set to uniquely identify the sample pattern, or 0 if the shader doesn
't use sample |
| 76 // locations. |
| 77 uint8_t fSamplePatternKey; |
| 76 // Set to uniquely idenitify any swizzling of the shader's output color(
s). | 78 // Set to uniquely idenitify any swizzling of the shader's output color(
s). |
| 77 uint8_t fOutputSwizzle; | 79 uint8_t fOutputSwizzle; |
| 78 uint8_t fSnapVerticesToPixelCenters; | 80 uint8_t fSnapVerticesToPixelCenters; |
| 79 int8_t fColorEffectCnt; | 81 int8_t fColorEffectCnt; |
| 80 int8_t fCoverageEffectCnt; | 82 int8_t fCoverageEffectCnt; |
| 81 uint8_t fIgnoresCoverage; | 83 uint8_t fIgnoresCoverage; |
| 82 }; | 84 }; |
| 83 | 85 |
| 84 int numColorEffects() const { | 86 int numColorEffects() const { |
| 85 return this->header().fColorEffectCnt; | 87 return this->header().fColorEffectCnt; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 }; | 138 }; |
| 137 | 139 |
| 138 SkSTArray<kPreAllocSize, uint8_t, true>& key() { return fKey; } | 140 SkSTArray<kPreAllocSize, uint8_t, true>& key() { return fKey; } |
| 139 const SkSTArray<kPreAllocSize, uint8_t, true>& key() const { return fKey; } | 141 const SkSTArray<kPreAllocSize, uint8_t, true>& key() const { return fKey; } |
| 140 | 142 |
| 141 private: | 143 private: |
| 142 SkSTArray<kPreAllocSize, uint8_t, true> fKey; | 144 SkSTArray<kPreAllocSize, uint8_t, true> fKey; |
| 143 }; | 145 }; |
| 144 | 146 |
| 145 #endif | 147 #endif |
| OLD | NEW |