| 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 ICCProfile ICCProfile::CreateSRGB() { |
| 108 ICCProfile result; |
| 109 ColorSpace::CreateSRGB().GetICCProfile(&result); |
| 110 return result; |
| 111 } |
| 112 |
| 107 #if !defined(OS_WIN) && !defined(OS_MACOSX) && !defined(USE_X11) | 113 #if !defined(OS_WIN) && !defined(OS_MACOSX) && !defined(USE_X11) |
| 108 // static | 114 // static |
| 109 ICCProfile ICCProfile::FromBestMonitor() { | 115 ICCProfile ICCProfile::FromBestMonitor() { |
| 110 if (HasForcedProfile()) | 116 if (HasForcedProfile()) |
| 111 return GetForcedProfile(); | 117 return GetForcedProfile(); |
| 112 return ICCProfile(); | 118 return ICCProfile(); |
| 113 } | 119 } |
| 114 #endif | 120 #endif |
| 115 | 121 |
| 116 // static | 122 // static |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 | 290 |
| 285 // Add to the cache. | 291 // Add to the cache. |
| 286 { | 292 { |
| 287 Cache& cache = g_cache.Get(); | 293 Cache& cache = g_cache.Get(); |
| 288 base::AutoLock lock(cache.lock); | 294 base::AutoLock lock(cache.lock); |
| 289 cache.id_to_icc_profile_mru.Put(id_, *this); | 295 cache.id_to_icc_profile_mru.Put(id_, *this); |
| 290 } | 296 } |
| 291 } | 297 } |
| 292 | 298 |
| 293 } // namespace gfx | 299 } // namespace gfx |
| OLD | NEW |