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

Side by Side Diff: ui/gfx/color_space_mac.mm

Issue 2106303002: Color: Rename gfx::ColorProfile to gfx::ColorSpace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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/color_space.cc ('k') | ui/gfx/color_space_win.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/color_profile.h" 5 #include "ui/gfx/color_space.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include "base/mac/mac_util.h" 10 #include "base/mac/mac_util.h"
11 #include "base/mac/scoped_cftyperef.h" 11 #include "base/mac/scoped_cftyperef.h"
12 #include "ui/gfx/mac/coordinate_conversion.h" 12 #include "ui/gfx/mac/coordinate_conversion.h"
13 13
14 namespace gfx { 14 namespace gfx {
15 15
16 // static 16 // static
17 ColorProfile ColorProfile::GetFromBestMonitor() { 17 ColorSpace ColorSpace::FromBestMonitor() {
18 ColorProfile profile; 18 ColorSpace color_space;
19 CGColorSpaceRef monitor_color_space(base::mac::GetSystemColorSpace()); 19 CGColorSpaceRef monitor_color_space(base::mac::GetSystemColorSpace());
20 base::ScopedCFTypeRef<CFDataRef> icc_profile( 20 base::ScopedCFTypeRef<CFDataRef> icc_profile(
21 CGColorSpaceCopyICCProfile(monitor_color_space)); 21 CGColorSpaceCopyICCProfile(monitor_color_space));
22 if (!icc_profile) 22 if (!icc_profile)
23 return profile; 23 return color_space;
24 size_t length = CFDataGetLength(icc_profile); 24 size_t length = CFDataGetLength(icc_profile);
25 if (!IsValidProfileLength(length)) 25 if (!IsValidProfileLength(length))
26 return profile; 26 return color_space;
27 const unsigned char* data = CFDataGetBytePtr(icc_profile); 27 const unsigned char* data = CFDataGetBytePtr(icc_profile);
28 profile.profile_.assign(data, data + length); 28 color_space.icc_profile_.assign(data, data + length);
29 return profile; 29 return color_space;
30 } 30 }
31 31
32 } // namespace gfx 32 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/color_space.cc ('k') | ui/gfx/color_space_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698