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 "GrGLFragmentShaderBuilder.h" | 8 #include "GrGLFragmentShaderBuilder.h" |
9 #include "GrGLShaderStringBuilder.h" | 9 #include "GrGLShaderStringBuilder.h" |
10 #include "GrGLProgramBuilder.h" | 10 #include "GrGLProgramBuilder.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 } | 113 } |
114 return true; | 114 return true; |
115 } | 115 } |
116 default: | 116 default: |
117 SkFAIL("Unexpected GLSLFeature requested."); | 117 SkFAIL("Unexpected GLSLFeature requested."); |
118 return false; | 118 return false; |
119 } | 119 } |
120 } | 120 } |
121 | 121 |
122 SkString GrGLFragmentShaderBuilder::ensureFSCoords2D(const TransformedCoordsArra
y& coords, int index) { | 122 SkString GrGLFragmentShaderBuilder::ensureFSCoords2D(const TransformedCoordsArra
y& coords, int index) { |
123 if (kVec3f_GrSLType != coords[index].type()) { | 123 if (kVec3f_GrSLType != coords[index].getType()) { |
124 SkASSERT(kVec2f_GrSLType == coords[index].type()); | 124 SkASSERT(kVec2f_GrSLType == coords[index].getType()); |
125 return coords[index].getName(); | 125 return coords[index].getName(); |
126 } | 126 } |
127 | 127 |
128 SkString coords2D("coords2D"); | 128 SkString coords2D("coords2D"); |
129 if (0 != index) { | 129 if (0 != index) { |
130 coords2D.appendf("_%i", index); | 130 coords2D.appendf("_%i", index); |
131 } | 131 } |
132 this->codeAppendf("\tvec2 %s = %s.xy / %s.z;", | 132 this->codeAppendf("\tvec2 %s = %s.xy / %s.z;", |
133 coords2D.c_str(), coords[index].c_str(), coords[index].c_s
tr()); | 133 coords2D.c_str(), coords[index].c_str(), coords[index].c_s
tr()); |
134 return coords2D; | 134 return coords2D; |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 dual_source_output_name()); | 343 dual_source_output_name()); |
344 fHasSecondaryOutput = true; | 344 fHasSecondaryOutput = true; |
345 } | 345 } |
346 return dual_source_output_name(); | 346 return dual_source_output_name(); |
347 } | 347 } |
348 | 348 |
349 const char* GrGLFragmentShaderBuilder::getColorOutputName() const { | 349 const char* GrGLFragmentShaderBuilder::getColorOutputName() const { |
350 return fHasCustomColorOutput ? declared_color_output_name() : "gl_FragColor"
; | 350 return fHasCustomColorOutput ? declared_color_output_name() : "gl_FragColor"
; |
351 } | 351 } |
352 | 352 |
OLD | NEW |