diff options
Diffstat (limited to 'src/sksl/SkSLIRGenerator.cpp')
-rw-r--r-- | src/sksl/SkSLIRGenerator.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/sksl/SkSLIRGenerator.cpp b/src/sksl/SkSLIRGenerator.cpp index 2a4c85dd7c..9910513fbb 100644 --- a/src/sksl/SkSLIRGenerator.cpp +++ b/src/sksl/SkSLIRGenerator.cpp @@ -115,8 +115,8 @@ void IRGenerator::popSymbolTable() { fSymbolTable = fSymbolTable->fParent; } -static void fill_caps(const GrShaderCaps& caps, std::unordered_map<SkString, CapValue>* capsMap) { -#define CAP(name) capsMap->insert(std::make_pair(SkString(#name), CapValue(caps.name()))); +static void fill_caps(const SKSL_CAPS_CLASS& caps, std::unordered_map<String, CapValue>* capsMap) { +#define CAP(name) capsMap->insert(std::make_pair(String(#name), CapValue(caps.name()))); CAP(fbFetchSupport); CAP(fbFetchNeedsCustomOutput); CAP(bindlessTextureSupport); @@ -224,7 +224,7 @@ std::unique_ptr<VarDeclarations> IRGenerator::convertVarDeclarations(const ASTVa if (!size) { return nullptr; } - SkString name = type->fName; + String name = type->fName; int64_t count; if (size->fKind == Expression::kIntLiteral_Kind) { count = ((IntLiteral&) *size).fValue; @@ -255,7 +255,7 @@ std::unique_ptr<VarDeclarations> IRGenerator::convertVarDeclarations(const ASTVa } value = this->coerce(std::move(value), *type); } - if (storage == Variable::kGlobal_Storage && varDecl.fName == SkString("sk_FragColor") && + if (storage == Variable::kGlobal_Storage && varDecl.fName == String("sk_FragColor") && (*fSymbolTable)[varDecl.fName]) { // already defined, ignore } else if (storage == Variable::kGlobal_Storage && (*fSymbolTable)[varDecl.fName] && @@ -501,12 +501,12 @@ std::unique_ptr<FunctionDefinition> IRGenerator::convertFunction(const ASTFuncti } for (int j = (int) param->fSizes.size() - 1; j >= 0; j--) { int size = param->fSizes[j]; - SkString name = type->name() + "[" + to_string(size) + "]"; + String name = type->name() + "[" + to_string(size) + "]"; Type* newType = new Type(std::move(name), Type::kArray_Kind, *type, size); fSymbolTable->takeOwnership(newType); type = newType; } - SkString name = param->fName; + String name = param->fName; Position pos = param->fPosition; Variable* var = new Variable(pos, param->fModifiers, std::move(name), *type, Variable::kParameter_Storage); @@ -632,7 +632,7 @@ std::unique_ptr<InterfaceBlock> IRGenerator::convertInterfaceBlock(const ASTInte if (!converted) { return nullptr; } - SkString name = type->fName; + String name = type->fName; int64_t count; if (converted->fKind == Expression::kIntLiteral_Kind) { count = ((IntLiteral&) *converted).fValue; @@ -677,7 +677,7 @@ const Type* IRGenerator::convertType(const ASTType& type) { const Symbol* result = (*fSymbolTable)[type.fName]; if (result && result->fKind == Symbol::kType_Kind) { for (int size : type.fSizes) { - SkString name = result->fName + "["; + String name = result->fName + "["; if (size != -1) { name += to_string(size); } @@ -1116,7 +1116,7 @@ std::unique_ptr<Expression> IRGenerator::call(Position position, const FunctionDeclaration& function, std::vector<std::unique_ptr<Expression>> arguments) { if (function.fParameters.size() != arguments.size()) { - SkString msg = "call to '" + function.fName + "' expected " + + String msg = "call to '" + function.fName + "' expected " + to_string((uint64_t) function.fParameters.size()) + " argument"; if (function.fParameters.size() != 1) { @@ -1129,8 +1129,8 @@ std::unique_ptr<Expression> IRGenerator::call(Position position, std::vector<const Type*> types; const Type* returnType; if (!function.determineFinalTypes(arguments, &types, &returnType)) { - SkString msg = "no match for " + function.fName + "("; - SkString separator; + String msg = "no match for " + function.fName + "("; + String separator; for (size_t i = 0; i < arguments.size(); i++) { msg += separator; separator = ", "; @@ -1208,8 +1208,8 @@ std::unique_ptr<Expression> IRGenerator::call(Position position, if (best) { return this->call(position, *best, std::move(arguments)); } - SkString msg = "no match for " + ref->fFunctions[0]->fName + "("; - SkString separator; + String msg = "no match for " + ref->fFunctions[0]->fName + "("; + String separator; for (size_t i = 0; i < arguments.size(); i++) { msg += separator; separator = ", "; @@ -1466,7 +1466,7 @@ std::unique_ptr<Expression> IRGenerator::convertIndex(std::unique_ptr<Expression } std::unique_ptr<Expression> IRGenerator::convertField(std::unique_ptr<Expression> base, - const SkString& field) { + const String& field) { auto fields = base->fType.fields(); for (size_t i = 0; i < fields.size(); i++) { if (fields[i].fName == field) { @@ -1479,7 +1479,7 @@ std::unique_ptr<Expression> IRGenerator::convertField(std::unique_ptr<Expression } std::unique_ptr<Expression> IRGenerator::convertSwizzle(std::unique_ptr<Expression> base, - const SkString& fields) { + const String& fields) { if (base->fType.kind() != Type::kVector_Kind) { fErrors.error(base->fPosition, "cannot swizzle type '" + base->fType.description() + "'"); return nullptr; @@ -1517,7 +1517,7 @@ std::unique_ptr<Expression> IRGenerator::convertSwizzle(std::unique_ptr<Expressi } // fall through default: - fErrors.error(base->fPosition, SkStringPrintf("invalid swizzle component '%c'", + fErrors.error(base->fPosition, String::printf("invalid swizzle component '%c'", fields[i])); return nullptr; } @@ -1530,7 +1530,7 @@ std::unique_ptr<Expression> IRGenerator::convertSwizzle(std::unique_ptr<Expressi return std::unique_ptr<Expression>(new Swizzle(fContext, std::move(base), swizzleComponents)); } -std::unique_ptr<Expression> IRGenerator::getCap(Position position, SkString name) { +std::unique_ptr<Expression> IRGenerator::getCap(Position position, String name) { auto found = fCapsMap.find(name); if (found == fCapsMap.end()) { fErrors.error(position, "unknown capability flag '" + name + "'"); |