OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "GrGLVertexShaderBuilder.h" | 8 #include "GrGLVertexShaderBuilder.h" |
9 #include "GrGLProgramBuilder.h" | 9 #include "GrGLProgramBuilder.h" |
10 #include "GrGLShaderStringBuilder.h" | 10 #include "GrGLShaderStringBuilder.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 fProgramBuilder->fUniformHandles.fRTAdjustmentUni = | 47 fProgramBuilder->fUniformHandles.fRTAdjustmentUni = |
48 fProgramBuilder->addUniform(GrGLProgramBuilder::kVertex_Visibility, | 48 fProgramBuilder->addUniform(GrGLProgramBuilder::kVertex_Visibility, |
49 kVec4f_GrSLType, kDefault_GrSLPrecision, | 49 kVec4f_GrSLType, kDefault_GrSLPrecision, |
50 fProgramBuilder->rtAdjustment(), | 50 fProgramBuilder->rtAdjustment(), |
51 &fRtAdjustName); | 51 &fRtAdjustName); |
52 // Wire transforms | 52 // Wire transforms |
53 SkTArray<GrGLProgramBuilder::TransformVarying, true>& transVs = fProgramBuil
der->fCoordVaryings; | 53 SkTArray<GrGLProgramBuilder::TransformVarying, true>& transVs = fProgramBuil
der->fCoordVaryings; |
54 int transformCount = transVs.count(); | 54 int transformCount = transVs.count(); |
55 for (int i = 0; i < transformCount; i++) { | 55 for (int i = 0; i < transformCount; i++) { |
56 GrCoordSet coordSet = transVs[i].fCoordSet; | 56 GrCoordSet coordSet = transVs[i].fCoordSet; |
57 const char* coords; | 57 const char* coords = NULL; |
58 switch (coordSet) { | 58 switch (coordSet) { |
59 default: | |
60 SkFAIL("Case missing"); | |
61 case kPosition_GrCoordSet: | |
62 coords = this->positionCoords(); | |
63 break; | |
64 case kLocal_GrCoordSet: | 59 case kLocal_GrCoordSet: |
65 coords = this->localCoords(); | 60 coords = this->localCoords(); |
66 break; | 61 break; |
67 case kDevice_GrCoordSet: | 62 case kDevice_GrCoordSet: |
68 coords = this->glPosition(); | 63 coords = this->glPosition(); |
69 break; | 64 break; |
70 } | 65 } |
71 | 66 |
72 // varying = matrix * coords (logically) | 67 // varying = matrix * coords (logically) |
73 const GrGLVarying& v = transVs[i].fV; | 68 const GrGLVarying& v = transVs[i].fV; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 for (int i = 0; i < fInputs.count(); ++i) { | 128 for (int i = 0; i < fInputs.count(); ++i) { |
134 const GrGLShaderVar& attr = fInputs[i]; | 129 const GrGLShaderVar& attr = fInputs[i]; |
135 // if attribute already added, don't add it again | 130 // if attribute already added, don't add it again |
136 if (attr.getName().equals(var.getName())) { | 131 if (attr.getName().equals(var.getName())) { |
137 return false; | 132 return false; |
138 } | 133 } |
139 } | 134 } |
140 fInputs.push_back(var); | 135 fInputs.push_back(var); |
141 return true; | 136 return true; |
142 } | 137 } |
OLD | NEW |