Chromium Code Reviews| 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]) |