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

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

Issue 16917011: mac: Replace base::mac::ScopedCFTypeRef with base::ScopedCFTypeRef. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: with fixed off-by-1 in git-clang-format Created 7 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 | Annotate | Revision Log
« no previous file with comments | « ui/gfx/blit.cc ('k') | ui/gfx/image/image_ios.mm » ('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 (c) 2012 The Chromium Authors. All rights reserved. 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 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_profile.h"
6 6
7 #include "base/mac/mac_util.h" 7 #include "base/mac/mac_util.h"
8 8
9 namespace gfx { 9 namespace gfx {
10 10
11 void ReadColorProfile(std::vector<char>* profile) { 11 void ReadColorProfile(std::vector<char>* profile) {
12 CGColorSpaceRef monitor_color_space(base::mac::GetSystemColorSpace()); 12 CGColorSpaceRef monitor_color_space(base::mac::GetSystemColorSpace());
13 base::mac::ScopedCFTypeRef<CFDataRef> icc_profile( 13 base::ScopedCFTypeRef<CFDataRef> icc_profile(
14 CGColorSpaceCopyICCProfile(monitor_color_space)); 14 CGColorSpaceCopyICCProfile(monitor_color_space));
15 if (icc_profile) { 15 if (icc_profile) {
16 size_t length = CFDataGetLength(icc_profile); 16 size_t length = CFDataGetLength(icc_profile);
17 if (length > gfx::kMaxProfileLength) 17 if (length > gfx::kMaxProfileLength)
18 return; 18 return;
19 if (length < gfx::kMinProfileLength) 19 if (length < gfx::kMinProfileLength)
20 return; 20 return;
21 const unsigned char* sys_profile = CFDataGetBytePtr(icc_profile); 21 const unsigned char* sys_profile = CFDataGetBytePtr(icc_profile);
22 profile->assign(sys_profile, sys_profile + length); 22 profile->assign(sys_profile, sys_profile + length);
23 } 23 }
24 } 24 }
25 25
26 } // namespace gfx 26 } // namespace gfx
27 27
OLDNEW
« no previous file with comments | « ui/gfx/blit.cc ('k') | ui/gfx/image/image_ios.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698