| 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 "GrGLProgramDesc.h" | 8 #include "GrGLProgramDesc.h" |
| 9 #include "GrBackendEffectFactory.h" | 9 #include "GrBackendEffectFactory.h" |
| 10 #include "GrDrawEffect.h" | 10 #include "GrDrawEffect.h" |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 header->fColorInput = kTransBlack_ColorInput; | 149 header->fColorInput = kTransBlack_ColorInput; |
| 150 } else if (colorIsSolidWhite) { | 150 } else if (colorIsSolidWhite) { |
| 151 header->fColorInput = kSolidWhite_ColorInput; | 151 header->fColorInput = kSolidWhite_ColorInput; |
| 152 } else if (defaultToUniformInputs && !requiresColorAttrib) { | 152 } else if (defaultToUniformInputs && !requiresColorAttrib) { |
| 153 header->fColorInput = kUniform_ColorInput; | 153 header->fColorInput = kUniform_ColorInput; |
| 154 } else { | 154 } else { |
| 155 header->fColorInput = kAttribute_ColorInput; | 155 header->fColorInput = kAttribute_ColorInput; |
| 156 header->fHasVertexCode = true; | 156 header->fHasVertexCode = true; |
| 157 } | 157 } |
| 158 | 158 |
| 159 bool covIsSolidWhite = !requiresCoverageAttrib && 0xffffffff == drawState.ge
tCoverageColor(); | 159 bool covIsSolidWhite = !requiresCoverageAttrib && 0xffffffff == drawState.ge
tCoverage(); |
| 160 | 160 |
| 161 if (skipCoverage) { | 161 if (skipCoverage) { |
| 162 header->fCoverageInput = kTransBlack_ColorInput; | 162 header->fCoverageInput = kTransBlack_ColorInput; |
| 163 } else if (covIsSolidWhite || !inputCoverageIsUsed) { | 163 } else if (covIsSolidWhite || !inputCoverageIsUsed) { |
| 164 header->fCoverageInput = kSolidWhite_ColorInput; | 164 header->fCoverageInput = kSolidWhite_ColorInput; |
| 165 } else if (defaultToUniformInputs && !requiresCoverageAttrib) { | 165 } else if (defaultToUniformInputs && !requiresCoverageAttrib) { |
| 166 header->fCoverageInput = kUniform_ColorInput; | 166 header->fCoverageInput = kUniform_ColorInput; |
| 167 } else { | 167 } else { |
| 168 header->fCoverageInput = kAttribute_ColorInput; | 168 header->fCoverageInput = kAttribute_ColorInput; |
| 169 header->fHasVertexCode = true; | 169 header->fHasVertexCode = true; |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 | 280 |
| 281 GrGLProgramDesc& GrGLProgramDesc::operator= (const GrGLProgramDesc& other) { | 281 GrGLProgramDesc& GrGLProgramDesc::operator= (const GrGLProgramDesc& other) { |
| 282 fInitialized = other.fInitialized; | 282 fInitialized = other.fInitialized; |
| 283 if (fInitialized) { | 283 if (fInitialized) { |
| 284 size_t keyLength = other.keyLength(); | 284 size_t keyLength = other.keyLength(); |
| 285 fKey.reset(keyLength); | 285 fKey.reset(keyLength); |
| 286 memcpy(fKey.get(), other.fKey.get(), keyLength); | 286 memcpy(fKey.get(), other.fKey.get(), keyLength); |
| 287 } | 287 } |
| 288 return *this; | 288 return *this; |
| 289 } | 289 } |
| OLD | NEW |