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

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

Issue 2950183002: color: Use ICCProfile from display::Display instead of FromBestMonitor (Closed)
Patch Set: Use forced color profile in display::Display ctor Created 3 years, 6 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/icc_profile.h ('k') | ui/views/widget/desktop_aura/desktop_screen_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/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
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
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
OLDNEW
« no previous file with comments | « ui/gfx/icc_profile.h ('k') | ui/views/widget/desktop_aura/desktop_screen_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698