Closed Bug 1618345 Opened 1 year ago Closed 1 year ago

Ensure all colors passed into drawing APIs honour color management configuration


(Core :: GFX: Color Management, defect, P2)




Tracking Status
firefox76 --- fixed


(Reporter: aosmond, Assigned: aosmond)


(Blocks 2 open bugs)



(1 file)

Today there are many paths to drawing pixels with particular colors. We don't enforce that these are color managed via ToDeviceColor, and as such, not all of them are. We need to ensure we are consistent. This is likely a long arduous task but we can't turn on color management everywhere unless we do that first, because otherwise one may see things side by side that should be the same color and are actually different.

Blocks: 455077

gfx::Color is currently misused in many places. The DrawTargets expect
the color space to be in device space, e.g. what we are actually going
to draw using. Everything sitting above generally deals with sRGB, as
specified in CSS. Sometimes we missed the conversion from sRGB to device
space when issuing draw calls, and similarly sometimes we converted the
color to device space twice.

This patch splits the type in two. sRGBColor and DeviceColor now
represent sRGB and device color spaces respectively. DrawTarget only
accepts DeviceColor, and one can get a DeviceColor from an sRGBColor via
the ToDeviceColor helper API. The reftests now pass with color
management enabled for everything (e.g. CSS) instead of just tagged
raster images.

There will be a follow up patch to enable color management everywhere by
default on all supported platforms.

Blocks: 1602453
Pushed by
Enforce proper color management by splitting gfx::Color into sRGBColor and DeviceColor types. r=jrmuizel
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla76
You need to log in before you can comment on or make changes to this bug.