| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 #include "GrGLProgramDesc.h" | 7 #include "GrGLProgramDesc.h" |
| 8 | 8 |
| 9 #include "GrGLProcessor.h" | 9 #include "GrGLProcessor.h" |
| 10 #include "GrProcessor.h" | 10 #include "GrProcessor.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 uint32_t* key = b->add32n(2); | 83 uint32_t* key = b->add32n(2); |
| 84 key[0] = (textureKey << 16 | transformKey); | 84 key[0] = (textureKey << 16 | transformKey); |
| 85 key[1] = (classID << 16 | SkToU16(processorKeySize)); | 85 key[1] = (classID << 16 | SkToU16(processorKeySize)); |
| 86 return true; | 86 return true; |
| 87 } | 87 } |
| 88 | 88 |
| 89 bool GrGLProgramDescBuilder::Build(GrProgramDesc* desc, | 89 bool GrGLProgramDescBuilder::Build(GrProgramDesc* desc, |
| 90 const GrPrimitiveProcessor& primProc, | 90 const GrPrimitiveProcessor& primProc, |
| 91 const GrOptDrawState& optState, | 91 const GrOptDrawState& optState, |
| 92 const GrProgramDesc::DescInfo& descInfo, | 92 const GrProgramDesc::DescInfo& descInfo, |
| 93 GrGpu::DrawType drawType, | |
| 94 const GrGLGpu* gpu, | 93 const GrGLGpu* gpu, |
| 95 const GrBatchTracker& batchTracker) { | 94 const GrBatchTracker& batchTracker) { |
| 96 // The descriptor is used as a cache key. Thus when a field of the | 95 // The descriptor is used as a cache key. Thus when a field of the |
| 97 // descriptor will not affect program generation (because of the attribute | 96 // descriptor will not affect program generation (because of the attribute |
| 98 // bindings in use or other descriptor field settings) it should be set | 97 // bindings in use or other descriptor field settings) it should be set |
| 99 // to a canonical value to avoid duplicate programs with different keys. | 98 // to a canonical value to avoid duplicate programs with different keys. |
| 100 | 99 |
| 101 GR_STATIC_ASSERT(0 == kProcessorKeysOffset % sizeof(uint32_t)); | 100 GR_STATIC_ASSERT(0 == kProcessorKeysOffset % sizeof(uint32_t)); |
| 102 // Make room for everything up to the effect keys. | 101 // Make room for everything up to the effect keys. |
| 103 desc->fKey.reset(); | 102 desc->fKey.reset(); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 gpu->glCaps())
; | 155 gpu->glCaps())
; |
| 157 } else { | 156 } else { |
| 158 header->fFragPosKey = 0; | 157 header->fFragPosKey = 0; |
| 159 } | 158 } |
| 160 | 159 |
| 161 header->fColorEffectCnt = optState.numColorStages(); | 160 header->fColorEffectCnt = optState.numColorStages(); |
| 162 header->fCoverageEffectCnt = optState.numCoverageStages(); | 161 header->fCoverageEffectCnt = optState.numCoverageStages(); |
| 163 desc->finalize(); | 162 desc->finalize(); |
| 164 return true; | 163 return true; |
| 165 } | 164 } |
| OLD | NEW |