| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/gfx/color_space.h" | 5 #include "ui/gfx/color_space.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 // static | 52 // static |
| 53 bool ColorSpace::CachedProfilesNeedUpdate() { | 53 bool ColorSpace::CachedProfilesNeedUpdate() { |
| 54 base::AutoLock lock(g_best_monitor_color_space_lock.Get()); | 54 base::AutoLock lock(g_best_monitor_color_space_lock.Get()); |
| 55 return !g_has_initialized_best_monitor_color_space; | 55 return !g_has_initialized_best_monitor_color_space; |
| 56 } | 56 } |
| 57 | 57 |
| 58 // static | 58 // static |
| 59 void ColorSpace::UpdateCachedProfilesOnBackgroundThread() { | 59 void ColorSpace::UpdateCachedProfilesOnBackgroundThread() { |
| 60 std::vector<char> icc_profile; | 60 std::vector<char> icc_profile; |
| 61 ReadBestMonitorICCProfile(&icc_profile); | 61 ReadBestMonitorICCProfile(&icc_profile); |
| 62 gfx::ColorSpace color_space = FromICCProfile(icc_profile); | |
| 63 | 62 |
| 64 base::AutoLock lock(g_best_monitor_color_space_lock.Get()); | 63 base::AutoLock lock(g_best_monitor_color_space_lock.Get()); |
| 65 g_best_monitor_color_space.Get() = color_space; | 64 g_best_monitor_color_space.Get().icc_profile_ = icc_profile; |
| 66 g_has_initialized_best_monitor_color_space = true; | 65 g_has_initialized_best_monitor_color_space = true; |
| 67 } | 66 } |
| 68 | 67 |
| 69 } // namespace gfx | 68 } // namespace gfx |
| OLD | NEW |