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
3 // found in the LICENSE file.
5 #include "ui/gfx/color_profile.h"
7 #include "base/mac/mac_util.h"
11 bool GetDisplayColorProfile(const gfx::Rect& bounds,
12 std::vector<char>* profile) {
15 // TODO(noel): implement.
19 void ReadColorProfile(std::vector<char>* profile) {
20 CGColorSpaceRef monitor_color_space(base::mac::GetSystemColorSpace());
21 base::ScopedCFTypeRef<CFDataRef> icc_profile(
22 CGColorSpaceCopyICCProfile(monitor_color_space));
25 size_t length = CFDataGetLength(icc_profile);
26 if (gfx::InvalidColorProfileLength(length))
28 const unsigned char* data = CFDataGetBytePtr(icc_profile);
29 profile->assign(data, data + length);