@@ -117,11 +117,11 @@ int ByteCodeGenerator::SlotCount(const Type& type) {
117
117
}
118
118
119
119
static inline bool is_uniform (const SkSL::Variable& var) {
120
- return var.fModifiers .fFlags & Modifiers::kUniform_Flag ;
120
+ return var.modifiers () .fFlags & Modifiers::kUniform_Flag ;
121
121
}
122
122
123
123
static inline bool is_in (const SkSL::Variable& var) {
124
- return var.fModifiers .fFlags & Modifiers::kIn_Flag ;
124
+ return var.modifiers () .fFlags & Modifiers::kIn_Flag ;
125
125
}
126
126
127
127
void ByteCodeGenerator::gatherUniforms (const Type& type, const String& name) {
@@ -165,7 +165,7 @@ bool ByteCodeGenerator::generateCode() {
165
165
if (declVar->type () == *fContext .fFragmentProcessor_Type ) {
166
166
fOutput ->fChildFPCount ++;
167
167
}
168
- if (declVar->fModifiers .fLayout .fBuiltin >= 0 || is_in (*declVar)) {
168
+ if (declVar->modifiers () .fLayout .fBuiltin >= 0 || is_in (*declVar)) {
169
169
continue ;
170
170
}
171
171
if (is_uniform (*declVar)) {
@@ -218,8 +218,8 @@ std::unique_ptr<ByteCodeFunction> ByteCodeGenerator::writeFunction(const Functio
218
218
static int expression_as_builtin (const Expression& e) {
219
219
if (e.is <VariableReference>()) {
220
220
const Variable& var (*e.as <VariableReference>().fVariable );
221
- if (var.fStorage == Variable::kGlobal_Storage ) {
222
- return var.fModifiers .fLayout .fBuiltin ;
221
+ if (var.storage () == Variable::kGlobal_Storage ) {
222
+ return var.modifiers () .fLayout .fBuiltin ;
223
223
}
224
224
}
225
225
return -1 ;
@@ -423,7 +423,7 @@ int ByteCodeGenerator::StackUsage(ByteCodeInstruction inst, int count_) {
423
423
ByteCodeGenerator::Location ByteCodeGenerator::getLocation (const Variable& var) {
424
424
// given that we seldom have more than a couple of variables, linear search is probably the most
425
425
// efficient way to handle lookups
426
- switch (var.fStorage ) {
426
+ switch (var.storage () ) {
427
427
case Variable::kLocal_Storage : {
428
428
for (int i = fLocals .size () - 1 ; i >= 0 ; --i) {
429
429
if (fLocals [i] == &var) {
@@ -486,7 +486,7 @@ ByteCodeGenerator::Location ByteCodeGenerator::getLocation(const Variable& var)
486
486
if (e.is <GlobalVarDeclaration>()) {
487
487
const GlobalVarDeclaration& decl = e.as <GlobalVarDeclaration>();
488
488
const Variable* declVar = decl.fDecl ->fVar ;
489
- if (declVar->fModifiers .fLayout .fBuiltin >= 0 || is_in (*declVar)) {
489
+ if (declVar->modifiers () .fLayout .fBuiltin >= 0 || is_in (*declVar)) {
490
490
continue ;
491
491
}
492
492
if (isUniform != is_uniform (*declVar)) {
@@ -1265,7 +1265,7 @@ void ByteCodeGenerator::writeFunctionCall(const FunctionCall& f) {
1265
1265
for (int i = 0 ; i < argCount; ++i) {
1266
1266
const auto & param = f.function ().fParameters [i];
1267
1267
const auto & arg = f.arguments ()[i];
1268
- if (param->fModifiers .fFlags & Modifiers::kOut_Flag ) {
1268
+ if (param->modifiers () .fFlags & Modifiers::kOut_Flag ) {
1269
1269
lvalues.emplace_back (this ->getLValue (*arg));
1270
1270
lvalues.back ()->load ();
1271
1271
} else {
@@ -1298,7 +1298,7 @@ void ByteCodeGenerator::writeFunctionCall(const FunctionCall& f) {
1298
1298
for (int i = argCount - 1 ; i >= 0 ; --i) {
1299
1299
const auto & param = f.function ().fParameters [i];
1300
1300
const auto & arg = f.arguments ()[i];
1301
- if (param->fModifiers .fFlags & Modifiers::kOut_Flag ) {
1301
+ if (param->modifiers () .fFlags & Modifiers::kOut_Flag ) {
1302
1302
pop ();
1303
1303
lvalues.back ()->store (true );
1304
1304
lvalues.pop_back ();
@@ -1834,7 +1834,7 @@ ByteCodeFunction::ByteCodeFunction(const FunctionDeclaration* declaration)
1834
1834
fParameterCount = 0 ;
1835
1835
for (const auto & p : declaration->fParameters ) {
1836
1836
int slots = ByteCodeGenerator::SlotCount (p->type ());
1837
- fParameters .push_back ({ slots, (bool )(p->fModifiers .fFlags & Modifiers::kOut_Flag ) });
1837
+ fParameters .push_back ({ slots, (bool )(p->modifiers () .fFlags & Modifiers::kOut_Flag ) });
1838
1838
fParameterCount += slots;
1839
1839
}
1840
1840
}
0 commit comments