Skip to content

[Flutter GPU] Compile implementation only when Impeller rendering is available #187424

Description

@bdero

Use case

Flutter GPU can be compiled into some toolchains when impeller_supports_rendering is false, even though creating a usable GpuContext already requires Impeller at runtime. This makes implementation code carry redundant !IMPELLER_SUPPORTS_RENDERING paths and can obscure which native symbols and files are expected to exist in non-rendering builds.

This came up while adding GpuSurface, where the surface implementation depends on DlImageImpeller and only makes sense when Impeller rendering support is compiled in.

Proposal

Split the Flutter GPU native build so non-rendering configurations compile only the minimal code needed to report the existing clean GpuContext initialization error, while the full Flutter GPU implementation is compiled only when impeller_supports_rendering is true.

As part of this cleanup, remove redundant non-rendering runtime branches from implementation files and verify that Dart @Native imports and symbol resolution still behave correctly in configurations where Flutter GPU is unavailable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: tech-debtTechnical debt, code quality, testing, etc.e: impellerImpeller rendering backend issues and features requestsengineflutter/engine related. See also e: labels.flutter-gputeam-fluttergpuOwned by Flutter GPU team

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    🔧 Internals

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions