Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(300)

Side by Side Diff: src/gpu/gl/GrGLShaderVar.h

Issue 133413003: Rename GrGLBinding->GrGLStandard, no longer a bitfield (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: actually fix enum names? Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 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 #ifndef GrGLShaderVar_DEFINED 8 #ifndef GrGLShaderVar_DEFINED
9 #define GrGLShaderVar_DEFINED 9 #define GrGLShaderVar_DEFINED
10 10
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 if (kUpperLeft_Origin == fOrigin) { 260 if (kUpperLeft_Origin == fOrigin) {
261 // this is the only place where we specify a layout modifier. If we use other layout 261 // this is the only place where we specify a layout modifier. If we use other layout
262 // modifiers in the future then they should be placed in a list. 262 // modifiers in the future then they should be placed in a list.
263 out->append("layout(origin_upper_left) "); 263 out->append("layout(origin_upper_left) ");
264 } 264 }
265 if (this->getTypeModifier() != kNone_TypeModifier) { 265 if (this->getTypeModifier() != kNone_TypeModifier) {
266 out->append(TypeModifierString(this->getTypeModifier(), 266 out->append(TypeModifierString(this->getTypeModifier(),
267 ctxInfo.glslGeneration())); 267 ctxInfo.glslGeneration()));
268 out->append(" "); 268 out->append(" ");
269 } 269 }
270 out->append(PrecisionString(fPrecision, ctxInfo.binding())); 270 out->append(PrecisionString(fPrecision, ctxInfo.standard()));
271 GrSLType effectiveType = this->getType(); 271 GrSLType effectiveType = this->getType();
272 if (this->isArray()) { 272 if (this->isArray()) {
273 if (this->isUnsizedArray()) { 273 if (this->isUnsizedArray()) {
274 out->appendf("%s %s[]", 274 out->appendf("%s %s[]",
275 GrGLSLTypeString(effectiveType), 275 GrGLSLTypeString(effectiveType),
276 this->getName().c_str()); 276 this->getName().c_str());
277 } else { 277 } else {
278 SkASSERT(this->getArrayCount() > 0); 278 SkASSERT(this->getArrayCount() > 0);
279 out->appendf("%s %s[%d]", 279 out->appendf("%s %s[%d]",
280 GrGLSLTypeString(effectiveType), 280 GrGLSLTypeString(effectiveType),
(...skipping 14 matching lines...) Expand all
295 fUseUniformFloatArrays ? "" : ".x"); 295 fUseUniformFloatArrays ? "" : ".x");
296 } 296 }
297 297
298 void appendArrayAccess(const char* indexName, SkString* out) const { 298 void appendArrayAccess(const char* indexName, SkString* out) const {
299 out->appendf("%s[%s]%s", 299 out->appendf("%s[%s]%s",
300 this->getName().c_str(), 300 this->getName().c_str(),
301 indexName, 301 indexName,
302 fUseUniformFloatArrays ? "" : ".x"); 302 fUseUniformFloatArrays ? "" : ".x");
303 } 303 }
304 304
305 static const char* PrecisionString(Precision p, GrGLBinding binding) { 305 static const char* PrecisionString(Precision p, GrGLStandard standard) {
306 // Desktop GLSL has added precision qualifiers but they don't do anythin g. 306 // Desktop GLSL has added precision qualifiers but they don't do anythin g.
307 if (kES_GrGLBinding == binding) { 307 if (kGLES_GrGLStandard == standard) {
308 switch (p) { 308 switch (p) {
309 case kLow_Precision: 309 case kLow_Precision:
310 return "lowp "; 310 return "lowp ";
311 case kMedium_Precision: 311 case kMedium_Precision:
312 return "mediump "; 312 return "mediump ";
313 case kHigh_Precision: 313 case kHigh_Precision:
314 return "highp "; 314 return "highp ";
315 case kDefault_Precision: 315 case kDefault_Precision:
316 return ""; 316 return "";
317 default: 317 default:
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 SkString fName; 351 SkString fName;
352 int fCount; 352 int fCount;
353 Precision fPrecision; 353 Precision fPrecision;
354 Origin fOrigin; 354 Origin fOrigin;
355 /// Work around driver bugs on some hardware that don't correctly 355 /// Work around driver bugs on some hardware that don't correctly
356 /// support uniform float [] 356 /// support uniform float []
357 bool fUseUniformFloatArrays; 357 bool fUseUniformFloatArrays;
358 }; 358 };
359 359
360 #endif 360 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698