<!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>[205661] 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/205661">205661</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-09-08 14:16:38 -0700 (Thu, 08 Sep 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Get rid of the color profile from ImageFrame and ImageDecoder
https://bugs.webkit.org/show_bug.cgi?id=159699
Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2016-09-08
Reviewed by Simon Fraser.
The color profile is set but it is never used.
* platform/image-decoders/ImageDecoder.cpp:
(WebCore::ImageFrame::setColorProfile): Deleted.
* platform/image-decoders/ImageDecoder.h:
* platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
(WebCore::JPEGImageReader::decode):
(WebCore::JPEGImageDecoder::outputScanlines):
(WebCore::readColorProfile): Deleted.
* platform/image-decoders/jpeg/JPEGImageDecoder.h:
* platform/image-decoders/png/PNGImageDecoder.cpp:
(WebCore::PNGImageDecoder::headerAvailable):
(WebCore::PNGImageDecoder::rowAvailable):
(WebCore::readColorProfile): Deleted.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformimagedecodersImageDecodercpp">trunk/Source/WebCore/platform/image-decoders/ImageDecoder.cpp</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="#trunkSourceWebCoreplatformimagedecodersjpegJPEGImageDecoderh">trunk/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.h</a></li>
<li><a href="#trunkSourceWebCoreplatformimagedecoderspngPNGImageDecodercpp">trunk/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (205660 => 205661)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-09-08 21:09:04 UTC (rev 205660)
+++ trunk/Source/WebCore/ChangeLog        2016-09-08 21:16:38 UTC (rev 205661)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2016-09-08 Said Abou-Hallawa <sabouhallawa@apple.com>
+
+ Get rid of the color profile from ImageFrame and ImageDecoder
+ https://bugs.webkit.org/show_bug.cgi?id=159699
+
+ Reviewed by Simon Fraser.
+
+ The color profile is set but it is never used.
+
+ * platform/image-decoders/ImageDecoder.cpp:
+ (WebCore::ImageFrame::setColorProfile): Deleted.
+ * platform/image-decoders/ImageDecoder.h:
+ * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
+ (WebCore::JPEGImageReader::decode):
+ (WebCore::JPEGImageDecoder::outputScanlines):
+ (WebCore::readColorProfile): Deleted.
+ * platform/image-decoders/jpeg/JPEGImageDecoder.h:
+ * platform/image-decoders/png/PNGImageDecoder.cpp:
+ (WebCore::PNGImageDecoder::headerAvailable):
+ (WebCore::PNGImageDecoder::rowAvailable):
+ (WebCore::readColorProfile): Deleted.
+
</ins><span class="cx"> 2016-09-08 Dave Hyatt <hyatt@apple.com>
</span><span class="cx">
</span><span class="cx"> [CSS Parser] Add support for new CSS selector parsing
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformimagedecodersImageDecodercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/image-decoders/ImageDecoder.cpp (205660 => 205661)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/image-decoders/ImageDecoder.cpp        2016-09-08 21:09:04 UTC (rev 205660)
+++ trunk/Source/WebCore/platform/image-decoders/ImageDecoder.cpp        2016-09-08 21:16:38 UTC (rev 205661)
</span><span class="lines">@@ -220,11 +220,6 @@
</span><span class="cx"> m_hasAlpha = alpha;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void ImageFrame::setColorProfile(const ColorProfile& colorProfile)
-{
- m_colorProfile = colorProfile;
-}
-
</del><span class="cx"> void ImageFrame::setStatus(FrameStatus status)
</span><span class="cx"> {
</span><span class="cx"> m_status = status;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformimagedecodersImageDecoderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/image-decoders/ImageDecoder.h (205660 => 205661)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/image-decoders/ImageDecoder.h        2016-09-08 21:09:04 UTC (rev 205660)
+++ trunk/Source/WebCore/platform/image-decoders/ImageDecoder.h        2016-09-08 21:16:38 UTC (rev 205661)
</span><span class="lines">@@ -110,7 +110,6 @@
</span><span class="cx"> bool premultiplyAlpha() const { return m_premultiplyAlpha; }
</span><span class="cx">
</span><span class="cx"> void setHasAlpha(bool alpha);
</span><del>- void setColorProfile(const ColorProfile&);
</del><span class="cx"> void setOriginalFrameRect(const IntRect& r) { m_originalFrameRect = r; }
</span><span class="cx"> void setStatus(FrameStatus status);
</span><span class="cx"> void setDuration(unsigned duration) { m_duration = duration; }
</span><span class="lines">@@ -214,8 +213,6 @@
</span><span class="cx"> Vector<PixelData> m_backingStore;
</span><span class="cx"> PixelData* m_bytes; // The memory is backed by m_backingStore.
</span><span class="cx"> IntSize m_size;
</span><del>- // FIXME: Do we need m_colorProfile anymore?
- ColorProfile m_colorProfile;
</del><span class="cx"> bool m_hasAlpha;
</span><span class="cx"> IntRect m_originalFrameRect; // This will always just be the entire
</span><span class="cx"> // buffer except for GIF frames whose
</span><span class="lines">@@ -381,8 +378,6 @@
</span><span class="cx">
</span><span class="cx"> RefPtr<SharedBuffer> m_data; // The encoded data.
</span><span class="cx"> Vector<ImageFrame, 1> m_frameBufferCache;
</span><del>- // FIXME: Do we need m_colorProfile any more, for any port?
- ColorProfile m_colorProfile;
</del><span class="cx"> bool m_scaled { false };
</span><span class="cx"> Vector<int> m_scaledColumns;
</span><span class="cx"> Vector<int> m_scaledRows;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformimagedecodersjpegJPEGImageDecodercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp (205660 => 205661)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp        2016-09-08 21:09:04 UTC (rev 205660)
+++ trunk/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp        2016-09-08 21:16:38 UTC (rev 205661)
</span><span class="lines">@@ -196,36 +196,6 @@
</span><span class="cx"> return ImageOrientation();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static ColorProfile readColorProfile(jpeg_decompress_struct* info)
-{
-#if USE(ICCJPEG)
- JOCTET* profile;
- unsigned int profileLength;
-
- if (!read_icc_profile(info, &profile, &profileLength))
- return ColorProfile();
-
- // Only accept RGB color profiles from input class devices.
- bool ignoreProfile = false;
- char* profileData = reinterpret_cast<char*>(profile);
- if (profileLength < ImageDecoder::iccColorProfileHeaderLength)
- ignoreProfile = true;
- else if (!ImageDecoder::rgbColorProfile(profileData, profileLength))
- ignoreProfile = true;
- else if (!ImageDecoder::inputDeviceColorProfile(profileData, profileLength))
- ignoreProfile = true;
-
- ColorProfile colorProfile;
- if (!ignoreProfile)
- colorProfile.append(profileData, profileLength);
- free(profile);
- return colorProfile;
-#else
- UNUSED_PARAM(info);
- return ColorProfile();
-#endif
-}
-
</del><span class="cx"> class JPEGImageReader {
</span><span class="cx"> WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><span class="lines">@@ -363,13 +333,6 @@
</span><span class="cx"> if (m_decoder->willDownSample() && turboSwizzled(m_info.out_color_space))
</span><span class="cx"> m_info.out_color_space = JCS_RGB;
</span><span class="cx"> #endif
</span><del>- // Allow color management of the decoded RGBA pixels if possible.
- if (!m_decoder->ignoresGammaAndColorProfile()) {
- ColorProfile rgbInputDeviceColorProfile = readColorProfile(info());
- if (!rgbInputDeviceColorProfile.isEmpty())
- m_decoder->setColorProfile(rgbInputDeviceColorProfile);
- }
-
</del><span class="cx"> // Don't allocate a giant and superfluous memory buffer when the
</span><span class="cx"> // image is a sequential JPEG.
</span><span class="cx"> m_info.buffered_image = jpeg_has_multiple_scans(&m_info);
</span><span class="lines">@@ -660,7 +623,6 @@
</span><span class="cx"> // The buffer is transparent outside the decoded area while the image is
</span><span class="cx"> // loading. The completed image will be marked fully opaque in jpegComplete().
</span><span class="cx"> buffer.setHasAlpha(true);
</span><del>- buffer.setColorProfile(m_colorProfile);
</del><span class="cx">
</span><span class="cx"> // For JPEGs, the frame always fills the entire image.
</span><span class="cx"> buffer.setOriginalFrameRect(IntRect(IntPoint(), size()));
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformimagedecodersjpegJPEGImageDecoderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.h (205660 => 205661)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.h        2016-09-08 21:09:04 UTC (rev 205660)
+++ trunk/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.h        2016-09-08 21:16:38 UTC (rev 205661)
</span><span class="lines">@@ -66,7 +66,6 @@
</span><span class="cx"> bool outputScanlines();
</span><span class="cx"> void jpegComplete();
</span><span class="cx">
</span><del>- void setColorProfile(const ColorProfile& colorProfile) { m_colorProfile = colorProfile; }
</del><span class="cx"> void setOrientation(ImageOrientation orientation) { m_orientation = orientation; }
</span><span class="cx">
</span><span class="cx"> private:
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformimagedecoderspngPNGImageDecodercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp (205660 => 205661)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp        2016-09-08 21:09:04 UTC (rev 205660)
+++ trunk/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp        2016-09-08 21:16:38 UTC (rev 205661)
</span><span class="lines">@@ -276,37 +276,6 @@
</span><span class="cx"> return ImageDecoder::setFailed();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static void readColorProfile(png_structp png, png_infop info, ColorProfile& colorProfile)
-{
- ASSERT(colorProfile.isEmpty());
-
-#ifdef PNG_iCCP_SUPPORTED
- char* profileName;
- int compressionType;
-#if (PNG_LIBPNG_VER < 10500)
- png_charp profile;
-#else
- png_bytep profile;
-#endif
- png_uint_32 profileLength;
- if (!png_get_iCCP(png, info, &profileName, &compressionType, &profile, &profileLength))
- return;
-
- // Only accept RGB color profiles from input class devices.
- bool ignoreProfile = false;
- char* profileData = reinterpret_cast<char*>(profile);
- if (profileLength < ImageDecoder::iccColorProfileHeaderLength)
- ignoreProfile = true;
- else if (!ImageDecoder::rgbColorProfile(profileData, profileLength))
- ignoreProfile = true;
- else if (!ImageDecoder::inputDeviceColorProfile(profileData, profileLength))
- ignoreProfile = true;
-
- if (!ignoreProfile)
- colorProfile.append(profileData, profileLength);
-#endif
-}
-
</del><span class="cx"> void PNGImageDecoder::headerAvailable()
</span><span class="cx"> {
</span><span class="cx"> png_structp png = m_reader->pngPtr();
</span><span class="lines">@@ -405,16 +374,6 @@
</span><span class="cx"> if (colorType == PNG_COLOR_TYPE_GRAY || colorType == PNG_COLOR_TYPE_GRAY_ALPHA)
</span><span class="cx"> png_set_gray_to_rgb(png);
</span><span class="cx">
</span><del>- if ((colorType & PNG_COLOR_MASK_COLOR) && !m_ignoreGammaAndColorProfile) {
- // We only support color profiles for color PALETTE and RGB[A] PNG. Supporting
- // color profiles for gray-scale images is slightly tricky, at least using the
- // CoreGraphics ICC library, because we expand gray-scale images to RGB but we
- // do not similarly transform the color profile. We'd either need to transform
- // the color profile or we'd need to decode into a gray-scale image buffer and
- // hand that to CoreGraphics.
- readColorProfile(png, info, m_colorProfile);
- }
-
</del><span class="cx"> // Deal with gamma and keep it under our control.
</span><span class="cx"> double gamma;
</span><span class="cx"> if (!m_ignoreGammaAndColorProfile && png_get_gAMA(png, info, &gamma)) {
</span><span class="lines">@@ -506,7 +465,6 @@
</span><span class="cx">
</span><span class="cx"> buffer.setStatus(ImageFrame::FramePartial);
</span><span class="cx"> buffer.setHasAlpha(false);
</span><del>- buffer.setColorProfile(m_colorProfile);
</del><span class="cx">
</span><span class="cx"> #if ENABLE(APNG)
</span><span class="cx"> if (m_currentFrame)
</span></span></pre>
</div>
</div>
</body>
</html>