Use a hardcoded patch for sRGB color profile
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Sep 2016 22:36:02 +0000 (22:36 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Sep 2016 22:36:02 +0000 (22:36 +0000)
https://bugs.webkit.org/show_bug.cgi?id=162320
rdar://problem/28387318

Reviewed by Simon Fraser.

This is a workaround for rdar://problem/28392768

* DumpRenderTree/mac/LayoutTestHelper.m:
(installLayoutTestColorProfile):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@206182 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/DumpRenderTree/mac/LayoutTestHelper.m

index adec11f..8c07e98 100644 (file)
@@ -1,3 +1,16 @@
+2016-09-20  Alexey Proskuryakov  <ap@apple.com>
+
+        Use a hardcoded patch for sRGB color profile
+        https://bugs.webkit.org/show_bug.cgi?id=162320
+        rdar://problem/28387318
+
+        Reviewed by Simon Fraser.
+
+        This is a workaround for rdar://problem/28392768
+
+        * DumpRenderTree/mac/LayoutTestHelper.m:
+        (installLayoutTestColorProfile):
+
 2016-09-20  Ryan Haddad  <ryanhaddad@apple.com>
 
         Unreviewed, rolling out r206178.
index 5d810a8..958380e 100644 (file)
@@ -172,16 +172,11 @@ static void installLayoutTestColorProfile()
     NSArray *displays = displayUUIDStrings();
     saveDisplayColorProfiles(displays);
 
-    ColorSyncProfileRef sRGBProfile = ColorSyncProfileCreateWithName(kColorSyncSRGBProfile);
-    CFErrorRef error;
-    CFURLRef profileURL = ColorSyncProfileGetURL(sRGBProfile, &error);
-    if (!profileURL) {
-        NSLog(@"Failed to get URL of Generic RGB color profile! Many pixel tests may fail as a result. Error: %@", error);
-        return;
-    }
+    // Profile path needs to be hardcoded because of <rdar://problem/28392768>.
+    NSURL *sRGBProfileURL = [NSURL fileURLWithPath:@"/System/Library/ColorSync/Profiles/sRGB Profile.icc"];
     
     for (NSString *displayUUIDString in displays)
-        setDisplayColorProfile(displayUUIDString, (NSURL *)profileURL);
+        setDisplayColorProfile(displayUUIDString, sRGBProfileURL);
 }
 
 static void restoreUserColorProfile(void)