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

Side by Side Diff: Source/platform/image-decoders/ImageDecoder.h

Issue 554033002: [Mac] Add a new WebSandboxSupport method to get the display's color space. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 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
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 24 matching lines...) Expand all
35 #include "platform/image-decoders/ImageFrame.h" 35 #include "platform/image-decoders/ImageFrame.h"
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/RefPtr.h" 38 #include "wtf/RefPtr.h"
39 #include "wtf/Vector.h" 39 #include "wtf/Vector.h"
40 #include "wtf/text/WTFString.h" 40 #include "wtf/text/WTFString.h"
41 41
42 #if USE(QCMSLIB) 42 #if USE(QCMSLIB)
43 #include "qcms.h" 43 #include "qcms.h"
44 #if OS(MACOSX) 44 #if OS(MACOSX)
45 #include "public/platform/mac/WebSandboxSupport.h"
46 #include "wtf/RetainPtr.h"
45 #include <ApplicationServices/ApplicationServices.h> 47 #include <ApplicationServices/ApplicationServices.h>
46 #include "wtf/RetainPtr.h"
47 #endif 48 #endif
48 #endif 49 #endif
49 50
50 namespace blink { 51 namespace blink {
51 52
52 // ImagePlanes can be used to decode color components into provided buffers inst ead of using an ImageFrame. 53 // ImagePlanes can be used to decode color components into provided buffers inst ead of using an ImageFrame.
53 class PLATFORM_EXPORT ImagePlanes { 54 class PLATFORM_EXPORT ImagePlanes {
54 public: 55 public:
55 ImagePlanes(); 56 ImagePlanes();
56 ImagePlanes(void* planes[3], size_t rowBytes[3]); 57 ImagePlanes(void* planes[3], size_t rowBytes[3]);
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 return !memcmp(&profileData[12], "mntr", 4) || !memcmp(&profileData[12], "scnr", 4); 194 return !memcmp(&profileData[12], "mntr", 4) || !memcmp(&profileData[12], "scnr", 4);
194 } 195 }
195 196
196 class OutputDeviceProfile { 197 class OutputDeviceProfile {
197 public: 198 public:
198 OutputDeviceProfile() 199 OutputDeviceProfile()
199 : m_outputDeviceProfile(0) 200 : m_outputDeviceProfile(0)
200 { 201 {
201 // FIXME: Add optional ICCv4 support. 202 // FIXME: Add optional ICCv4 support.
202 #if OS(MACOSX) 203 #if OS(MACOSX)
203 RetainPtr<CGColorSpaceRef> monitorColorSpace(AdoptCF, CGDisplayCopyC olorSpace(CGMainDisplayID())); 204 CGColorSpaceRef monitorColorSpace = Platform::current()->sandboxSupp ort()->displayColorSpace();
204 CFDataRef iccProfile(CGColorSpaceCopyICCProfile(monitorColorSpace.ge t())); 205 CFDataRef iccProfile(CGColorSpaceCopyICCProfile(monitorColorSpace));
205 if (iccProfile) { 206 if (iccProfile) {
206 size_t length = CFDataGetLength(iccProfile); 207 size_t length = CFDataGetLength(iccProfile);
207 const unsigned char* systemProfile = CFDataGetBytePtr(iccProfile ); 208 const unsigned char* systemProfile = CFDataGetBytePtr(iccProfile );
208 m_outputDeviceProfile = qcms_profile_from_memory(systemProfile, length); 209 m_outputDeviceProfile = qcms_profile_from_memory(systemProfile, length);
209 CFRelease(iccProfile); 210 CFRelease(iccProfile);
210 } 211 }
211 #else 212 #else
212 // FIXME: add support for multiple monitors. 213 // FIXME: add support for multiple monitors.
213 ColorProfile profile; 214 ColorProfile profile;
214 screenColorProfile(profile); 215 screenColorProfile(profile);
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 324
324 IntSize m_size; 325 IntSize m_size;
325 bool m_sizeAvailable; 326 bool m_sizeAvailable;
326 bool m_isAllDataReceived; 327 bool m_isAllDataReceived;
327 bool m_failed; 328 bool m_failed;
328 }; 329 };
329 330
330 } // namespace blink 331 } // namespace blink
331 332
332 #endif 333 #endif
OLDNEW
« no previous file with comments | « no previous file | public/platform/mac/WebSandboxSupport.h » ('j') | public/platform/mac/WebSandboxSupport.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698