Skip to content

Streamline calls to Image#adaptImageDataIfDisabledOrGray() #496

@HeikoKlare

Description

@HeikoKlare

At different places inside the Image class, adaptImageDataIfDisabledOrGray() is called to apply the image's styling to loaded or scaled image data. Currently, there is no consistent pattern when this is applied and at some places it is even applied twice on the same image data.
There seem to be two places where the method is applied:

  • Whenever a handle is created, in particular ininitializeHandleFromSource()
  • Indirectly in some loadImageData() methods:
    • In PlainImageProviderWrapper and ExistingImageHandlerProviderWrapper via getClosedAvailableImageData()
    • In ImageGCDrawerWrapper via getImageMetadata()

This should be streamlined such that this adaptation is done consistently, i.e., at reasonable, conceptually equal places for all provider wrapper and only once per image data.
In my opinion, it should only happen on handle creation and not when just loading image data, if possible.

This finding was originally reported by @arunjose696: eclipse-platform/eclipse.platform.swt#2634 (comment)

Metadata

Metadata

Labels

HiDPIA HiDPI-Related Issue or FeatureSWTIssue for SWT

Type

No type

Projects

Status

🏗 In Work: Short

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions