Commit 1e5a8cff authored by noel@chromium.org's avatar noel@chromium.org

Move screenColorProfile from Platform to ImageDecoder

Platform is the wrong place for screenColorprofile, where it was
the only method there that did not know its Widget. ImageDecoder
is the only caller currently, move it there.

No change in behavior, covered by existing layout tests.

BUG=369787

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

git-svn-id: svn://svn.chromium.org/blink/trunk@181978 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 190d5a27
......@@ -104,11 +104,4 @@ blink::WebScreenOrientationType screenOrientationType(Widget* widget)
return hostWindow->screenInfo().orientationType;
}
void screenColorProfile(ColorProfile& toProfile)
{
blink::WebVector<char> profile;
blink::Platform::current()->screenColorProfile(&profile);
toProfile.append(profile.data(), profile.size());
}
} // namespace blink
......@@ -31,8 +31,6 @@
#include "wtf/Forward.h"
#include "wtf/RefPtr.h"
typedef WTF::Vector<char> ColorProfile;
namespace blink {
class FloatRect;
......@@ -44,7 +42,6 @@ PLATFORM_EXPORT bool screenIsMonochrome(Widget*);
PLATFORM_EXPORT FloatRect screenRect(Widget*);
PLATFORM_EXPORT FloatRect screenAvailableRect(Widget*);
PLATFORM_EXPORT void screenColorProfile(ColorProfile&);
PLATFORM_EXPORT uint16_t screenOrientationAngle(Widget*);
PLATFORM_EXPORT WebScreenOrientationType screenOrientationType(Widget*);
......
......@@ -43,6 +43,8 @@
#include "qcms.h"
#endif
typedef Vector<char> ColorProfile;
namespace blink {
// ImagePlanes can be used to decode color components into provided buffers instead of using an ImageFrame.
......@@ -196,16 +198,15 @@ public:
OutputDeviceProfile()
: m_outputDeviceProfile(0)
{
// FIXME: Add optional ICCv4 support.
// FIXME: add support for multiple monitors.
ColorProfile profile;
screenColorProfile(profile);
ColorProfile profile = screenColorProfile();
if (!profile.isEmpty())
m_outputDeviceProfile = qcms_profile_from_memory(profile.data(), profile.size());
if (m_outputDeviceProfile && qcms_profile_is_bogus(m_outputDeviceProfile)) {
qcms_profile_release(m_outputDeviceProfile);
m_outputDeviceProfile = 0;
}
if (!m_outputDeviceProfile)
m_outputDeviceProfile = qcms_profile_sRGB();
if (m_outputDeviceProfile)
......@@ -215,6 +216,17 @@ public:
qcms_profile* profile() const { return m_outputDeviceProfile; }
private:
static ColorProfile screenColorProfile()
{
// FIXME: Add optional ICCv4 support and support for multiple monitors.
WebVector<char> profile;
Platform::current()->screenColorProfile(&profile);
ColorProfile colorProfile;
colorProfile.append(profile.data(), profile.size());
return colorProfile;
}
qcms_profile* m_outputDeviceProfile;
};
......
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