| OLD | NEW | 
|---|
| 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 #ifndef SKSL_COMPILER | 8 #ifndef SKSL_COMPILER | 
| 9 #define SKSL_COMPILER | 9 #define SKSL_COMPILER | 
| 10 | 10 | 
| 11 #include <vector> | 11 #include <vector> | 
| 12 #include "ir/SkSLProgram.h" | 12 #include "ir/SkSLProgram.h" | 
| 13 #include "ir/SkSLSymbolTable.h" | 13 #include "ir/SkSLSymbolTable.h" | 
| 14 #include "SkSLContext.h" | 14 #include "SkSLContext.h" | 
| 15 #include "SkSLErrorReporter.h" | 15 #include "SkSLErrorReporter.h" | 
| 16 #include "SkSLGLSLCodeGenerator.h" | 16 #include "SkSLGLSLCodeGenerator.h" | 
| 17 | 17 | 
| 18 #define SK_FRAGCOLOR_BUILTIN 10001 |  | 
| 19 |  | 
| 20 namespace SkSL { | 18 namespace SkSL { | 
| 21 | 19 | 
| 22 class IRGenerator; | 20 class IRGenerator; | 
| 23 | 21 | 
| 24 /** | 22 /** | 
| 25  * Main compiler entry point. This is a traditional compiler design which first 
    parses the .sksl | 23  * Main compiler entry point. This is a traditional compiler design which first 
    parses the .sksl | 
| 26  * file into an abstract syntax tree (a tree of ASTNodes), then performs semanti
    c analysis to | 24  * file into an abstract syntax tree (a tree of ASTNodes), then performs semanti
    c analysis to | 
| 27  * produce a Program (a tree of IRNodes), then feeds the Program into a CodeGene
    rator to produce | 25  * produce a Program (a tree of IRNodes), then feeds the Program into a CodeGene
    rator to produce | 
| 28  * compiled output. | 26  * compiled output. | 
| 29  * |  | 
| 30  * See the README for information about SkSL. |  | 
| 31  */ | 27  */ | 
| 32 class Compiler : public ErrorReporter { | 28 class Compiler : public ErrorReporter { | 
| 33 public: | 29 public: | 
| 34     Compiler(); | 30     Compiler(); | 
| 35 | 31 | 
| 36     ~Compiler(); | 32     ~Compiler(); | 
| 37 | 33 | 
| 38     std::unique_ptr<Program> convertProgram(Program::Kind kind, std::string text
    ); | 34     std::unique_ptr<Program> convertProgram(Program::Kind kind, std::string text
    ); | 
| 39 | 35 | 
| 40     bool toSPIRV(Program::Kind kind, const std::string& text, std::ostream& out)
    ; | 36     bool toSPIRV(Program::Kind kind, const std::string& text, std::ostream& out)
    ; | 
| (...skipping 20 matching lines...) Expand all  Loading... | 
| 61     std::string fSkiaVertText; // FIXME store parsed version instead | 57     std::string fSkiaVertText; // FIXME store parsed version instead | 
| 62 | 58 | 
| 63     Context fContext; | 59     Context fContext; | 
| 64     int fErrorCount; | 60     int fErrorCount; | 
| 65     std::string fErrorText; | 61     std::string fErrorText; | 
| 66 }; | 62 }; | 
| 67 | 63 | 
| 68 } // namespace | 64 } // namespace | 
| 69 | 65 | 
| 70 #endif | 66 #endif | 
| OLD | NEW | 
|---|