Commit bd8429d0 authored by rsesek@chromium.org's avatar rsesek@chromium.org

Remove the Mac-specific path for getting the color space in ImageDecoder.

This path required a connection to the WindowServer, which should be avoided
(see the two bugs for details). Instead this data can be retrieved via the
ColorProfile class, which can access a value that has been cached during
pre-sandbox warmup.

BUG=397642,306348
R=noel@chromium.org

Review URL: https://codereview.chromium.org/554033002

git-svn-id: svn://svn.chromium.org/blink/trunk@181761 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent aec8ba26
......@@ -41,10 +41,6 @@
#if USE(QCMSLIB)
#include "qcms.h"
#if OS(MACOSX)
#include <ApplicationServices/ApplicationServices.h>
#include "wtf/RetainPtr.h"
#endif
#endif
namespace blink {
......@@ -201,22 +197,11 @@ public:
: m_outputDeviceProfile(0)
{
// FIXME: Add optional ICCv4 support.
#if OS(MACOSX)
RetainPtr<CGColorSpaceRef> monitorColorSpace(AdoptCF, CGDisplayCopyColorSpace(CGMainDisplayID()));
CFDataRef iccProfile(CGColorSpaceCopyICCProfile(monitorColorSpace.get()));
if (iccProfile) {
size_t length = CFDataGetLength(iccProfile);
const unsigned char* systemProfile = CFDataGetBytePtr(iccProfile);
m_outputDeviceProfile = qcms_profile_from_memory(systemProfile, length);
CFRelease(iccProfile);
}
#else
// FIXME: add support for multiple monitors.
ColorProfile profile;
screenColorProfile(profile);
if (!profile.isEmpty())
m_outputDeviceProfile = qcms_profile_from_memory(profile.data(), profile.size());
#endif
if (m_outputDeviceProfile && qcms_profile_is_bogus(m_outputDeviceProfile)) {
qcms_profile_release(m_outputDeviceProfile);
m_outputDeviceProfile = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment