| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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/GrGLShaderBuilder.h" | 8 #include "gl/GrGLShaderBuilder.h" |
| 9 #include "gl/GrGLProgram.h" | 9 #include "gl/GrGLProgram.h" |
| 10 #include "gl/GrGLUniformHandle.h" | 10 #include "gl/GrGLUniformHandle.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 #else | 110 #else |
| 111 , fUsesGS(false) | 111 , fUsesGS(false) |
| 112 #endif | 112 #endif |
| 113 , fSetupFragPosition(false) | 113 , fSetupFragPosition(false) |
| 114 , fRTHeightUniform(GrGLUniformManager::kInvalidUniformHandle) | 114 , fRTHeightUniform(GrGLUniformManager::kInvalidUniformHandle) |
| 115 , fDstCopyTopLeftUniform (GrGLUniformManager::kInvalidUniformHandle) | 115 , fDstCopyTopLeftUniform (GrGLUniformManager::kInvalidUniformHandle) |
| 116 , fDstCopyScaleUniform (GrGLUniformManager::kInvalidUniformHandle) { | 116 , fDstCopyScaleUniform (GrGLUniformManager::kInvalidUniformHandle) { |
| 117 | 117 |
| 118 fPositionVar = &fVSAttrs.push_back(); | 118 fPositionVar = &fVSAttrs.push_back(); |
| 119 fPositionVar->set(kVec2f_GrSLType, GrGLShaderVar::kAttribute_TypeModifier, "
aPosition"); | 119 fPositionVar->set(kVec2f_GrSLType, GrGLShaderVar::kAttribute_TypeModifier, "
aPosition"); |
| 120 if (desc.fAttribBindings & GrDrawState::kLocalCoords_AttribBindingsBit) { | 120 if (-1 != desc.fLocalCoordAttributeIndex) { |
| 121 fLocalCoordsVar = &fVSAttrs.push_back(); | 121 fLocalCoordsVar = &fVSAttrs.push_back(); |
| 122 fLocalCoordsVar->set(kVec2f_GrSLType, | 122 fLocalCoordsVar->set(kVec2f_GrSLType, |
| 123 GrGLShaderVar::kAttribute_TypeModifier, | 123 GrGLShaderVar::kAttribute_TypeModifier, |
| 124 "aLocalCoords"); | 124 "aLocalCoords"); |
| 125 } else { | 125 } else { |
| 126 fLocalCoordsVar = fPositionVar; | 126 fLocalCoordsVar = fPositionVar; |
| 127 } | 127 } |
| 128 if (kNoDstRead_DstReadKey != desc.fDstRead) { | 128 if (kNoDstRead_DstReadKey != desc.fDstRead) { |
| 129 bool topDown = SkToBool(kTopLeftOrigin_DstReadKeyBit & desc.fDstRead); | 129 bool topDown = SkToBool(kTopLeftOrigin_DstReadKeyBit & desc.fDstRead); |
| 130 const char* dstCopyTopLeftName; | 130 const char* dstCopyTopLeftName; |
| (...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 for (const AttributePair* attrib = this->getEffectAttributes().begin(); | 648 for (const AttributePair* attrib = this->getEffectAttributes().begin(); |
| 649 attrib != attribEnd; | 649 attrib != attribEnd; |
| 650 ++attrib) { | 650 ++attrib) { |
| 651 if (attrib->fIndex == attributeIndex) { | 651 if (attrib->fIndex == attributeIndex) { |
| 652 return &attrib->fName; | 652 return &attrib->fName; |
| 653 } | 653 } |
| 654 } | 654 } |
| 655 | 655 |
| 656 return NULL; | 656 return NULL; |
| 657 } | 657 } |
| OLD | NEW |