| 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 | 7 |
| 8 #include "gl/builders/GrGLProgramBuilder.h" | 8 #include "gl/builders/GrGLProgramBuilder.h" |
| 9 #include "GrGLProgramDesc.h" | 9 #include "GrGLProgramDesc.h" |
| 10 #include "GrBackendEffectFactory.h" | 10 #include "GrBackendEffectFactory.h" |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 GrGpuGL* gpu, | 166 GrGpuGL* gpu, |
| 167 const GrDeviceCoordTexture* dstCopy, | 167 const GrDeviceCoordTexture* dstCopy, |
| 168 const GrEffectStage** geometryProcessor, | 168 const GrEffectStage** geometryProcessor, |
| 169 SkTArray<const GrEffectStage*, true>* colorStages, | 169 SkTArray<const GrEffectStage*, true>* colorStages, |
| 170 SkTArray<const GrEffectStage*, true>* coverageStages
, | 170 SkTArray<const GrEffectStage*, true>* coverageStages
, |
| 171 GrGLProgramDesc* desc) { | 171 GrGLProgramDesc* desc) { |
| 172 colorStages->reset(); | 172 colorStages->reset(); |
| 173 coverageStages->reset(); | 173 coverageStages->reset(); |
| 174 | 174 |
| 175 bool inputColorIsUsed = optState.inputColorIsUsed(); | 175 bool inputColorIsUsed = optState.inputColorIsUsed(); |
| 176 bool inputCoverageIsUsed = optState.inputColorIsUsed(); | 176 bool inputCoverageIsUsed = optState.inputCoverageIsUsed(); |
| 177 | 177 |
| 178 // The descriptor is used as a cache key. Thus when a field of the | 178 // The descriptor is used as a cache key. Thus when a field of the |
| 179 // descriptor will not affect program generation (because of the attribute | 179 // descriptor will not affect program generation (because of the attribute |
| 180 // bindings in use or other descriptor field settings) it should be set | 180 // bindings in use or other descriptor field settings) it should be set |
| 181 // to a canonical value to avoid duplicate programs with different keys. | 181 // to a canonical value to avoid duplicate programs with different keys. |
| 182 | 182 |
| 183 bool requiresColorAttrib = optState.hasColorVertexAttribute(); | 183 bool requiresColorAttrib = optState.hasColorVertexAttribute(); |
| 184 bool requiresCoverageAttrib = optState.hasCoverageVertexAttribute(); | 184 bool requiresCoverageAttrib = optState.hasCoverageVertexAttribute(); |
| 185 bool requiresLocalCoordAttrib = optState.requiresLocalCoordAttrib(); | 185 bool requiresLocalCoordAttrib = optState.requiresLocalCoordAttrib(); |
| 186 | 186 |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 *checksum = 0; | 369 *checksum = 0; |
| 370 *checksum = SkChecksum::Compute(reinterpret_cast<uint32_t*>(fKey.begin()), k
eyLength); | 370 *checksum = SkChecksum::Compute(reinterpret_cast<uint32_t*>(fKey.begin()), k
eyLength); |
| 371 } | 371 } |
| 372 | 372 |
| 373 GrGLProgramDesc& GrGLProgramDesc::operator= (const GrGLProgramDesc& other) { | 373 GrGLProgramDesc& GrGLProgramDesc::operator= (const GrGLProgramDesc& other) { |
| 374 size_t keyLength = other.keyLength(); | 374 size_t keyLength = other.keyLength(); |
| 375 fKey.reset(keyLength); | 375 fKey.reset(keyLength); |
| 376 memcpy(fKey.begin(), other.fKey.begin(), keyLength); | 376 memcpy(fKey.begin(), other.fKey.begin(), keyLength); |
| 377 return *this; | 377 return *this; |
| 378 } | 378 } |
| OLD | NEW |