Title: [209019] trunk/Source/WebCore
Revision
209019
Author
timothy_hor...@apple.com
Date
2016-11-28 14:24:08 -0800 (Mon, 28 Nov 2016)

Log Message

Obvious change in saturation/color when swiping to a previously visited page
https://bugs.webkit.org/show_bug.cgi?id=165112
<rdar://problem/29257229>

Reviewed by Simon Fraser.

* platform/graphics/cocoa/IOSurface.mm:
(WebCore::IOSurface::createFromImage):
IOSurface::createFromImage should take into account the colorspace of the
originating image, instead of just hardcoding sRGB.

Otherwise, on a non-sRGB display, the display-space snapshot that we take
for back-forward swipe is converted to sRGB, then the colorspace information
is lost (without a way to maintain it inside the IOSurface), and displayed
as layer contents interpreted as display space (instead of sRGB).

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (209018 => 209019)


--- trunk/Source/WebCore/ChangeLog	2016-11-28 22:21:29 UTC (rev 209018)
+++ trunk/Source/WebCore/ChangeLog	2016-11-28 22:24:08 UTC (rev 209019)
@@ -1,3 +1,21 @@
+2016-11-28  Tim Horton  <timothy_hor...@apple.com>
+
+        Obvious change in saturation/color when swiping to a previously visited page
+        https://bugs.webkit.org/show_bug.cgi?id=165112
+        <rdar://problem/29257229>
+
+        Reviewed by Simon Fraser.
+
+        * platform/graphics/cocoa/IOSurface.mm:
+        (WebCore::IOSurface::createFromImage):
+        IOSurface::createFromImage should take into account the colorspace of the
+        originating image, instead of just hardcoding sRGB.
+
+        Otherwise, on a non-sRGB display, the display-space snapshot that we take
+        for back-forward swipe is converted to sRGB, then the colorspace information
+        is lost (without a way to maintain it inside the IOSurface), and displayed
+        as layer contents interpreted as display space (instead of sRGB).
+
 2016-11-28  Chris Dumez  <cdu...@apple.com>
 
         Unreviewed, fix crashes on Yosemite after r209009

Modified: trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.mm (209018 => 209019)


--- trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.mm	2016-11-28 22:21:29 UTC (rev 209018)
+++ trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.mm	2016-11-28 22:24:08 UTC (rev 209019)
@@ -91,7 +91,7 @@
     size_t width = CGImageGetWidth(image);
     size_t height = CGImageGetHeight(image);
 
-    auto surface = IOSurface::create(IntSize(width, height), sRGBColorSpaceRef());
+    auto surface = IOSurface::create(IntSize(width, height), CGImageGetColorSpace(image));
     if (!surface)
         return nullptr;
     auto surfaceContext = surface->ensurePlatformContext();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to