REGRESSION (r222961?): sRGB images shown in WebGL are over-saturated on a wide gamut...
authordino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Jan 2018 17:14:56 +0000 (17:14 +0000)
committerdino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Jan 2018 17:14:56 +0000 (17:14 +0000)
commit7d1654b4739d827bdcc80fd0661c1b05f8edc168
tree58a359306cf3a17058e8f22e9f8472e8f954790d
parente3656e03d3bc9b966e352652aea9dee58640431d
REGRESSION (r222961?): sRGB images shown in WebGL are over-saturated on a wide gamut monitor
https://bugs.webkit.org/show_bug.cgi?id=182033
<rdar://problem/36377780>

Reviewed by Antoine Quint.

Source/WebCore:

My fix for YouTube360 changed the way we composite WebGL on macOS. Unfortunately it dropped
a flag telling the compositor the colorspace of the content should be sRGB. Reinstate this
by explicitly setting the colorspace on the IOSurface we use for WebGL back buffers.

This *should* be covered by the test in:
fast/canvas/webgl/match-page-color-space.html
... however, it shows a problem with our testing infrastructure. As long as it is not
testing on a Wide Gamut display, and explicitly setting the color profile, an automated
test won't pick up this regression. I could add an Internals helper to query the colorspace
of the WebGL content, but that doesn't actually verify the composited result, which is
all that matters.

* platform/graphics/cocoa/WebGLLayer.mm:
(-[WebGLLayer allocateIOSurfaceBackingStoreWithSize:usingAlpha:]):

Source/WebCore/PAL:

Expose an IOSurface colorspace property name, and a function to serialize a CGColorSpace.

* pal/spi/cg/CoreGraphicsSPI.h:
* pal/spi/cocoa/IOSurfaceSPI.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227524 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/PAL/ChangeLog
Source/WebCore/PAL/pal/spi/cg/CoreGraphicsSPI.h
Source/WebCore/PAL/pal/spi/cocoa/IOSurfaceSPI.h
Source/WebCore/platform/graphics/cocoa/WebGLLayer.mm