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

Unified Diff: src/sksl/ir/SkSLType.h

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/sksl/ir/SkSLSymbolTable.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/sksl/ir/SkSLType.h
diff --git a/src/sksl/ir/SkSLType.h b/src/sksl/ir/SkSLType.h
index a929c8e4c7a2ce7226e92493e84858ca64ab8520..ad2185b4ee183ac82fc7af2bf4ea2facbe17250a 100644
--- a/src/sksl/ir/SkSLType.h
+++ b/src/sksl/ir/SkSLType.h
@@ -26,18 +26,18 @@ class Context;
class Type : public Symbol {
public:
struct Field {
- Field(Modifiers modifiers, std::string name, const Type& type)
+ Field(Modifiers modifiers, std::string name, const Type* type)
: fModifiers(modifiers)
, fName(std::move(name))
, fType(std::move(type)) {}
const std::string description() const {
- return fType.description() + " " + fName + ";";
+ return fType->description() + " " + fName + ";";
}
- const Modifiers fModifiers;
- const std::string fName;
- const Type& fType;
+ Modifiers fModifiers;
+ std::string fName;
+ const Type* fType;
};
enum Kind {
@@ -259,7 +259,7 @@ public:
case kStruct_Kind: {
size_t result = 16;
for (size_t i = 0; i < fFields.size(); i++) {
- size_t alignment = fFields[i].fType.alignment();
+ size_t alignment = fFields[i].fType->alignment();
if (alignment > result) {
result = alignment;
}
@@ -302,13 +302,13 @@ public:
case kStruct_Kind: {
size_t total = 0;
for (size_t i = 0; i < fFields.size(); i++) {
- size_t alignment = fFields[i].fType.alignment();
+ size_t alignment = fFields[i].fType->alignment();
if (total % alignment != 0) {
total += alignment - total % alignment;
}
ASSERT(false);
ASSERT(total % alignment == 0);
- total += fFields[i].fType.size();
+ total += fFields[i].fType->size();
}
return total;
}
@@ -329,10 +329,10 @@ private:
const Kind fTypeKind;
const bool fIsNumber = false;
const Type* fComponentType = nullptr;
- const std::vector<const Type*> fCoercibleTypes = { };
+ const std::vector<const Type*> fCoercibleTypes;
const int fColumns = -1;
const int fRows = -1;
- const std::vector<Field> fFields = { };
+ const std::vector<Field> fFields;
const SpvDim_ fDimensions = SpvDim1D;
const bool fIsDepth = false;
const bool fIsArrayed = false;
« no previous file with comments | « src/sksl/ir/SkSLSymbolTable.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698