@@ -117,11 +117,11 @@ int ByteCodeGenerator::SlotCount(const Type& type) {
117117}
118118
119119static inline bool is_uniform (const SkSL::Variable& var) {
120- return var.fModifiers .fFlags & Modifiers::kUniform_Flag ;
120+ return var.modifiers () .fFlags & Modifiers::kUniform_Flag ;
121121}
122122
123123static inline bool is_in (const SkSL::Variable& var) {
124- return var.fModifiers .fFlags & Modifiers::kIn_Flag ;
124+ return var.modifiers () .fFlags & Modifiers::kIn_Flag ;
125125}
126126
127127void ByteCodeGenerator::gatherUniforms (const Type& type, const String& name) {
@@ -165,7 +165,7 @@ bool ByteCodeGenerator::generateCode() {
165165 if (declVar->type () == *fContext .fFragmentProcessor_Type ) {
166166 fOutput ->fChildFPCount ++;
167167 }
168- if (declVar->fModifiers .fLayout .fBuiltin >= 0 || is_in (*declVar)) {
168+ if (declVar->modifiers () .fLayout .fBuiltin >= 0 || is_in (*declVar)) {
169169 continue ;
170170 }
171171 if (is_uniform (*declVar)) {
@@ -218,8 +218,8 @@ std::unique_ptr<ByteCodeFunction> ByteCodeGenerator::writeFunction(const Functio
218218static int expression_as_builtin (const Expression& e) {
219219 if (e.is <VariableReference>()) {
220220 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 ;
223223 }
224224 }
225225 return -1 ;
@@ -423,7 +423,7 @@ int ByteCodeGenerator::StackUsage(ByteCodeInstruction inst, int count_) {
423423ByteCodeGenerator::Location ByteCodeGenerator::getLocation (const Variable& var) {
424424 // given that we seldom have more than a couple of variables, linear search is probably the most
425425 // efficient way to handle lookups
426- switch (var.fStorage ) {
426+ switch (var.storage () ) {
427427 case Variable::kLocal_Storage : {
428428 for (int i = fLocals .size () - 1 ; i >= 0 ; --i) {
429429 if (fLocals [i] == &var) {
@@ -486,7 +486,7 @@ ByteCodeGenerator::Location ByteCodeGenerator::getLocation(const Variable& var)
486486 if (e.is <GlobalVarDeclaration>()) {
487487 const GlobalVarDeclaration& decl = e.as <GlobalVarDeclaration>();
488488 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)) {
490490 continue ;
491491 }
492492 if (isUniform != is_uniform (*declVar)) {
@@ -1265,7 +1265,7 @@ void ByteCodeGenerator::writeFunctionCall(const FunctionCall& f) {
12651265 for (int i = 0 ; i < argCount; ++i) {
12661266 const auto & param = f.function ().fParameters [i];
12671267 const auto & arg = f.arguments ()[i];
1268- if (param->fModifiers .fFlags & Modifiers::kOut_Flag ) {
1268+ if (param->modifiers () .fFlags & Modifiers::kOut_Flag ) {
12691269 lvalues.emplace_back (this ->getLValue (*arg));
12701270 lvalues.back ()->load ();
12711271 } else {
@@ -1298,7 +1298,7 @@ void ByteCodeGenerator::writeFunctionCall(const FunctionCall& f) {
12981298 for (int i = argCount - 1 ; i >= 0 ; --i) {
12991299 const auto & param = f.function ().fParameters [i];
13001300 const auto & arg = f.arguments ()[i];
1301- if (param->fModifiers .fFlags & Modifiers::kOut_Flag ) {
1301+ if (param->modifiers () .fFlags & Modifiers::kOut_Flag ) {
13021302 pop ();
13031303 lvalues.back ()->store (true );
13041304 lvalues.pop_back ();
@@ -1834,7 +1834,7 @@ ByteCodeFunction::ByteCodeFunction(const FunctionDeclaration* declaration)
18341834 fParameterCount = 0 ;
18351835 for (const auto & p : declaration->fParameters ) {
18361836 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 ) });
18381838 fParameterCount += slots;
18391839 }
18401840}
0 commit comments