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

Side by Side Diff: ui/gfx/color_profile_win.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: Cleanup bad merge 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
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 <windows.h>
8
9 #include "base/file_util.h"
10
11
sky 2012/07/18 14:36:18 remove newline.
tpayne 2012/07/18 17:41:52 Done.
12 namespace gfx {
13
14 void ReadColorProfile(std::vector<char>* profile) {
15 // TODO: support multiple monitors.
16 HDC screen_dc = GetDC(NULL);
17 DWORD path_len = MAX_PATH;
18 WCHAR path[MAX_PATH + 1];
sky 2012/07/18 14:36:18 MAX_PATH -> path_len
tpayne 2012/07/18 17:41:52 Done.
tpayne 2012/07/18 21:18:19 Undone. Doesn't compile.
19
20 BOOL res = GetICMProfile(screen_dc, &path_len, path);
21 ReleaseDC(NULL, screen_dc);
22 if (!res)
23 return;
24 std::string profileData;
25 if (!file_util::ReadFileToString(FilePath(path), &profileData))
26 return;
27 size_t length = profileData.size();
28 if (length > gfx::kMaxProfileLength)
29 return;
30 if (length < gfx::kMinProfileLength)
31 return;
32 profile->assign(profileData.data(), profileData.data() + length);
33 }
34
35 } // namespace gfx
36
OLDNEW
« ui/gfx/color_profile.cc ('K') | « ui/gfx/color_profile_mac.cc ('k') | ui/ui.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698