| 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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 // other than pass through values from the VS to the FS anyway). | 181 // other than pass through values from the VS to the FS anyway). |
| 182 #if GR_GL_EXPERIMENTAL_GS | 182 #if GR_GL_EXPERIMENTAL_GS |
| 183 #if 0 | 183 #if 0 |
| 184 header->fExperimentalGS = gpu->caps().geometryShaderSupport(); | 184 header->fExperimentalGS = gpu->caps().geometryShaderSupport(); |
| 185 #else | 185 #else |
| 186 header->fExperimentalGS = false; | 186 header->fExperimentalGS = false; |
| 187 #endif | 187 #endif |
| 188 #endif | 188 #endif |
| 189 bool defaultToUniformInputs = GR_GL_NO_CONSTANT_ATTRIBUTES || gpu->caps()->p
athRenderingSupport(); | 189 bool defaultToUniformInputs = GR_GL_NO_CONSTANT_ATTRIBUTES || gpu->caps()->p
athRenderingSupport(); |
| 190 | 190 |
| 191 if (defaultToUniformInputs && !requiresColorAttrib && inputColorIsUsed) { | 191 if (!inputColorIsUsed && !skipColor) { |
| 192 header->fColorInput = kAllOnes_ColorInput; |
| 193 } else if (defaultToUniformInputs && !requiresColorAttrib && inputColorIsUse
d) { |
| 192 header->fColorInput = kUniform_ColorInput; | 194 header->fColorInput = kUniform_ColorInput; |
| 193 } else { | 195 } else { |
| 194 header->fColorInput = kAttribute_ColorInput; | 196 header->fColorInput = kAttribute_ColorInput; |
| 195 header->fRequiresVertexShader = true; | 197 header->fRequiresVertexShader = true; |
| 196 } | 198 } |
| 197 | 199 |
| 198 bool covIsSolidWhite = !requiresCoverageAttrib && 0xffffffff == drawState.ge
tCoverageColor(); | 200 bool covIsSolidWhite = !requiresCoverageAttrib && 0xffffffff == drawState.ge
tCoverageColor(); |
| 199 | 201 |
| 200 if ((covIsSolidWhite || !inputCoverageIsUsed) && !skipCoverage) { | 202 if ((covIsSolidWhite || !inputCoverageIsUsed) && !skipCoverage) { |
| 201 header->fCoverageInput = kSolidWhite_ColorInput; | 203 header->fCoverageInput = kAllOnes_ColorInput; |
| 202 } else if (defaultToUniformInputs && !requiresCoverageAttrib && inputCoverag
eIsUsed) { | 204 } else if (defaultToUniformInputs && !requiresCoverageAttrib && inputCoverag
eIsUsed) { |
| 203 header->fCoverageInput = kUniform_ColorInput; | 205 header->fCoverageInput = kUniform_ColorInput; |
| 204 } else { | 206 } else { |
| 205 header->fCoverageInput = kAttribute_ColorInput; | 207 header->fCoverageInput = kAttribute_ColorInput; |
| 206 header->fRequiresVertexShader = true; | 208 header->fRequiresVertexShader = true; |
| 207 } | 209 } |
| 208 | 210 |
| 209 if (readsDst) { | 211 if (readsDst) { |
| 210 SkASSERT(NULL != dstCopy || gpu->caps()->dstReadInShaderSupport()); | 212 SkASSERT(NULL != dstCopy || gpu->caps()->dstReadInShaderSupport()); |
| 211 const GrTexture* dstCopyTexture = NULL; | 213 const GrTexture* dstCopyTexture = NULL; |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 *checksum = 0; | 318 *checksum = 0; |
| 317 *checksum = SkChecksum::Compute(reinterpret_cast<uint32_t*>(fKey.begin()), k
eyLength); | 319 *checksum = SkChecksum::Compute(reinterpret_cast<uint32_t*>(fKey.begin()), k
eyLength); |
| 318 } | 320 } |
| 319 | 321 |
| 320 GrGLProgramDesc& GrGLProgramDesc::operator= (const GrGLProgramDesc& other) { | 322 GrGLProgramDesc& GrGLProgramDesc::operator= (const GrGLProgramDesc& other) { |
| 321 size_t keyLength = other.keyLength(); | 323 size_t keyLength = other.keyLength(); |
| 322 fKey.reset(keyLength); | 324 fKey.reset(keyLength); |
| 323 memcpy(fKey.begin(), other.fKey.begin(), keyLength); | 325 memcpy(fKey.begin(), other.fKey.begin(), keyLength); |
| 324 return *this; | 326 return *this; |
| 325 } | 327 } |
| OLD | NEW |