Skip to content

Improve SamplingOptions, and adding test cases #240

@HinTak

Description

@HinTak

Cc @pavpanchekha

Pull #236 now includes the complete SamplingOptions code from pull #181, plus a little extra/update. The last of the emulation of the previous FilterQuality is:

  The last of SkFilterQuality emulation is:
  FilterQuality.kHigh_SkFilterQuality   -> SamplingOptions(CubicResampler.Mitchell())
  FilterQuality.kMedium_SkFilterQuality -> 
SamplingOptions(FilterMode.kLinear, MipmapMode.kNearest)    // cpu
                                           or SamplingOptions(FilterMode.kLinear, MipmapMode.kLinear)  // gpu
  FilterQuality.kLow_SkFilterQuality    -> SamplingOptions(FilterMode.kLinear, SkMipmapMode.kNone)
  FilterQuality.kNone_SkFilterQuality   -> SamplingOptions(SkFilterMode.kNearest, SkMipmapMode.kNone)

So it turns out that the 4 filterquality settings is equivalent to 5 of the 2×3x2 =12 SamplingOptions combo (one extra, because one of them depending on whether it is rendering through CPU or GPU), and we might as well add the whole thing.

Please test the build artefact when it finishes building.

Still missing are some test code, and possibly docstring documentation too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions