Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Side by Side Diff: ui/gfx/icc_profile.cc

Issue 2115103002: Support for retreiving the monitor color space on X11. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merged Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/gfx/BUILD.gn ('k') | ui/gfx/icc_profile_x11.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/gfx/BUILD.gn ('k') | ui/gfx/icc_profile_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698