| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. |
| 3 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. | 3 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 #include "public/platform/Platform.h" | 36 #include "public/platform/Platform.h" |
| 37 #include "wtf/Assertions.h" | 37 #include "wtf/Assertions.h" |
| 38 #include "wtf/PassOwnPtr.h" | 38 #include "wtf/PassOwnPtr.h" |
| 39 #include "wtf/RefPtr.h" | 39 #include "wtf/RefPtr.h" |
| 40 #include "wtf/Threading.h" | 40 #include "wtf/Threading.h" |
| 41 #include "wtf/Vector.h" | 41 #include "wtf/Vector.h" |
| 42 #include "wtf/text/WTFString.h" | 42 #include "wtf/text/WTFString.h" |
| 43 | 43 |
| 44 #if USE(QCMSLIB) | 44 #if USE(QCMSLIB) |
| 45 #include "qcms.h" | 45 #include "qcms.h" |
| 46 #if OS(MACOSX) | |
| 47 #include <ApplicationServices/ApplicationServices.h> | |
| 48 #include "wtf/RetainPtr.h" | |
| 49 #endif | |
| 50 #endif | 46 #endif |
| 51 | 47 |
| 52 namespace blink { | 48 namespace blink { |
| 53 | 49 |
| 54 // ImagePlanes can be used to decode color components into provided buffers inst
ead of using an ImageFrame. | 50 // ImagePlanes can be used to decode color components into provided buffers inst
ead of using an ImageFrame. |
| 55 class PLATFORM_EXPORT ImagePlanes { | 51 class PLATFORM_EXPORT ImagePlanes { |
| 56 public: | 52 public: |
| 57 ImagePlanes(); | 53 ImagePlanes(); |
| 58 ImagePlanes(void* planes[3], size_t rowBytes[3]); | 54 ImagePlanes(void* planes[3], size_t rowBytes[3]); |
| 59 | 55 |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 | 190 |
| 195 return !memcmp(&profileData[12], "mntr", 4) || !memcmp(&profileData[12],
"scnr", 4); | 191 return !memcmp(&profileData[12], "mntr", 4) || !memcmp(&profileData[12],
"scnr", 4); |
| 196 } | 192 } |
| 197 | 193 |
| 198 class OutputDeviceProfile { | 194 class OutputDeviceProfile { |
| 199 public: | 195 public: |
| 200 OutputDeviceProfile() | 196 OutputDeviceProfile() |
| 201 : m_outputDeviceProfile(0) | 197 : m_outputDeviceProfile(0) |
| 202 { | 198 { |
| 203 // FIXME: Add optional ICCv4 support. | 199 // FIXME: Add optional ICCv4 support. |
| 204 #if OS(MACOSX) | |
| 205 RetainPtr<CGColorSpaceRef> monitorColorSpace(AdoptCF, CGDisplayCopyC
olorSpace(CGMainDisplayID())); | |
| 206 CFDataRef iccProfile(CGColorSpaceCopyICCProfile(monitorColorSpace.ge
t())); | |
| 207 if (iccProfile) { | |
| 208 size_t length = CFDataGetLength(iccProfile); | |
| 209 const unsigned char* systemProfile = CFDataGetBytePtr(iccProfile
); | |
| 210 m_outputDeviceProfile = qcms_profile_from_memory(systemProfile,
length); | |
| 211 CFRelease(iccProfile); | |
| 212 } | |
| 213 #else | |
| 214 // FIXME: add support for multiple monitors. | 200 // FIXME: add support for multiple monitors. |
| 215 ColorProfile profile; | 201 ColorProfile profile; |
| 216 screenColorProfile(profile); | 202 screenColorProfile(profile); |
| 217 if (!profile.isEmpty()) | 203 if (!profile.isEmpty()) |
| 218 m_outputDeviceProfile = qcms_profile_from_memory(profile.data(),
profile.size()); | 204 m_outputDeviceProfile = qcms_profile_from_memory(profile.data(),
profile.size()); |
| 219 #endif | |
| 220 if (m_outputDeviceProfile && qcms_profile_is_bogus(m_outputDevicePro
file)) { | 205 if (m_outputDeviceProfile && qcms_profile_is_bogus(m_outputDevicePro
file)) { |
| 221 qcms_profile_release(m_outputDeviceProfile); | 206 qcms_profile_release(m_outputDeviceProfile); |
| 222 m_outputDeviceProfile = 0; | 207 m_outputDeviceProfile = 0; |
| 223 } | 208 } |
| 224 if (!m_outputDeviceProfile) | 209 if (!m_outputDeviceProfile) |
| 225 m_outputDeviceProfile = qcms_profile_sRGB(); | 210 m_outputDeviceProfile = qcms_profile_sRGB(); |
| 226 if (m_outputDeviceProfile) | 211 if (m_outputDeviceProfile) |
| 227 qcms_profile_precache_output_transform(m_outputDeviceProfile); | 212 qcms_profile_precache_output_transform(m_outputDeviceProfile); |
| 228 } | 213 } |
| 229 | 214 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 | 310 |
| 326 IntSize m_size; | 311 IntSize m_size; |
| 327 bool m_sizeAvailable; | 312 bool m_sizeAvailable; |
| 328 bool m_isAllDataReceived; | 313 bool m_isAllDataReceived; |
| 329 bool m_failed; | 314 bool m_failed; |
| 330 }; | 315 }; |
| 331 | 316 |
| 332 } // namespace blink | 317 } // namespace blink |
| 333 | 318 |
| 334 #endif | 319 #endif |
| OLD | NEW |