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/containers/mru_cache.h" | 9 #include "base/containers/mru_cache.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 return icc_profile; | 69 return icc_profile; |
70 } | 70 } |
71 } | 71 } |
72 | 72 |
73 // Create a new cached id and add it to the cache. | 73 // Create a new cached id and add it to the cache. |
74 icc_profile.id_ = cache.next_unused_id++; | 74 icc_profile.id_ = cache.next_unused_id++; |
75 cache.id_to_icc_profile_mru.Put(icc_profile.id_, icc_profile); | 75 cache.id_to_icc_profile_mru.Put(icc_profile.id_, icc_profile); |
76 return icc_profile; | 76 return icc_profile; |
77 } | 77 } |
78 | 78 |
79 #if !defined(OS_WIN) && !defined(OS_MACOSX) | 79 #if !defined(OS_WIN) && !defined(OS_MACOSX) && !defined(USE_X11) |
80 // static | 80 // static |
81 ICCProfile ICCProfile::FromBestMonitor() { | 81 ICCProfile ICCProfile::FromBestMonitor() { |
82 return ICCProfile(); | 82 return ICCProfile(); |
83 } | 83 } |
84 #endif | 84 #endif |
85 | 85 |
86 // static | 86 // static |
87 ICCProfile ICCProfile::FromColorSpace(const gfx::ColorSpace& color_space) { | 87 ICCProfile ICCProfile::FromColorSpace(const gfx::ColorSpace& color_space) { |
88 // Retrieve ICC profiles from the cache. | 88 // Retrieve ICC profiles from the cache. |
89 if (color_space.icc_profile_id_) { | 89 if (color_space.icc_profile_id_) { |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 | 165 |
166 return color_space; | 166 return color_space; |
167 } | 167 } |
168 | 168 |
169 // static | 169 // static |
170 bool ICCProfile::IsValidProfileLength(size_t length) { | 170 bool ICCProfile::IsValidProfileLength(size_t length) { |
171 return length >= kMinProfileLength && length <= kMaxProfileLength; | 171 return length >= kMinProfileLength && length <= kMaxProfileLength; |
172 } | 172 } |
173 | 173 |
174 } // namespace gfx | 174 } // namespace gfx |
OLD | NEW |