<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[197171] trunk/Source/WebCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/197171">197171</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-02-26 09:36:41 -0800 (Fri, 26 Feb 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Remove libqcms support
https://bugs.webkit.org/show_bug.cgi?id=154707
Patch by Martin Robinson <mrobinson@igalia.com> on 2016-02-26
Reviewed by Žan Doberšek.
No new tests. This change simply removes dead code.
* platform/image-decoders/ImageDecoder.h: Remove QCMS support.
(WebCore::ImageDecoder::qcmsOutputDeviceProfile): Deleted.
* platform/image-decoders/jpeg/JPEGImageDecoder.cpp: Remove QCMS support.
(WebCore::JPEGImageReader::JPEGImageReader): Deleted.
(WebCore::JPEGImageReader::close): Deleted.
(WebCore::JPEGImageReader::decode): Deleted.
(WebCore::JPEGImageReader::colorTransform): Deleted.
(WebCore::JPEGImageReader::createColorTransform): Deleted.
(WebCore::JPEGImageDecoder::outputScanlines): Deleted.
* platform/image-decoders/png/PNGImageDecoder.cpp: Remove QCMS support.
(WebCore::PNGImageReader::PNGImageReader): Deleted.
(WebCore::PNGImageReader::close): Deleted.
(WebCore::PNGImageReader::rowBuffer): Deleted.
(WebCore::PNGImageReader::createRowBuffer): Deleted.
(WebCore::PNGImageReader::colorTransform): Deleted.
(WebCore::PNGImageReader::createColorTransform): Deleted.
(WebCore::PNGImageDecoder::headerAvailable): Deleted.
(WebCore::PNGImageDecoder::rowAvailable): Deleted.
(WebCore::PNGImageDecoder::frameComplete): Deleted.
* platform/image-decoders/webp/WEBPImageDecoder.cpp: Remove QCMS support.
(WebCore::WEBPImageDecoder::decode): Remove QCMS support.
(WebCore::WEBPImageDecoder::WEBPImageDecoder): Deleted.
(WebCore::WEBPImageDecoder::clear): Deleted.
(WebCore::WEBPImageDecoder::createColorTransform): Deleted.
(WebCore::WEBPImageDecoder::readColorProfile): Deleted.
(WebCore::WEBPImageDecoder::applyColorProfile): Deleted.
* platform/image-decoders/webp/WEBPImageDecoder.h: Remove QCMS support.
(WebCore::WEBPImageDecoder::colorTransform): Deleted.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformimagedecodersImageDecoderh">trunk/Source/WebCore/platform/image-decoders/ImageDecoder.h</a></li>
<li><a href="#trunkSourceWebCoreplatformimagedecodersjpegJPEGImageDecodercpp">trunk/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformimagedecoderspngPNGImageDecodercpp">trunk/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformimagedecoderswebpWEBPImageDecodercpp">trunk/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformimagedecoderswebpWEBPImageDecoderh">trunk/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (197170 => 197171)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-02-26 17:36:03 UTC (rev 197170)
+++ trunk/Source/WebCore/ChangeLog        2016-02-26 17:36:41 UTC (rev 197171)
</span><span class="lines">@@ -1,3 +1,41 @@
</span><ins>+2016-02-26 Martin Robinson <mrobinson@igalia.com>
+
+ Remove libqcms support
+ https://bugs.webkit.org/show_bug.cgi?id=154707
+
+ Reviewed by Žan Doberšek.
+
+ No new tests. This change simply removes dead code.
+
+ * platform/image-decoders/ImageDecoder.h: Remove QCMS support.
+ (WebCore::ImageDecoder::qcmsOutputDeviceProfile): Deleted.
+ * platform/image-decoders/jpeg/JPEGImageDecoder.cpp: Remove QCMS support.
+ (WebCore::JPEGImageReader::JPEGImageReader): Deleted.
+ (WebCore::JPEGImageReader::close): Deleted.
+ (WebCore::JPEGImageReader::decode): Deleted.
+ (WebCore::JPEGImageReader::colorTransform): Deleted.
+ (WebCore::JPEGImageReader::createColorTransform): Deleted.
+ (WebCore::JPEGImageDecoder::outputScanlines): Deleted.
+ * platform/image-decoders/png/PNGImageDecoder.cpp: Remove QCMS support.
+ (WebCore::PNGImageReader::PNGImageReader): Deleted.
+ (WebCore::PNGImageReader::close): Deleted.
+ (WebCore::PNGImageReader::rowBuffer): Deleted.
+ (WebCore::PNGImageReader::createRowBuffer): Deleted.
+ (WebCore::PNGImageReader::colorTransform): Deleted.
+ (WebCore::PNGImageReader::createColorTransform): Deleted.
+ (WebCore::PNGImageDecoder::headerAvailable): Deleted.
+ (WebCore::PNGImageDecoder::rowAvailable): Deleted.
+ (WebCore::PNGImageDecoder::frameComplete): Deleted.
+ * platform/image-decoders/webp/WEBPImageDecoder.cpp: Remove QCMS support.
+ (WebCore::WEBPImageDecoder::decode): Remove QCMS support.
+ (WebCore::WEBPImageDecoder::WEBPImageDecoder): Deleted.
+ (WebCore::WEBPImageDecoder::clear): Deleted.
+ (WebCore::WEBPImageDecoder::createColorTransform): Deleted.
+ (WebCore::WEBPImageDecoder::readColorProfile): Deleted.
+ (WebCore::WEBPImageDecoder::applyColorProfile): Deleted.
+ * platform/image-decoders/webp/WEBPImageDecoder.h: Remove QCMS support.
+ (WebCore::WEBPImageDecoder::colorTransform): Deleted.
+
</ins><span class="cx"> 2016-02-26 Zalan Bujtas <zalan@apple.com>
</span><span class="cx">
</span><span class="cx"> RenderTheme::controlSize* methods should take const RenderStyle&.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformimagedecodersImageDecoderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/image-decoders/ImageDecoder.h (197170 => 197171)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/image-decoders/ImageDecoder.h        2016-02-26 17:36:03 UTC (rev 197170)
+++ trunk/Source/WebCore/platform/image-decoders/ImageDecoder.h        2016-02-26 17:36:41 UTC (rev 197171)
</span><span class="lines">@@ -38,15 +38,6 @@
</span><span class="cx"> #include <wtf/Vector.h>
</span><span class="cx"> #include <wtf/text/WTFString.h>
</span><span class="cx">
</span><del>-#if USE(QCMSLIB)
-#include "qcms.h"
-#if OS(DARWIN)
-#include "GraphicsContextCG.h"
-#include <ApplicationServices/ApplicationServices.h>
-#include <wtf/RetainPtr.h>
-#endif
-#endif
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> // ImageFrame represents the decoded image data. This buffer is what all
</span><span class="lines">@@ -346,38 +337,6 @@
</span><span class="cx"> return !memcmp(&profileData[12], "mntr", 4) || !memcmp(&profileData[12], "scnr", 4);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-#if USE(QCMSLIB)
- static qcms_profile* qcmsOutputDeviceProfile()
- {
- static qcms_profile* outputDeviceProfile = 0;
-
- static bool qcmsInitialized = false;
- if (!qcmsInitialized) {
- qcmsInitialized = true;
- // FIXME: Add optional ICCv4 support.
-#if OS(DARWIN)
- RetainPtr<CGColorSpaceRef> monitorColorSpace = adoptCF(CGDisplayCopyColorSpace(CGMainDisplayID()));
- CFDataRef iccProfile(CGColorSpaceCopyICCProfile(monitorColorSpace.get()));
- if (iccProfile) {
- size_t length = CFDataGetLength(iccProfile);
- const unsigned char* systemProfile = CFDataGetBytePtr(iccProfile);
- outputDeviceProfile = qcms_profile_from_memory(systemProfile, length);
- CFRelease(iccProfile);
- }
-#endif
- if (outputDeviceProfile && qcms_profile_is_bogus(outputDeviceProfile)) {
- qcms_profile_release(outputDeviceProfile);
- outputDeviceProfile = 0;
- }
- if (!outputDeviceProfile)
- outputDeviceProfile = qcms_profile_sRGB();
- if (outputDeviceProfile)
- qcms_profile_precache_output_transform(outputDeviceProfile);
- }
- return outputDeviceProfile;
- }
-#endif
-
</del><span class="cx"> // Sets the "decode failure" flag. For caller convenience (since so
</span><span class="cx"> // many callers want to return false after calling this), returns false
</span><span class="cx"> // to enable easy tailcalling. Subclasses may override this to also
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformimagedecodersjpegJPEGImageDecodercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp (197170 => 197171)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp        2016-02-26 17:36:03 UTC (rev 197170)
+++ trunk/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp        2016-02-26 17:36:41 UTC (rev 197171)
</span><span class="lines">@@ -44,9 +44,6 @@
</span><span class="cx"> #if USE(ICCJPEG)
</span><span class="cx"> #include <iccjpeg.h>
</span><span class="cx"> #endif
</span><del>-#if USE(QCMSLIB)
-#include <qcms.h>
-#endif
</del><span class="cx"> #include <setjmp.h>
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -238,9 +235,6 @@
</span><span class="cx"> , m_bytesToSkip(0)
</span><span class="cx"> , m_state(JPEG_HEADER)
</span><span class="cx"> , m_samples(0)
</span><del>-#if USE(QCMSLIB)
- , m_transform(0)
-#endif
</del><span class="cx"> {
</span><span class="cx"> memset(&m_info, 0, sizeof(jpeg_decompress_struct));
</span><span class="cx">
</span><span class="lines">@@ -291,11 +285,6 @@
</span><span class="cx"> fastFree(src);
</span><span class="cx"> m_info.src = 0;
</span><span class="cx">
</span><del>-#if USE(QCMSLIB)
- if (m_transform)
- qcms_transform_release(m_transform);
- m_transform = 0;
-#endif
</del><span class="cx"> jpeg_destroy_decompress(&m_info);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -379,14 +368,6 @@
</span><span class="cx"> ColorProfile rgbInputDeviceColorProfile = readColorProfile(info());
</span><span class="cx"> if (!rgbInputDeviceColorProfile.isEmpty())
</span><span class="cx"> m_decoder->setColorProfile(rgbInputDeviceColorProfile);
</span><del>-#if USE(QCMSLIB)
- createColorTransform(rgbInputDeviceColorProfile, colorSpaceHasAlpha(m_info.out_color_space));
-#if defined(TURBO_JPEG_RGB_SWIZZLE)
- // Input RGBA data to qcms. Note: restored to BGRA on output.
- if (m_transform && m_info.out_color_space == JCS_EXT_BGRA)
- m_info.out_color_space = JCS_EXT_RGBA;
-#endif
-#endif
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Don't allocate a giant and superfluous memory buffer when the
</span><span class="lines">@@ -511,32 +492,7 @@
</span><span class="cx"> jpeg_decompress_struct* info() { return &m_info; }
</span><span class="cx"> JSAMPARRAY samples() const { return m_samples; }
</span><span class="cx"> JPEGImageDecoder* decoder() { return m_decoder; }
</span><del>-#if USE(QCMSLIB)
- qcms_transform* colorTransform() const { return m_transform; }
</del><span class="cx">
</span><del>- void createColorTransform(const ColorProfile& colorProfile, bool hasAlpha)
- {
- if (m_transform)
- qcms_transform_release(m_transform);
- m_transform = 0;
-
- if (colorProfile.isEmpty())
- return;
- qcms_profile* deviceProfile = ImageDecoder::qcmsOutputDeviceProfile();
- if (!deviceProfile)
- return;
- qcms_profile* inputProfile = qcms_profile_from_memory(colorProfile.data(), colorProfile.size());
- if (!inputProfile)
- return;
- // We currently only support color profiles for RGB profiled images.
- ASSERT(icSigRgbData == qcms_profile_get_color_space(inputProfile));
- qcms_data_type dataFormat = hasAlpha ? QCMS_DATA_RGBA_8 : QCMS_DATA_RGB_8;
- // FIXME: Don't force perceptual intent if the image profile contains an intent.
- m_transform = qcms_transform_create(inputProfile, dataFormat, deviceProfile, dataFormat, QCMS_INTENT_PERCEPTUAL);
- qcms_profile_release(inputProfile);
- }
-#endif
-
</del><span class="cx"> private:
</span><span class="cx"> JPEGImageDecoder* m_decoder;
</span><span class="cx"> unsigned m_bufferLength;
</span><span class="lines">@@ -548,10 +504,6 @@
</span><span class="cx"> jstate m_state;
</span><span class="cx">
</span><span class="cx"> JSAMPARRAY m_samples;
</span><del>-
-#if USE(QCMSLIB)
- qcms_transform* m_transform;
-#endif
</del><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> // Override the standard error method in the IJG JPEG decoder code.
</span><span class="lines">@@ -679,11 +631,6 @@
</span><span class="cx"> if (destY < 0)
</span><span class="cx"> continue;
</span><span class="cx">
</span><del>-#if USE(QCMSLIB)
- if (m_reader->colorTransform() && colorSpace == JCS_RGB)
- qcms_transform_data(m_reader->colorTransform(), *samples, *samples, info->output_width);
-#endif
-
</del><span class="cx"> ImageFrame::PixelData* currentAddress = buffer.getAddr(0, destY);
</span><span class="cx"> for (int x = 0; x < width; ++x) {
</span><span class="cx"> setPixel<colorSpace>(buffer, currentAddress, samples, isScaled ? m_scaledColumns[x] : x);
</span><span class="lines">@@ -727,10 +674,6 @@
</span><span class="cx"> unsigned char* row = reinterpret_cast<unsigned char*>(buffer.getAddr(0, info->output_scanline));
</span><span class="cx"> if (jpeg_read_scanlines(info, &row, 1) != 1)
</span><span class="cx"> return false;
</span><del>-#if USE(QCMSLIB)
- if (qcms_transform* transform = m_reader->colorTransform())
- qcms_transform_data_type(transform, row, row, info->output_width, rgbOutputColorSpace() == JCS_EXT_BGRA ? QCMS_OUTPUT_BGRX : QCMS_OUTPUT_RGBX);
-#endif
</del><span class="cx"> }
</span><span class="cx"> return true;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformimagedecoderspngPNGImageDecodercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp (197170 => 197171)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp        2016-02-26 17:36:03 UTC (rev 197170)
+++ trunk/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp        2016-02-26 17:36:41 UTC (rev 197171)
</span><span class="lines">@@ -45,10 +45,6 @@
</span><span class="cx"> #include <png.h>
</span><span class="cx"> #include <wtf/StdLibExtras.h>
</span><span class="cx">
</span><del>-#if USE(QCMSLIB)
-#include <qcms.h>
-#endif
-
</del><span class="cx"> #if defined(PNG_LIBPNG_VER_MAJOR) && defined(PNG_LIBPNG_VER_MINOR) && (PNG_LIBPNG_VER_MAJOR > 1 || (PNG_LIBPNG_VER_MAJOR == 1 && PNG_LIBPNG_VER_MINOR >= 4))
</span><span class="cx"> #define JMPBUF(png_ptr) png_jmpbuf(png_ptr)
</span><span class="cx"> #else
</span><span class="lines">@@ -125,10 +121,6 @@
</span><span class="cx"> , m_decodingSizeOnly(false)
</span><span class="cx"> , m_hasAlpha(false)
</span><span class="cx"> , m_interlaceBuffer(0)
</span><del>-#if USE(QCMSLIB)
- , m_transform(0)
- , m_rowBuffer()
-#endif
</del><span class="cx"> {
</span><span class="cx"> m_png = png_create_read_struct(PNG_LIBPNG_VER_STRING, 0, decodingFailed, decodingWarning);
</span><span class="cx"> m_info = png_create_info_struct(m_png);
</span><span class="lines">@@ -151,11 +143,6 @@
</span><span class="cx"> if (m_png && m_info)
</span><span class="cx"> // This will zero the pointers.
</span><span class="cx"> png_destroy_read_struct(&m_png, &m_info, 0);
</span><del>-#if USE(QCMSLIB)
- if (m_transform)
- qcms_transform_release(m_transform);
- m_transform = 0;
-#endif
</del><span class="cx"> delete[] m_interlaceBuffer;
</span><span class="cx"> m_interlaceBuffer = 0;
</span><span class="cx"> m_readOffset = 0;
</span><span class="lines">@@ -195,34 +182,7 @@
</span><span class="cx">
</span><span class="cx"> png_bytep interlaceBuffer() const { return m_interlaceBuffer; }
</span><span class="cx"> void createInterlaceBuffer(int size) { m_interlaceBuffer = new png_byte[size]; }
</span><del>-#if USE(QCMSLIB)
- png_bytep rowBuffer() const { return m_rowBuffer.get(); }
- void createRowBuffer(int size) { m_rowBuffer = std::make_unique<png_byte[]>(size); }
- qcms_transform* colorTransform() const { return m_transform; }
</del><span class="cx">
</span><del>- void createColorTransform(const ColorProfile& colorProfile, bool hasAlpha)
- {
- if (m_transform)
- qcms_transform_release(m_transform);
- m_transform = 0;
-
- if (colorProfile.isEmpty())
- return;
- qcms_profile* deviceProfile = ImageDecoder::qcmsOutputDeviceProfile();
- if (!deviceProfile)
- return;
- qcms_profile* inputProfile = qcms_profile_from_memory(colorProfile.data(), colorProfile.size());
- if (!inputProfile)
- return;
- // We currently only support color profiles for RGB and RGBA images.
- ASSERT(icSigRgbData == qcms_profile_get_color_space(inputProfile));
- qcms_data_type dataFormat = hasAlpha ? QCMS_DATA_RGBA_8 : QCMS_DATA_RGB_8;
- // FIXME: Don't force perceptual intent if the image profile contains an intent.
- m_transform = qcms_transform_create(inputProfile, dataFormat, deviceProfile, dataFormat, QCMS_INTENT_PERCEPTUAL);
- qcms_profile_release(inputProfile);
- }
-#endif
-
</del><span class="cx"> private:
</span><span class="cx"> png_structp m_png;
</span><span class="cx"> png_infop m_info;
</span><span class="lines">@@ -231,10 +191,6 @@
</span><span class="cx"> bool m_decodingSizeOnly;
</span><span class="cx"> bool m_hasAlpha;
</span><span class="cx"> png_bytep m_interlaceBuffer;
</span><del>-#if USE(QCMSLIB)
- qcms_transform* m_transform;
- std::unique_ptr<png_byte[]> m_rowBuffer;
-#endif
</del><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> PNGImageDecoder::PNGImageDecoder(ImageSource::AlphaOption alphaOption, ImageSource::GammaAndColorProfileOption gammaAndColorProfileOption)
</span><span class="lines">@@ -457,11 +413,6 @@
</span><span class="cx"> // the color profile or we'd need to decode into a gray-scale image buffer and
</span><span class="cx"> // hand that to CoreGraphics.
</span><span class="cx"> readColorProfile(png, info, m_colorProfile);
</span><del>-#if USE(QCMSLIB)
- bool decodedImageHasAlpha = (colorType & PNG_COLOR_MASK_ALPHA) || trnsCount;
- m_reader->createColorTransform(m_colorProfile, decodedImageHasAlpha);
- m_colorProfile.clear();
-#endif
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Deal with gamma and keep it under our control.
</span><span class="lines">@@ -553,15 +504,6 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-#if USE(QCMSLIB)
- if (m_reader->colorTransform() && !m_currentFrame) {
- m_reader->createRowBuffer(colorChannels * size().width());
- if (!m_reader->rowBuffer()) {
- longjmp(JMPBUF(png), 1);
- return;
- }
- }
-#endif
</del><span class="cx"> buffer.setStatus(ImageFrame::FramePartial);
</span><span class="cx"> buffer.setHasAlpha(false);
</span><span class="cx"> buffer.setColorProfile(m_colorProfile);
</span><span class="lines">@@ -630,13 +572,6 @@
</span><span class="cx"> png_progressive_combine_row(m_reader->pngPtr(), row, rowBuffer);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-#if USE(QCMSLIB)
- if (qcms_transform* transform = m_reader->colorTransform()) {
- qcms_transform_data(transform, row, m_reader->rowBuffer(), size().width());
- row = m_reader->rowBuffer();
- }
-#endif
-
</del><span class="cx"> // Write the decoded row pixels to the frame buffer.
</span><span class="cx"> ImageFrame::PixelData* address = buffer.getAddr(0, y);
</span><span class="cx"> int width = scaledSize().width();
</span><span class="lines">@@ -961,12 +896,6 @@
</span><span class="cx"> #if ENABLE(IMAGE_DECODER_DOWN_SAMPLING)
</span><span class="cx"> for (int y = 0; y < rect.maxY() - rect.y(); ++y) {
</span><span class="cx"> png_bytep row = interlaceBuffer + (m_scaled ? m_scaledRows[y] : y) * colorChannels * size().width();
</span><del>-#if USE(QCMSLIB)
- if (qcms_transform* transform = m_reader->colorTransform()) {
- qcms_transform_data(transform, row, m_reader->rowBuffer(), size().width());
- row = m_reader->rowBuffer();
- }
-#endif
</del><span class="cx"> ImageFrame::PixelData* address = buffer.getAddr(rect.x(), y + rect.y());
</span><span class="cx"> for (int x = 0; x < rect.maxX() - rect.x(); ++x) {
</span><span class="cx"> png_bytep pixel = row + (m_scaled ? m_scaledColumns[x] : x) * colorChannels;
</span><span class="lines">@@ -983,12 +912,6 @@
</span><span class="cx"> png_bytep row = interlaceBuffer;
</span><span class="cx"> for (int y = rect.y(); y < rect.maxY(); ++y, row += colorChannels * size().width()) {
</span><span class="cx"> png_bytep pixel = row;
</span><del>-#if USE(QCMSLIB)
- if (qcms_transform* transform = m_reader->colorTransform()) {
- qcms_transform_data(transform, row, m_reader->rowBuffer(), size().width());
- pixel = m_reader->rowBuffer();
- }
-#endif
</del><span class="cx"> ImageFrame::PixelData* address = buffer.getAddr(rect.x(), y);
</span><span class="cx"> for (int x = rect.x(); x < rect.maxX(); ++x, pixel += colorChannels) {
</span><span class="cx"> unsigned alpha = hasAlpha ? pixel[3] : 255;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformimagedecoderswebpWEBPImageDecodercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.cpp (197170 => 197171)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.cpp        2016-02-26 17:36:03 UTC (rev 197170)
+++ trunk/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.cpp        2016-02-26 17:36:41 UTC (rev 197171)
</span><span class="lines">@@ -31,14 +31,6 @@
</span><span class="cx">
</span><span class="cx"> #if USE(WEBP)
</span><span class="cx">
</span><del>-#ifdef QCMS_WEBP_COLOR_CORRECTION
-#include <qcms.h>
-#include <webp/demux.h>
-#else
-#undef ICCP_FLAG
-#define ICCP_FLAG 0
-#endif
-
</del><span class="cx"> // Backward emulation for earlier versions than 0.1.99.
</span><span class="cx"> #if (WEBP_DECODER_ABI_VERSION < 0x0163)
</span><span class="cx"> #define MODE_rgbA MODE_RGBA
</span><span class="lines">@@ -59,11 +51,6 @@
</span><span class="cx"> , m_decoder(0)
</span><span class="cx"> , m_hasAlpha(false)
</span><span class="cx"> , m_formatFlags(0)
</span><del>-#ifdef QCMS_WEBP_COLOR_CORRECTION
- , m_haveReadProfile(false)
- , m_transform(0)
- , m_decodedHeight(0)
-#endif
</del><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -74,11 +61,6 @@
</span><span class="cx">
</span><span class="cx"> void WEBPImageDecoder::clear()
</span><span class="cx"> {
</span><del>-#ifdef QCMS_WEBP_COLOR_CORRECTION
- if (m_transform)
- qcms_transform_release(m_transform);
- m_transform = 0;
-#endif
</del><span class="cx"> if (m_decoder)
</span><span class="cx"> WebPIDelete(m_decoder);
</span><span class="cx"> m_decoder = 0;
</span><span class="lines">@@ -108,94 +90,6 @@
</span><span class="cx"> return &frame;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-#ifdef QCMS_WEBP_COLOR_CORRECTION
-
-void WEBPImageDecoder::createColorTransform(const char* data, size_t size)
-{
- if (m_transform)
- qcms_transform_release(m_transform);
- m_transform = 0;
-
- qcms_profile* deviceProfile = ImageDecoder::qcmsOutputDeviceProfile();
- if (!deviceProfile)
- return;
- qcms_profile* inputProfile = qcms_profile_from_memory(data, size);
- if (!inputProfile)
- return;
-
- // We currently only support color profiles for RGB profiled images.
- ASSERT(icSigRgbData == qcms_profile_get_color_space(inputProfile));
- // The input image pixels are RGBA format.
- qcms_data_type format = QCMS_DATA_RGBA_8;
- // FIXME: Don't force perceptual intent if the image profile contains an intent.
- m_transform = qcms_transform_create(inputProfile, format, deviceProfile, QCMS_DATA_RGBA_8, QCMS_INTENT_PERCEPTUAL);
-
- qcms_profile_release(inputProfile);
-}
-
-void WEBPImageDecoder::readColorProfile(const uint8_t* data, size_t size)
-{
- WebPChunkIterator chunkIterator;
- WebPData inputData = { data, size };
- WebPDemuxState state;
-
- WebPDemuxer* demuxer = WebPDemuxPartial(&inputData, &state);
- if (!WebPDemuxGetChunk(demuxer, "ICCP", 1, &chunkIterator)) {
- WebPDemuxReleaseChunkIterator(&chunkIterator);
- WebPDemuxDelete(demuxer);
- return;
- }
-
- const char* profileData = reinterpret_cast<const char*>(chunkIterator.chunk.bytes);
- size_t profileSize = chunkIterator.chunk.size;
-
- // Only accept RGB color profiles from input class devices.
- bool ignoreProfile = false;
- if (profileSize < ImageDecoder::iccColorProfileHeaderLength)
- ignoreProfile = true;
- else if (!ImageDecoder::rgbColorProfile(profileData, profileSize))
- ignoreProfile = true;
- else if (!ImageDecoder::inputDeviceColorProfile(profileData, profileSize))
- ignoreProfile = true;
-
- if (!ignoreProfile)
- createColorTransform(profileData, profileSize);
-
- WebPDemuxReleaseChunkIterator(&chunkIterator);
- WebPDemuxDelete(demuxer);
-}
-
-void WEBPImageDecoder::applyColorProfile(const uint8_t* data, size_t size, ImageFrame& buffer)
-{
- int width;
- int decodedHeight;
- if (!WebPIDecGetRGB(m_decoder, &decodedHeight, &width, 0, 0))
- return; // See also https://bugs.webkit.org/show_bug.cgi?id=74062
- if (decodedHeight <= 0)
- return;
-
- if (!m_haveReadProfile) {
- readColorProfile(data, size);
- m_haveReadProfile = true;
- }
-
- ASSERT(width == scaledSize().width());
- ASSERT(decodedHeight <= scaledSize().height());
-
- for (int y = m_decodedHeight; y < decodedHeight; ++y) {
- uint8_t* row = reinterpret_cast<uint8_t*>(buffer.getAddr(0, y));
- if (qcms_transform* transform = colorTransform())
- qcms_transform_data_type(transform, row, row, width, QCMS_OUTPUT_RGBX);
- uint8_t* pixel = row;
- for (int x = 0; x < width; ++x, pixel += 4)
- buffer.setRGBA(x, y, pixel[0], pixel[1], pixel[2], pixel[3]);
- }
-
- m_decodedHeight = decodedHeight;
-}
-
-#endif // QCMS_WEBP_COLOR_CORRECTION
-
</del><span class="cx"> bool WEBPImageDecoder::decode(bool onlySize)
</span><span class="cx"> {
</span><span class="cx"> if (failed())
</span><span class="lines">@@ -209,22 +103,7 @@
</span><span class="cx"> if (dataSize < imageHeaderSize)
</span><span class="cx"> return false;
</span><span class="cx"> int width, height;
</span><del>-#ifdef QCMS_WEBP_COLOR_CORRECTION
- WebPData inputData = { dataBytes, dataSize };
- WebPDemuxState state;
- WebPDemuxer* demuxer = WebPDemuxPartial(&inputData, &state);
- if (!demuxer)
- return setFailed();
-
- width = WebPDemuxGetI(demuxer, WEBP_FF_CANVAS_WIDTH);
- height = WebPDemuxGetI(demuxer, WEBP_FF_CANVAS_HEIGHT);
- m_formatFlags = WebPDemuxGetI(demuxer, WEBP_FF_FORMAT_FLAGS);
- m_hasAlpha = !!(m_formatFlags & ALPHA_FLAG);
-
- WebPDemuxDelete(demuxer);
- if (state <= WEBP_DEMUX_PARSING_HEADER)
- return false;
-#elif (WEBP_DECODER_ABI_VERSION >= 0x0163)
</del><ins>+#if (WEBP_DECODER_ABI_VERSION >= 0x0163)
</ins><span class="cx"> WebPBitstreamFeatures features;
</span><span class="cx"> if (WebPGetFeatures(dataBytes, dataSize, &features) != VP8_STATUS_OK)
</span><span class="cx"> return setFailed();
</span><span class="lines">@@ -261,8 +140,6 @@
</span><span class="cx"> WEBP_CSP_MODE mode = outputMode(m_hasAlpha);
</span><span class="cx"> if (!m_premultiplyAlpha)
</span><span class="cx"> mode = outputMode(false);
</span><del>- if ((m_formatFlags & ICCP_FLAG) && !ignoresGammaAndColorProfile())
- mode = MODE_RGBA; // Decode to RGBA for input to libqcms.
</del><span class="cx"> int rowStride = size().width() * sizeof(ImageFrame::PixelData);
</span><span class="cx"> uint8_t* output = reinterpret_cast<uint8_t*>(buffer.getAddr(0, 0));
</span><span class="cx"> int outputSize = size().height() * rowStride;
</span><span class="lines">@@ -273,14 +150,10 @@
</span><span class="cx">
</span><span class="cx"> switch (WebPIUpdate(m_decoder, dataBytes, dataSize)) {
</span><span class="cx"> case VP8_STATUS_OK:
</span><del>- if ((m_formatFlags & ICCP_FLAG) && !ignoresGammaAndColorProfile())
- applyColorProfile(dataBytes, dataSize, buffer);
</del><span class="cx"> buffer.setStatus(ImageFrame::FrameComplete);
</span><span class="cx"> clear();
</span><span class="cx"> return true;
</span><span class="cx"> case VP8_STATUS_SUSPENDED:
</span><del>- if ((m_formatFlags & ICCP_FLAG) && !ignoresGammaAndColorProfile())
- applyColorProfile(dataBytes, dataSize, buffer);
</del><span class="cx"> return false;
</span><span class="cx"> default:
</span><span class="cx"> clear();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformimagedecoderswebpWEBPImageDecoderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.h (197170 => 197171)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.h        2016-02-26 17:36:03 UTC (rev 197170)
+++ trunk/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.h        2016-02-26 17:36:41 UTC (rev 197171)
</span><span class="lines">@@ -34,9 +34,6 @@
</span><span class="cx"> #if USE(WEBP)
</span><span class="cx">
</span><span class="cx"> #include "webp/decode.h"
</span><del>-#if USE(QCMSLIB) && (WEBP_DECODER_ABI_VERSION > 0x200)
-#define QCMS_WEBP_COLOR_CORRECTION
-#endif
</del><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="lines">@@ -56,18 +53,7 @@
</span><span class="cx"> bool m_hasAlpha;
</span><span class="cx"> int m_formatFlags;
</span><span class="cx">
</span><del>-#ifdef QCMS_WEBP_COLOR_CORRECTION
- qcms_transform* colorTransform() const { return m_transform; }
- void createColorTransform(const char* data, size_t);
- void readColorProfile(const uint8_t* data, size_t);
- void applyColorProfile(const uint8_t* data, size_t, ImageFrame&);
-
- bool m_haveReadProfile;
- qcms_transform* m_transform;
- int m_decodedHeight;
-#else
</del><span class="cx"> void applyColorProfile(const uint8_t*, size_t, ImageFrame&) { };
</span><del>-#endif
</del><span class="cx"> void clear();
</span><span class="cx"> };
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>