mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
- This used to incorrectly generate reflection state whenever the last shader_target_flags is not "--sksl".
- Instead, generate reflection state when any non-runtime target is in shader_target_flags.
- Consolidate some of the if/else logic to reduce duplicate code.
Remove the TargetPlatformNeedsReflection check in impeller_main.cc.
- Instead, whether reflection state is generated depends only on the presence or absense of "reflection_{json|header|cc}_name" flags.
- The logic of whether to include these flags is already in compiler.gni. So it's redundant to also have logic for whether to generate the reflection state here.
- The TargetPlatformNeedsReflection method had faulty logic.
- It returned true for everything except SkSL, even though reflection state isn't needed for runtime targets.
- It was called on the target from Switches::SelectDefaultTargetPlatform. When impellerc is used with multiple runtime targets, this would return the runtime target that is first alphabetically by flag name. So if --sksl is provided along with any other --runtime-stage-* target, SelectDefaultTargetPlatform returns the non-sksl runtime target. Effectively this meant that TargetPlatformNeedsReflection returns true except for when --sksl is the only provided runtime target.
- Removes the TargetPlatformNeedsReflection function entirely.