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_profile.h" | 5 #include "ui/gfx/color_profile.h" |
6 | 6 |
7 namespace gfx { | 7 namespace gfx { |
8 | 8 |
9 #if defined(OS_WIN) || defined(OS_MAC) | 9 #if defined(OS_WIN) || defined(OS_MACOSX) |
10 void ReadColorProfile(std::vector<char>* profile); | 10 void ReadColorProfile(std::vector<char>* profile); |
11 #else | 11 #else |
12 void ReadColorProfile(std::vector<char>* profile) { } | 12 void ReadColorProfile(std::vector<char>* profile) { } |
13 #endif | 13 #endif |
14 | 14 |
15 void GetColorProfile(std::vector<char>* profile) { | 15 void GetColorProfile(std::vector<char>* profile) { |
16 // Called from the FILE thread on Windows and IO thread elsewhere. | 16 // Called from the FILE thread on Windows and IO thread elsewhere. |
17 | 17 |
18 // TODO: support multiple monitors. | 18 // TODO: support multiple monitors. |
19 CR_DEFINE_STATIC_LOCAL(std::vector<char>, screen_profile, ()); | 19 CR_DEFINE_STATIC_LOCAL(std::vector<char>, screen_profile, ()); |
20 static bool initialized = false; | 20 static bool initialized = false; |
21 | 21 |
22 profile->clear(); | 22 profile->clear(); |
23 if (!initialized) { | 23 if (!initialized) { |
24 initialized = true; | 24 initialized = true; |
25 ReadColorProfile(&screen_profile); | 25 ReadColorProfile(&screen_profile); |
26 } | 26 } |
27 | 27 |
28 profile->assign(screen_profile.begin(), screen_profile.end()); | 28 profile->assign(screen_profile.begin(), screen_profile.end()); |
29 } | 29 } |
30 | 30 |
31 } // namespace gfx | 31 } // namespace gfx |
OLD | NEW |