OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 /* | 5 /* |
6 * Copyright (C) 2010 Google Inc. All rights reserved. | 6 * Copyright (C) 2010 Google Inc. All rights reserved. |
7 * Copyright (C) 2012 Apple Inc. | 7 * Copyright (C) 2012 Apple Inc. |
8 * | 8 * |
9 * Redistribution and use in source and binary forms, with or without | 9 * Redistribution and use in source and binary forms, with or without |
10 * modification, are permitted provided that the following conditions are | 10 * modification, are permitted provided that the following conditions are |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 // we force the generic rgb color profile. This cases a change the user can | 169 // we force the generic rgb color profile. This cases a change the user can |
170 // see. | 170 // see. |
171 const CMDeviceScope scope = {kCFPreferencesCurrentUser, | 171 const CMDeviceScope scope = {kCFPreferencesCurrentUser, |
172 kCFPreferencesCurrentHost}; | 172 kCFPreferencesCurrentHost}; |
173 | 173 |
174 CMProfileRef profile = 0; | 174 CMProfileRef profile = 0; |
175 int error = | 175 int error = |
176 CMGetProfileByAVID((CMDisplayIDType)kCGDirectMainDisplay, &profile); | 176 CMGetProfileByAVID((CMDisplayIDType)kCGDirectMainDisplay, &profile); |
177 if (!error) { | 177 if (!error) { |
178 UInt32 size = sizeof(initial_color_profile_location); | 178 UInt32 size = sizeof(initial_color_profile_location); |
179 error = NCMGetProfileLocation(profile, &initial_color_profile_location, &siz
e); | 179 error = |
| 180 NCMGetProfileLocation(profile, &initial_color_profile_location, &size); |
180 CMCloseProfile(profile); | 181 CMCloseProfile(profile); |
181 } | 182 } |
182 if (error) { | 183 if (error) { |
183 NSLog(@"failed to get the current color profile, pixmaps won't match. " | 184 NSLog(@"failed to get the current color profile, pixmaps won't match. " |
184 "Error: %d", | 185 "Error: %d", |
185 (int)error); | 186 (int)error); |
186 initial_color_profile_location.locType = cmNoProfileBase; | 187 initial_color_profile_location.locType = cmNoProfileBase; |
187 return; | 188 return; |
188 } | 189 } |
189 | 190 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 | 255 |
255 // Wait for any key (or signal). | 256 // Wait for any key (or signal). |
256 getchar(); | 257 getchar(); |
257 | 258 |
258 // Restore the profile. | 259 // Restore the profile. |
259 RestoreUserColorProfile(); | 260 RestoreUserColorProfile(); |
260 | 261 |
261 [pool release]; | 262 [pool release]; |
262 return 0; | 263 return 0; |
263 } | 264 } |
OLD | NEW |