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

Side by Side Diff: src/sksl/SkSLGLSLCodeGenerator.cpp

Issue 2300023002: minor SkSL changes to avoid compiler errors in Chromium (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « no previous file | src/sksl/SkSLIRGenerator.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 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 "SkSLGLSLCodeGenerator.h" 8 #include "SkSLGLSLCodeGenerator.h"
9 9
10 #include "string.h" 10 #include "string.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 this->write(type.name()); 61 this->write(type.name());
62 return; 62 return;
63 } 63 }
64 } 64 }
65 fWrittenStructs.push_back(&type); 65 fWrittenStructs.push_back(&type);
66 this->writeLine("struct " + type.name() + " {"); 66 this->writeLine("struct " + type.name() + " {");
67 fIndentation++; 67 fIndentation++;
68 for (const auto& f : type.fields()) { 68 for (const auto& f : type.fields()) {
69 this->writeModifiers(f.fModifiers); 69 this->writeModifiers(f.fModifiers);
70 // sizes (which must be static in structs) are part of the type name here 70 // sizes (which must be static in structs) are part of the type name here
71 this->writeType(f.fType); 71 this->writeType(*f.fType);
72 this->writeLine(" " + f.fName + ";"); 72 this->writeLine(" " + f.fName + ";");
73 } 73 }
74 fIndentation--; 74 fIndentation--;
75 this->writeLine("}"); 75 this->writeLine("}");
76 } else { 76 } else {
77 this->write(type.name()); 77 this->write(type.name());
78 } 78 }
79 } 79 }
80 80
81 void GLSLCodeGenerator::writeExpression(const Expression& expr, Precedence paren tPrecedence) { 81 void GLSLCodeGenerator::writeExpression(const Expression& expr, Precedence paren tPrecedence) {
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 299
300 void GLSLCodeGenerator::writeInterfaceBlock(const InterfaceBlock& intf) { 300 void GLSLCodeGenerator::writeInterfaceBlock(const InterfaceBlock& intf) {
301 if (intf.fVariable.fName == "gl_PerVertex") { 301 if (intf.fVariable.fName == "gl_PerVertex") {
302 return; 302 return;
303 } 303 }
304 this->writeModifiers(intf.fVariable.fModifiers); 304 this->writeModifiers(intf.fVariable.fModifiers);
305 this->writeLine(intf.fVariable.fType.name() + " {"); 305 this->writeLine(intf.fVariable.fType.name() + " {");
306 fIndentation++; 306 fIndentation++;
307 for (const auto& f : intf.fVariable.fType.fields()) { 307 for (const auto& f : intf.fVariable.fType.fields()) {
308 this->writeModifiers(f.fModifiers); 308 this->writeModifiers(f.fModifiers);
309 this->writeType(f.fType); 309 this->writeType(*f.fType);
310 this->writeLine(" " + f.fName + ";"); 310 this->writeLine(" " + f.fName + ";");
311 } 311 }
312 fIndentation--; 312 fIndentation--;
313 this->writeLine("};"); 313 this->writeLine("};");
314 } 314 }
315 315
316 void GLSLCodeGenerator::writeVarDeclaration(const VarDeclaration& decl) { 316 void GLSLCodeGenerator::writeVarDeclaration(const VarDeclaration& decl) {
317 ASSERT(decl.fVars.size() > 0); 317 ASSERT(decl.fVars.size() > 0);
318 this->writeModifiers(decl.fVars[0]->fModifiers); 318 this->writeModifiers(decl.fVars[0]->fModifiers);
319 this->writeType(decl.fBaseType); 319 this->writeType(decl.fBaseType);
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 break; 470 break;
471 default: 471 default:
472 printf("%s\n", e->description().c_str()); 472 printf("%s\n", e->description().c_str());
473 ABORT("unsupported program element"); 473 ABORT("unsupported program element");
474 } 474 }
475 } 475 }
476 fOut = nullptr; 476 fOut = nullptr;
477 } 477 }
478 478
479 } 479 }
OLDNEW
« no previous file with comments | « no previous file | src/sksl/SkSLIRGenerator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698