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

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

Issue 10448110: Adds monitor ICC profile support for win and mac (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix android build Created 8 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_profile.cc ('k') | ui/gfx/color_profile_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
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ui/gfx/color_profile.h"
6
7 #include "base/mac/mac_util.h"
8
9 namespace gfx {
10
11 void ReadColorProfile(std::vector<char>* profile) {
12 CGColorSpaceRef monitor_color_space(base::mac::GetSystemColorSpace());
13 CFDataRef icc_profile(CGColorSpaceCopyICCProfile(monitor_color_space));
Nico 2013/03/04 14:10:53 This is leaked, right? (Fix at https://codereview.
14 if (icc_profile) {
15 size_t length = CFDataGetLength(icc_profile);
16 if (length > gfx::kMaxProfileLength)
17 return;
18 if (length < gfx::kMinProfileLength)
19 return;
20 const unsigned char* sys_profile = CFDataGetBytePtr(icc_profile);
21 profile->assign(sys_profile, sys_profile + length);
22 }
23 }
24
25 } // namespace gfx
26
OLDNEW
« no previous file with comments | « ui/gfx/color_profile.cc ('k') | ui/gfx/color_profile_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698