Skip to content

Replace the DlImageSampling enum with finer grained DlSamplingOptions struct #115794

@bdero

Description

@bdero

We should have a struct more like SkSamplingOptions to handle the combinatorial explosion of possible sampling configurations, all of which both Impeller and Skia are able to support just fine (except for cubic resampling in Impeller).

As part of FragmentProgram, we allow users to create arbitrary samplers -- translating to this enum would back us into a corner for supporting the full gamut of sampling configurations in the future.

The data in the SkSamplingOptions is:

    const int              maxAniso = 0;
    const bool             useCubic = false;
    const SkCubicResampler cubic    = {0, 0};
    const SkFilterMode     filter   = SkFilterMode::kNearest;
    const SkMipmapMode     mipmap   = SkMipmapMode::kNone;

The presets made available by DlSamplingOptions are:

enum class DlImageSampling {
  kNearestNeighbor,
  kLinear,
  kMipmapLinear,
  kCubic,
};

(This enum landed as part of flutter/engine#34024)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: proposalA detailed proposal for a change to Flutterengineflutter/engine related. See also e: labels.team-engineOwned by Engine teamtriaged-engineTriaged by Engine team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions