| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/icc_profile.h" | 5 #include "ui/gfx/icc_profile.h" |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/containers/mru_cache.h" | 10 #include "base/containers/mru_cache.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 | 97 |
| 98 // Create a new cached id and add it to the cache. | 98 // Create a new cached id and add it to the cache. |
| 99 ICCProfile icc_profile; | 99 ICCProfile icc_profile; |
| 100 icc_profile.id_ = new_profile_id; | 100 icc_profile.id_ = new_profile_id; |
| 101 icc_profile.data_.insert(icc_profile.data_.begin(), data_as_char, | 101 icc_profile.data_.insert(icc_profile.data_.begin(), data_as_char, |
| 102 data_as_char + size); | 102 data_as_char + size); |
| 103 icc_profile.ComputeColorSpaceAndCache(); | 103 icc_profile.ComputeColorSpaceAndCache(); |
| 104 return icc_profile; | 104 return icc_profile; |
| 105 } | 105 } |
| 106 | 106 |
| 107 #if !defined(OS_WIN) && !defined(OS_MACOSX) && !defined(USE_X11) | 107 #if (!defined(OS_WIN) && !defined(USE_X11) && !defined(OS_MACOSX)) || \ |
| 108 defined(OS_IOS) |
| 108 // static | 109 // static |
| 109 ICCProfile ICCProfile::FromBestMonitor() { | 110 ICCProfile ICCProfile::FromBestMonitor() { |
| 110 if (HasForcedProfile()) | 111 if (HasForcedProfile()) |
| 111 return GetForcedProfile(); | 112 return GetForcedProfile(); |
| 112 return ICCProfile(); | 113 return ICCProfile(); |
| 113 } | 114 } |
| 114 #endif | 115 #endif |
| 115 | 116 |
| 116 // static | 117 // static |
| 117 bool ICCProfile::HasForcedProfile() { | 118 bool ICCProfile::HasForcedProfile() { |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 | 285 |
| 285 // Add to the cache. | 286 // Add to the cache. |
| 286 { | 287 { |
| 287 Cache& cache = g_cache.Get(); | 288 Cache& cache = g_cache.Get(); |
| 288 base::AutoLock lock(cache.lock); | 289 base::AutoLock lock(cache.lock); |
| 289 cache.id_to_icc_profile_mru.Put(id_, *this); | 290 cache.id_to_icc_profile_mru.Put(id_, *this); |
| 290 } | 291 } |
| 291 } | 292 } |
| 292 | 293 |
| 293 } // namespace gfx | 294 } // namespace gfx |
| OLD | NEW |