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

Unified Diff: src/sksl/SkSLIRGenerator.h

Issue 2131223002: SkSL performance improvements (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/sksl/SkSLContext.h ('k') | src/sksl/SkSLIRGenerator.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/sksl/SkSLIRGenerator.h
diff --git a/src/sksl/SkSLIRGenerator.h b/src/sksl/SkSLIRGenerator.h
index d23e5a1bdb3a31eb1e901febbce4d70f0290413e..2384b2dabc2762874f7feeceb554e7a76ecdc42c 100644
--- a/src/sksl/SkSLIRGenerator.h
+++ b/src/sksl/SkSLIRGenerator.h
@@ -53,7 +53,8 @@ namespace SkSL {
*/
class IRGenerator {
public:
- IRGenerator(std::shared_ptr<SymbolTable> root, ErrorReporter& errorReporter);
+ IRGenerator(const Context* context, std::shared_ptr<SymbolTable> root,
+ ErrorReporter& errorReporter);
std::unique_ptr<VarDeclaration> convertVarDeclaration(const ASTVarDeclaration& decl,
Variable::Storage storage);
@@ -65,21 +66,20 @@ private:
void pushSymbolTable();
void popSymbolTable();
- std::shared_ptr<Type> convertType(const ASTType& type);
+ const Type* convertType(const ASTType& type);
std::unique_ptr<Expression> call(Position position,
- std::shared_ptr<FunctionDeclaration> function,
+ const FunctionDeclaration& function,
std::vector<std::unique_ptr<Expression>> arguments);
- bool determineCallCost(std::shared_ptr<FunctionDeclaration> function,
+ bool determineCallCost(const FunctionDeclaration& function,
const std::vector<std::unique_ptr<Expression>>& arguments,
int* outCost);
std::unique_ptr<Expression> call(Position position, std::unique_ptr<Expression> function,
std::vector<std::unique_ptr<Expression>> arguments);
- std::unique_ptr<Expression> coerce(std::unique_ptr<Expression> expr,
- std::shared_ptr<Type> type);
+ std::unique_ptr<Expression> coerce(std::unique_ptr<Expression> expr, const Type& type);
std::unique_ptr<Block> convertBlock(const ASTBlock& block);
std::unique_ptr<Statement> convertBreak(const ASTBreakStatement& b);
std::unique_ptr<Expression> convertConstructor(Position position,
- std::shared_ptr<Type> type,
+ const Type& type,
std::vector<std::unique_ptr<Expression>> params);
std::unique_ptr<Statement> convertContinue(const ASTContinueStatement& c);
std::unique_ptr<Statement> convertDiscard(const ASTDiscardStatement& d);
@@ -106,10 +106,11 @@ private:
std::unique_ptr<Statement> convertWhile(const ASTWhileStatement& w);
void checkValid(const Expression& expr);
- void markReadFrom(std::shared_ptr<Variable> var);
+ void markReadFrom(const Variable& var);
void markWrittenTo(const Expression& expr);
- std::shared_ptr<FunctionDeclaration> fCurrentFunction;
+ const Context& fContext;
+ const FunctionDeclaration* fCurrentFunction;
std::shared_ptr<SymbolTable> fSymbolTable;
ErrorReporter& fErrors;
« no previous file with comments | « src/sksl/SkSLContext.h ('k') | src/sksl/SkSLIRGenerator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698