Diff
Modified: branches/safari-605-branch/Source/WebCore/ChangeLog (227539 => 227540)
--- branches/safari-605-branch/Source/WebCore/ChangeLog 2018-01-24 20:15:44 UTC (rev 227539)
+++ branches/safari-605-branch/Source/WebCore/ChangeLog 2018-01-24 20:15:47 UTC (rev 227540)
@@ -1,5 +1,32 @@
2018-01-24 Jason Marcell <[email protected]>
+ Cherry-pick r227524. rdar://problem/36830369
+
+ 2018-01-23 Dean Jackson <[email protected]>
+
+ 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.
+
+ 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:]):
+
+2018-01-24 Jason Marcell <[email protected]>
+
Cherry-pick r227479. rdar://problem/36830349
2018-01-23 Wenson Hsieh <[email protected]>
Modified: branches/safari-605-branch/Source/WebCore/PAL/ChangeLog (227539 => 227540)
--- branches/safari-605-branch/Source/WebCore/PAL/ChangeLog 2018-01-24 20:15:44 UTC (rev 227539)
+++ branches/safari-605-branch/Source/WebCore/PAL/ChangeLog 2018-01-24 20:15:47 UTC (rev 227540)
@@ -1,3 +1,20 @@
+2018-01-24 Jason Marcell <[email protected]>
+
+ Cherry-pick r227524. rdar://problem/36830369
+
+ 2018-01-23 Dean Jackson <[email protected]>
+
+ 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.
+
+ Expose an IOSurface colorspace property name, and a function to serialize a CGColorSpace.
+
+ * pal/spi/cg/CoreGraphicsSPI.h:
+ * pal/spi/cocoa/IOSurfaceSPI.h:
+
2018-01-17 Jason Marcell <[email protected]>
Cherry-pick r227103. rdar://problem/36598105
Modified: branches/safari-605-branch/Source/WebCore/PAL/pal/spi/cg/CoreGraphicsSPI.h (227539 => 227540)
--- branches/safari-605-branch/Source/WebCore/PAL/pal/spi/cg/CoreGraphicsSPI.h 2018-01-24 20:15:44 UTC (rev 227539)
+++ branches/safari-605-branch/Source/WebCore/PAL/pal/spi/cg/CoreGraphicsSPI.h 2018-01-24 20:15:47 UTC (rev 227540)
@@ -267,6 +267,7 @@
#if PLATFORM(COCOA)
CGColorSpaceRef CGContextCopyDeviceColorSpace(CGContextRef);
+CFPropertyListRef CGColorSpaceCopyPropertyList(CGColorSpaceRef);
CGError CGSNewRegionWithRect(const CGRect*, CGRegionRef*);
CGError CGSPackagesEnableConnectionOcclusionNotifications(CGSConnectionID, bool flag, bool* outCurrentVisibilityState);
CGError CGSPackagesEnableConnectionWindowModificationNotifications(CGSConnectionID, bool flag, bool* outConnectionIsCurrentlyIdle);
Modified: branches/safari-605-branch/Source/WebCore/PAL/pal/spi/cocoa/IOSurfaceSPI.h (227539 => 227540)
--- branches/safari-605-branch/Source/WebCore/PAL/pal/spi/cocoa/IOSurfaceSPI.h 2018-01-24 20:15:44 UTC (rev 227539)
+++ branches/safari-605-branch/Source/WebCore/PAL/pal/spi/cocoa/IOSurfaceSPI.h 2018-01-24 20:15:47 UTC (rev 227540)
@@ -54,6 +54,7 @@
extern const CFStringRef kIOSurfaceBytesPerElement;
extern const CFStringRef kIOSurfaceBytesPerRow;
extern const CFStringRef kIOSurfaceCacheMode;
+extern const CFStringRef kIOSurfaceColorSpace;
extern const CFStringRef kIOSurfaceHeight;
extern const CFStringRef kIOSurfacePixelFormat;
extern const CFStringRef kIOSurfaceWidth;
Modified: branches/safari-605-branch/Source/WebCore/platform/graphics/cocoa/WebGLLayer.mm (227539 => 227540)
--- branches/safari-605-branch/Source/WebCore/platform/graphics/cocoa/WebGLLayer.mm 2018-01-24 20:15:44 UTC (rev 227539)
+++ branches/safari-605-branch/Source/WebCore/platform/graphics/cocoa/WebGLLayer.mm 2018-01-24 20:15:47 UTC (rev 227540)
@@ -154,9 +154,15 @@
_contentsBuffer = WebCore::IOSurface::create(size, sRGBColorSpaceRef());
_drawingBuffer = WebCore::IOSurface::create(size, sRGBColorSpaceRef());
_spareBuffer = WebCore::IOSurface::create(size, sRGBColorSpaceRef());
+
ASSERT(_contentsBuffer);
ASSERT(_drawingBuffer);
ASSERT(_spareBuffer);
+
+ auto sRGBDetails = adoptCF(CGColorSpaceCopyPropertyList(sRGBColorSpaceRef()));
+ IOSurfaceSetValue(_contentsBuffer->surface(), kIOSurfaceColorSpace, sRGBDetails.get());
+ IOSurfaceSetValue(_drawingBuffer->surface(), kIOSurfaceColorSpace, sRGBDetails.get());
+ IOSurfaceSetValue(_spareBuffer->surface(), kIOSurfaceColorSpace, sRGBDetails.get());
}
- (void)bindFramebufferToNextAvailableSurface