Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1178)

Unified Diff: content/test/gpu/gpu_tests/color_profile_manager.py

Issue 2944733002: Force sRGB color profile on Mac for pixel tests (Closed)
Patch Set: Include maps, dont enable color correction Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/test/gpu/gpu_tests/color_profile_manager.py
diff --git a/content/test/gpu/gpu_tests/color_profile_manager.py b/content/test/gpu/gpu_tests/color_profile_manager.py
new file mode 100644
index 0000000000000000000000000000000000000000..e90becdc81ae4fbb0ee4f0792acd5d64f6f4ead6
--- /dev/null
+++ b/content/test/gpu/gpu_tests/color_profile_manager.py
@@ -0,0 +1,26 @@
+# Copyright 2017 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import sys
+
+if sys.platform.startswith('darwin'):
+ from gpu_tests import color_profile_manager_mac
+
+class ColorProfileManager(object):
+ _display_profile_url_map = {}
Ken Russell (switch to Gerrit) 2017/06/20 22:55:02 This is a class-scoped variable as written. To mak
ccameron 2017/06/21 06:45:42 Thanks. Ended up deleting this from the atexit par
+
+ def __init__(self):
+ if sys.platform.startswith('darwin'):
+ self._display_profile_url_map = \
+ color_profile_manager_mac.GetDisplaysToProfileURLMap()
+
+ def ForceSRGB(self):
Ken Russell (switch to Gerrit) 2017/06/20 22:55:02 Do you think it's worth registering an atexit hand
ccameron 2017/06/21 06:45:42 Good idea -- I updated this to register an atexit
+ for display_id in self._display_profile_url_map:
+ color_profile_manager_mac.SetDisplayCustomProfile(
+ display_id, color_profile_manager_mac.GetSRGBProfileURL())
+
+ def Restore(self):
+ for display_id in self._display_profile_url_map:
+ color_profile_manager_mac.SetDisplayCustomProfile(
+ display_id, self._display_profile_url_map[display_id])

Powered by Google App Engine
This is Rietveld 408576698