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

Unified 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 reading length from small string Created 8 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 side-by-side diff with in-line comments
Download patch
Index: ui/gfx/color_profile_mac.cc
diff --git a/ui/gfx/color_profile_mac.cc b/ui/gfx/color_profile_mac.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b91402fb6437ece5f74ebcbe51a98c5f27f84518
--- /dev/null
+++ b/ui/gfx/color_profile_mac.cc
@@ -0,0 +1,23 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/gfx/color_profile.h"
+
+#include "base/mac/mac_util.h"
+
+namespace gfx {
+
+void ColorProfile::ReadProfile(gfx::NativeViewId parent_window,
+ std::vector<char>* profile) {
+ CGColorSpaceRef monitor_color_space(base::mac::GetSystemColorSpace());
+ CFDataRef icc_profile(CGColorSpaceCopyICCProfile(monitor_color_space));
+ if (icc_profile) {
+ size_t length = CFDataGetLength(icc_profile);
Noel Gordon 2012/06/21 16:58:33 In the windows implementation you check lengths, v
tpayne 2012/07/02 19:22:32 Done.
+ const unsigned char* sys_profile = CFDataGetBytePtr(icc_profile);
+ profile->assign(sys_profile, sys_profile + length);
+ }
+}
+
+} // namespace gfx
+

Powered by Google App Engine
This is Rietveld 408576698