<!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>[198849] 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/198849">198849</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-03-30 12:10:18 -0700 (Wed, 30 Mar 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Move the CG ImageDecoder class from ImageSourceCG.cpp to ImageDecoderCG.h and .cpp
https://bugs.webkit.org/show_bug.cgi?id=155980

Patch by Said Abou-Hallawa &lt;sabouhallawa@apple,com&gt; on 2016-03-30
Reviewed by Simon Fraser.

After this step, ImageSource.cpp and ImageSourceCG.cpp look very similar
so they can be merged in one file. All the redundant code in these two files
can be removed.

* PlatformAppleWin.cmake:
* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/cg/ImageDecoderCG.cpp: Copied from Source/WebCore/platform/graphics/cg/ImageSourceCG.cpp.
(WebCore::createImageSourceOptions):
(WebCore::imageSourceOptions):
(WebCore::orientationFromProperties):
(WebCore::sharedBufferGetBytesAtPosition):
(WebCore::sharedBufferRelease):
(WebCore::ImageDecoder::ImageDecoder):
(WebCore::ImageDecoder::subsamplingLevelForScale):
(WebCore::ImageDecoder::bytesDecodedToDetermineProperties):
(WebCore::ImageDecoder::filenameExtension):
(WebCore::ImageDecoder::isSizeAvailable):
(WebCore::ImageDecoder::size):
(WebCore::ImageDecoder::frameCount):
(WebCore::ImageDecoder::repetitionCount):
(WebCore::ImageDecoder::hotSpot):
(WebCore::ImageDecoder::frameSizeAtIndex):
(WebCore::ImageDecoder::frameIsCompleteAtIndex):
(WebCore::ImageDecoder::orientationAtIndex):
(WebCore::ImageDecoder::frameDurationAtIndex):
(WebCore::ImageDecoder::allowSubsamplingOfFrameAtIndex):
(WebCore::ImageDecoder::frameHasAlphaAtIndex):
(WebCore::ImageDecoder::frameBytesAtIndex):
(WebCore::ImageDecoder::createFrameImageAtIndex):
(WebCore::ImageDecoder::setData):
* platform/graphics/cg/ImageDecoderCG.h: Added.
(WebCore::ImageDecoder::create):
* platform/graphics/cg/ImageSourceCG.cpp:
(WebCore::ImageDecoder::create): Deleted.
(WebCore::createImageSourceOptions): Deleted.
(WebCore::imageSourceOptions): Deleted.
(WebCore::orientationFromProperties): Deleted.
(WebCore::sharedBufferGetBytesAtPosition): Deleted.
(WebCore::sharedBufferRelease): Deleted.
(WebCore::ImageDecoder::ImageDecoder): Deleted.
(WebCore::ImageDecoder::subsamplingLevelForScale): Deleted.
(WebCore::ImageDecoder::bytesDecodedToDetermineProperties): Deleted.
(WebCore::ImageDecoder::filenameExtension): Deleted.
(WebCore::ImageDecoder::isSizeAvailable): Deleted.
(WebCore::ImageDecoder::size): Deleted.
(WebCore::ImageDecoder::frameCount): Deleted.
(WebCore::ImageDecoder::repetitionCount): Deleted.
(WebCore::ImageDecoder::hotSpot): Deleted.
(WebCore::ImageDecoder::frameSizeAtIndex): Deleted.
(WebCore::ImageDecoder::frameIsCompleteAtIndex): Deleted.
(WebCore::ImageDecoder::orientationAtIndex): Deleted.
(WebCore::ImageDecoder::frameDurationAtIndex): Deleted.
(WebCore::ImageDecoder::allowSubsamplingOfFrameAtIndex): Deleted.
(WebCore::ImageDecoder::frameHasAlphaAtIndex): Deleted.
(WebCore::ImageDecoder::frameBytesAtIndex): Deleted.
(WebCore::ImageDecoder::createFrameImageAtIndex): Deleted.
(WebCore::ImageDecoder::setData): Deleted.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorePlatformAppleWincmake">trunk/Source/WebCore/PlatformAppleWin.cmake</a></li>
<li><a href="#trunkSourceWebCorePlatformMaccmake">trunk/Source/WebCore/PlatformMac.cmake</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgImageSourceCGcpp">trunk/Source/WebCore/platform/graphics/cg/ImageSourceCG.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformgraphicscgImageDecoderCGcpp">trunk/Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgImageDecoderCGh">trunk/Source/WebCore/platform/graphics/cg/ImageDecoderCG.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (198848 => 198849)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-03-30 18:31:47 UTC (rev 198848)
+++ trunk/Source/WebCore/ChangeLog        2016-03-30 19:10:18 UTC (rev 198849)
</span><span class="lines">@@ -1,3 +1,69 @@
</span><ins>+2016-03-30  Said Abou-Hallawa  &lt;sabouhallawa@apple,com&gt;
+
+        Move the CG ImageDecoder class from ImageSourceCG.cpp to ImageDecoderCG.h and .cpp
+        https://bugs.webkit.org/show_bug.cgi?id=155980
+
+        Reviewed by Simon Fraser.
+
+        After this step, ImageSource.cpp and ImageSourceCG.cpp look very similar
+        so they can be merged in one file. All the redundant code in these two files
+        can be removed.
+
+        * PlatformAppleWin.cmake:
+        * PlatformMac.cmake:
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/graphics/cg/ImageDecoderCG.cpp: Copied from Source/WebCore/platform/graphics/cg/ImageSourceCG.cpp.
+        (WebCore::createImageSourceOptions):
+        (WebCore::imageSourceOptions):
+        (WebCore::orientationFromProperties):
+        (WebCore::sharedBufferGetBytesAtPosition):
+        (WebCore::sharedBufferRelease):
+        (WebCore::ImageDecoder::ImageDecoder):
+        (WebCore::ImageDecoder::subsamplingLevelForScale):
+        (WebCore::ImageDecoder::bytesDecodedToDetermineProperties):
+        (WebCore::ImageDecoder::filenameExtension):
+        (WebCore::ImageDecoder::isSizeAvailable):
+        (WebCore::ImageDecoder::size):
+        (WebCore::ImageDecoder::frameCount):
+        (WebCore::ImageDecoder::repetitionCount):
+        (WebCore::ImageDecoder::hotSpot):
+        (WebCore::ImageDecoder::frameSizeAtIndex):
+        (WebCore::ImageDecoder::frameIsCompleteAtIndex):
+        (WebCore::ImageDecoder::orientationAtIndex):
+        (WebCore::ImageDecoder::frameDurationAtIndex):
+        (WebCore::ImageDecoder::allowSubsamplingOfFrameAtIndex):
+        (WebCore::ImageDecoder::frameHasAlphaAtIndex):
+        (WebCore::ImageDecoder::frameBytesAtIndex):
+        (WebCore::ImageDecoder::createFrameImageAtIndex):
+        (WebCore::ImageDecoder::setData):
+        * platform/graphics/cg/ImageDecoderCG.h: Added.
+        (WebCore::ImageDecoder::create):
+        * platform/graphics/cg/ImageSourceCG.cpp:
+        (WebCore::ImageDecoder::create): Deleted.
+        (WebCore::createImageSourceOptions): Deleted.
+        (WebCore::imageSourceOptions): Deleted.
+        (WebCore::orientationFromProperties): Deleted.
+        (WebCore::sharedBufferGetBytesAtPosition): Deleted.
+        (WebCore::sharedBufferRelease): Deleted.
+        (WebCore::ImageDecoder::ImageDecoder): Deleted.
+        (WebCore::ImageDecoder::subsamplingLevelForScale): Deleted.
+        (WebCore::ImageDecoder::bytesDecodedToDetermineProperties): Deleted.
+        (WebCore::ImageDecoder::filenameExtension): Deleted.
+        (WebCore::ImageDecoder::isSizeAvailable): Deleted.
+        (WebCore::ImageDecoder::size): Deleted.
+        (WebCore::ImageDecoder::frameCount): Deleted.
+        (WebCore::ImageDecoder::repetitionCount): Deleted.
+        (WebCore::ImageDecoder::hotSpot): Deleted.
+        (WebCore::ImageDecoder::frameSizeAtIndex): Deleted.
+        (WebCore::ImageDecoder::frameIsCompleteAtIndex): Deleted.
+        (WebCore::ImageDecoder::orientationAtIndex): Deleted.
+        (WebCore::ImageDecoder::frameDurationAtIndex): Deleted.
+        (WebCore::ImageDecoder::allowSubsamplingOfFrameAtIndex): Deleted.
+        (WebCore::ImageDecoder::frameHasAlphaAtIndex): Deleted.
+        (WebCore::ImageDecoder::frameBytesAtIndex): Deleted.
+        (WebCore::ImageDecoder::createFrameImageAtIndex): Deleted.
+        (WebCore::ImageDecoder::setData): Deleted.
+
</ins><span class="cx"> 2016-03-30  Per Arne Vollan  &lt;peavo@outlook.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [WinCairo][MediaFoundation] Video size is not always set.
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformAppleWincmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformAppleWin.cmake (198848 => 198849)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformAppleWin.cmake        2016-03-30 18:31:47 UTC (rev 198848)
+++ trunk/Source/WebCore/PlatformAppleWin.cmake        2016-03-30 19:10:18 UTC (rev 198849)
</span><span class="lines">@@ -71,6 +71,7 @@
</span><span class="cx">     platform/graphics/cg/ImageBufferCG.cpp
</span><span class="cx">     platform/graphics/cg/ImageBufferDataCG.cpp
</span><span class="cx">     platform/graphics/cg/ImageCG.cpp
</span><ins>+    platform/graphics/cg/ImageDecoderCG.cpp
</ins><span class="cx">     platform/graphics/cg/ImageSourceCG.cpp
</span><span class="cx">     platform/graphics/cg/ImageSourceCGWin.cpp
</span><span class="cx">     platform/graphics/cg/IntPointCG.cpp
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformMaccmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformMac.cmake (198848 => 198849)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformMac.cmake        2016-03-30 18:31:47 UTC (rev 198848)
+++ trunk/Source/WebCore/PlatformMac.cmake        2016-03-30 19:10:18 UTC (rev 198849)
</span><span class="lines">@@ -405,6 +405,7 @@
</span><span class="cx">     platform/graphics/cg/ImageBufferCG.cpp
</span><span class="cx">     platform/graphics/cg/ImageBufferDataCG.cpp
</span><span class="cx">     platform/graphics/cg/ImageCG.cpp
</span><ins>+    platform/graphics/cg/ImageDecoderCG.cpp
</ins><span class="cx">     platform/graphics/cg/ImageSourceCG.cpp
</span><span class="cx">     platform/graphics/cg/ImageSourceCGMac.mm
</span><span class="cx">     platform/graphics/cg/IntPointCG.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (198848 => 198849)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-03-30 18:31:47 UTC (rev 198848)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-03-30 19:10:18 UTC (rev 198849)
</span><span class="lines">@@ -2267,6 +2267,8 @@
</span><span class="cx">                 53EF766C16531994004CBE49 /* SettingsMacros.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 53EF766A16530A61004CBE49 /* SettingsMacros.h */; };
</span><span class="cx">                 550A0BC9085F6039007353D6 /* QualifiedName.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 550A0BC7085F6039007353D6 /* QualifiedName.cpp */; };
</span><span class="cx">                 550A0BCA085F6039007353D6 /* QualifiedName.h in Headers */ = {isa = PBXBuildFile; fileRef = 550A0BC8085F6039007353D6 /* QualifiedName.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                555B87EC1CAAF0AB00349425 /* ImageDecoderCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 555B87EA1CAAF0AB00349425 /* ImageDecoderCG.cpp */; };
+                555B87ED1CAAF0AB00349425 /* ImageDecoderCG.h in Headers */ = {isa = PBXBuildFile; fileRef = 555B87EB1CAAF0AB00349425 /* ImageDecoderCG.h */; };
</ins><span class="cx">                 572A7F211C6E5719009C6149 /* SimulatedClick.h in Headers */ = {isa = PBXBuildFile; fileRef = 572A7F201C6E5719009C6149 /* SimulatedClick.h */; };
</span><span class="cx">                 572A7F231C6E5A66009C6149 /* SimulatedClick.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 572A7F221C6E5A66009C6149 /* SimulatedClick.cpp */; };
</span><span class="cx">                 580371611A66F00A00BAF519 /* ClipRect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5803715F1A66F00A00BAF519 /* ClipRect.cpp */; };
</span><span class="lines">@@ -9831,6 +9833,8 @@
</span><span class="cx">                 53EF766A16530A61004CBE49 /* SettingsMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SettingsMacros.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 550A0BC7085F6039007353D6 /* QualifiedName.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = QualifiedName.cpp; sourceTree = &quot;&lt;group&gt;&quot;; tabWidth = 8; usesTabs = 0; };
</span><span class="cx">                 550A0BC8085F6039007353D6 /* QualifiedName.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = QualifiedName.h; sourceTree = &quot;&lt;group&gt;&quot;; tabWidth = 8; usesTabs = 0; };
</span><ins>+                555B87EA1CAAF0AB00349425 /* ImageDecoderCG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ImageDecoderCG.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                555B87EB1CAAF0AB00349425 /* ImageDecoderCG.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageDecoderCG.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 55D408F71A7C631800C78450 /* SVGImageClients.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGImageClients.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 572A7F201C6E5719009C6149 /* SimulatedClick.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimulatedClick.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 572A7F221C6E5A66009C6149 /* SimulatedClick.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SimulatedClick.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -21771,6 +21775,8 @@
</span><span class="cx">                                 2292B27B1356669400CF11EF /* ImageBufferDataCG.cpp */,
</span><span class="cx">                                 22BD9F80135364FE009BD102 /* ImageBufferDataCG.h */,
</span><span class="cx">                                 B27535300B053814002CE64F /* ImageCG.cpp */,
</span><ins>+                                555B87EA1CAAF0AB00349425 /* ImageDecoderCG.cpp */,
+                                555B87EB1CAAF0AB00349425 /* ImageDecoderCG.h */,
</ins><span class="cx">                                 B27535310B053814002CE64F /* ImageSourceCG.cpp */,
</span><span class="cx">                                 4B3480920EEF50D400AC1B41 /* ImageSourceCG.h */,
</span><span class="cx">                                 4B3480910EEF50D400AC1B41 /* ImageSourceCGMac.mm */,
</span><span class="lines">@@ -26271,6 +26277,7 @@
</span><span class="cx">                                 5185FC8D1BB4C4E80012898F /* IDBFactory.h in Headers */,
</span><span class="cx">                                 69A6CBAD1C6BE42C00B836E9 /* AccessibilitySVGElement.h in Headers */,
</span><span class="cx">                                 5185FC8F1BB4C4E80012898F /* IDBGetResult.h in Headers */,
</span><ins>+                                555B87ED1CAAF0AB00349425 /* ImageDecoderCG.h in Headers */,
</ins><span class="cx">                                 5185FC911BB4C4E80012898F /* IDBIndex.h in Headers */,
</span><span class="cx">                                 51F798F01BE880E7008AE491 /* IDBIndexInfo.h in Headers */,
</span><span class="cx">                                 5185FC951BB4C4E80012898F /* IDBKey.h in Headers */,
</span><span class="lines">@@ -31259,6 +31266,7 @@
</span><span class="cx">                                 99CC0B5918BE984A006CEBCC /* ReplaySession.cpp in Sources */,
</span><span class="cx">                                 99CC0B5B18BE984A006CEBCC /* ReplaySessionSegment.cpp in Sources */,
</span><span class="cx">                                 F55B3DCF1251F12D003EF269 /* ResetInputType.cpp in Sources */,
</span><ins>+                                555B87EC1CAAF0AB00349425 /* ImageDecoderCG.cpp in Sources */,
</ins><span class="cx">                                 934F713E0D5A6F2800018D69 /* ResourceErrorBase.cpp in Sources */,
</span><span class="cx">                                 7EE6846B12D26E3800E79415 /* ResourceErrorCF.cpp in Sources */,
</span><span class="cx">                                 514C76500CE9234E007EF3CD /* ResourceErrorMac.mm in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgImageDecoderCGcppfromrev198848trunkSourceWebCoreplatformgraphicscgImageSourceCGcpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp (from rev 198848, trunk/Source/WebCore/platform/graphics/cg/ImageSourceCG.cpp) (0 => 198849)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp                                (rev 0)
+++ trunk/Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp        2016-03-30 19:10:18 UTC (rev 198849)
</span><span class="lines">@@ -0,0 +1,410 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;ImageDecoderCG.h&quot;
+
+#if USE(CG)
+
+#include &quot;ImageOrientation.h&quot;
+#include &quot;IntPoint.h&quot;
+#include &quot;IntSize.h&quot;
+#include &quot;SharedBuffer.h&quot;
+#include &lt;wtf/NeverDestroyed.h&gt;
+
+#if !PLATFORM(IOS)
+#include &lt;ApplicationServices/ApplicationServices.h&gt;
+#else
+#include &quot;CoreGraphicsSPI.h&quot;
+#include &lt;ImageIO/ImageIO.h&gt;
+#endif
+
+#if USE(APPLE_INTERNAL_SDK)
+#import &lt;ImageIO/CGImageSourcePrivate.h&gt;
+#else
+const CFStringRef kCGImageSourceSubsampleFactor = CFSTR(&quot;kCGImageSourceSubsampleFactor&quot;);
+#endif
+
+namespace WebCore {
+
+const CFStringRef WebCoreCGImagePropertyAPNGUnclampedDelayTime = CFSTR(&quot;UnclampedDelayTime&quot;);
+const CFStringRef WebCoreCGImagePropertyAPNGDelayTime = CFSTR(&quot;DelayTime&quot;);
+const CFStringRef WebCoreCGImagePropertyAPNGLoopCount = CFSTR(&quot;LoopCount&quot;);
+
+const CFStringRef kCGImageSourceShouldPreferRGB32 = CFSTR(&quot;kCGImageSourceShouldPreferRGB32&quot;);
+const CFStringRef kCGImageSourceSkipMetadata = CFSTR(&quot;kCGImageSourceSkipMetadata&quot;);
+
+static RetainPtr&lt;CFDictionaryRef&gt; createImageSourceOptions(SubsamplingLevel subsamplingLevel)
+{
+    if (!subsamplingLevel) {
+        const unsigned numOptions = 3;
+        const void* keys[numOptions] = { kCGImageSourceShouldCache, kCGImageSourceShouldPreferRGB32, kCGImageSourceSkipMetadata };
+        const void* values[numOptions] = { kCFBooleanTrue, kCFBooleanTrue, kCFBooleanTrue };
+        return CFDictionaryCreate(nullptr, keys, values, numOptions, &amp;kCFTypeDictionaryKeyCallBacks, &amp;kCFTypeDictionaryValueCallBacks);
+    }
+    
+    short constrainedSubsamplingLevel = std::min&lt;short&gt;(3, std::max&lt;short&gt;(0, subsamplingLevel));
+    int subsampleInt = 1 &lt;&lt; constrainedSubsamplingLevel; // [0..3] =&gt; [1, 2, 4, 8]
+    
+    RetainPtr&lt;CFNumberRef&gt; subsampleNumber = adoptCF(CFNumberCreate(nullptr,  kCFNumberIntType,  &amp;subsampleInt));
+    const CFIndex numOptions = 4;
+    const void* keys[numOptions] = { kCGImageSourceShouldCache, kCGImageSourceShouldPreferRGB32, kCGImageSourceSkipMetadata, kCGImageSourceSubsampleFactor };
+    const void* values[numOptions] = { kCFBooleanTrue, kCFBooleanTrue, kCFBooleanTrue, subsampleNumber.get() };
+    return adoptCF(CFDictionaryCreate(nullptr, keys, values, numOptions, &amp;kCFTypeDictionaryKeyCallBacks, &amp;kCFTypeDictionaryValueCallBacks));
+}
+
+static RetainPtr&lt;CFDictionaryRef&gt; imageSourceOptions(SubsamplingLevel subsamplingLevel = 0)
+{
+    if (subsamplingLevel)
+        return createImageSourceOptions(subsamplingLevel);
+    
+    static NeverDestroyed&lt;RetainPtr&lt;CFDictionaryRef&gt;&gt; options = createImageSourceOptions(0);
+    return options;
+}
+
+static ImageOrientation orientationFromProperties(CFDictionaryRef imageProperties)
+{
+    ASSERT(imageProperties);
+    CFNumberRef orientationProperty = (CFNumberRef)CFDictionaryGetValue(imageProperties, kCGImagePropertyOrientation);
+    if (!orientationProperty)
+        return ImageOrientation();
+    
+    int exifValue;
+    CFNumberGetValue(orientationProperty, kCFNumberIntType, &amp;exifValue);
+    return ImageOrientation::fromEXIFValue(exifValue);
+}
+
+#if !PLATFORM(COCOA)
+size_t sharedBufferGetBytesAtPosition(void* info, void* buffer, off_t position, size_t count)
+{
+    SharedBuffer* sharedBuffer = static_cast&lt;SharedBuffer*&gt;(info);
+    size_t sourceSize = sharedBuffer-&gt;size();
+    if (position &gt;= sourceSize)
+        return 0;
+    
+    const char* source = sharedBuffer-&gt;data() + position;
+    size_t amount = std::min&lt;size_t&gt;(count, sourceSize - position);
+    memcpy(buffer, source, amount);
+    return amount;
+}
+
+void sharedBufferRelease(void* info)
+{
+    SharedBuffer* sharedBuffer = static_cast&lt;SharedBuffer*&gt;(info);
+    sharedBuffer-&gt;deref();
+}
+#endif
+
+ImageDecoder::ImageDecoder()
+{
+    m_nativeDecoder = adoptCF(CGImageSourceCreateIncremental(nullptr));
+}
+
+SubsamplingLevel ImageDecoder::subsamplingLevelForScale(float scale, SubsamplingLevel maximumSubsamplingLevel)
+{
+    // There are four subsampling levels: 0 = 1x, 1 = 0.5x, 2 = 0.25x, 3 = 0.125x.
+    float clampedScale = std::max&lt;float&gt;(0.125, std::min&lt;float&gt;(1, scale));
+    SubsamplingLevel result = ceilf(log2f(1 / clampedScale));
+    ASSERT(result &gt;=0 &amp;&amp; result &lt;= 3);
+    return std::min(result, maximumSubsamplingLevel);
+}
+
+size_t ImageDecoder::bytesDecodedToDetermineProperties()
+{
+    // Measured by tracing malloc/calloc calls on Mac OS 10.6.6, x86_64.
+    // A non-zero value ensures cached images with no decoded frames still enter
+    // the live decoded resources list when the CGImageSource decodes image
+    // properties, allowing the cache to prune the partially decoded image.
+    // This value is likely to be inaccurate on other platforms, but the overall
+    // behavior is unchanged.
+    return 13088;
+}
+
+String ImageDecoder::filenameExtension() const
+{
+    CFStringRef imageSourceType = CGImageSourceGetType(m_nativeDecoder.get());
+    return WebCore::preferredExtensionForImageSourceType(imageSourceType);
+}
+
+bool ImageDecoder::isSizeAvailable() const
+{
+    // Ragnaros yells: TOO SOON! You have awakened me TOO SOON, Executus!
+    if (CGImageSourceGetStatus(m_nativeDecoder.get()) &lt; kCGImageStatusIncomplete)
+        return false;
+    
+    RetainPtr&lt;CFDictionaryRef&gt; image0Properties = adoptCF(CGImageSourceCopyPropertiesAtIndex(m_nativeDecoder.get(), 0, imageSourceOptions().get()));
+    if (!image0Properties)
+        return false;
+    
+    return CFDictionaryContainsKey(image0Properties.get(), kCGImagePropertyPixelWidth)
+    &amp;&amp; CFDictionaryContainsKey(image0Properties.get(), kCGImagePropertyPixelHeight);
+}
+
+IntSize ImageDecoder::size() const
+{
+    if (m_size.isEmpty())
+        m_size = frameSizeAtIndex(0, 0);
+    return m_size;
+}
+
+size_t ImageDecoder::frameCount() const
+{
+    return CGImageSourceGetCount(m_nativeDecoder.get());
+}
+
+int ImageDecoder::repetitionCount() const
+{
+    RetainPtr&lt;CFDictionaryRef&gt; properties = adoptCF(CGImageSourceCopyProperties(m_nativeDecoder.get(), imageSourceOptions().get()));
+    if (!properties)
+        return cAnimationLoopOnce;
+    
+    CFDictionaryRef gifProperties = (CFDictionaryRef)CFDictionaryGetValue(properties.get(), kCGImagePropertyGIFDictionary);
+    if (gifProperties) {
+        CFNumberRef num = (CFNumberRef)CFDictionaryGetValue(gifProperties, kCGImagePropertyGIFLoopCount);
+        
+        // No property means loop once.
+        if (!num)
+            return cAnimationLoopOnce;
+        
+        int loopCount;
+        CFNumberGetValue(num, kCFNumberIntType, &amp;loopCount);
+        
+        // A property with value 0 means loop forever.
+        return loopCount ? loopCount : cAnimationLoopInfinite;
+    }
+    
+    CFDictionaryRef pngProperties = (CFDictionaryRef)CFDictionaryGetValue(properties.get(), kCGImagePropertyPNGDictionary);
+    if (pngProperties) {
+        CFNumberRef num = (CFNumberRef)CFDictionaryGetValue(pngProperties, WebCoreCGImagePropertyAPNGLoopCount);
+        if (!num)
+            return cAnimationLoopOnce;
+        
+        int loopCount;
+        CFNumberGetValue(num, kCFNumberIntType, &amp;loopCount);
+        return loopCount ? loopCount : cAnimationLoopInfinite;
+    }
+    
+    // Turns out we're not an animated image after all, so we don't animate.
+    return cAnimationNone;
+}
+
+bool ImageDecoder::hotSpot(IntPoint&amp; hotSpot) const
+{
+    RetainPtr&lt;CFDictionaryRef&gt; properties = adoptCF(CGImageSourceCopyPropertiesAtIndex(m_nativeDecoder.get(), 0, imageSourceOptions().get()));
+    if (!properties)
+        return false;
+    
+    int x = -1, y = -1;
+    CFNumberRef num = (CFNumberRef)CFDictionaryGetValue(properties.get(), CFSTR(&quot;hotspotX&quot;));
+    if (!num || !CFNumberGetValue(num, kCFNumberIntType, &amp;x))
+        return false;
+    
+    num = (CFNumberRef)CFDictionaryGetValue(properties.get(), CFSTR(&quot;hotspotY&quot;));
+    if (!num || !CFNumberGetValue(num, kCFNumberIntType, &amp;y))
+        return false;
+    
+    if (x &lt; 0 || y &lt; 0)
+        return false;
+    
+    hotSpot = IntPoint(x, y);
+    return true;
+}
+
+IntSize ImageDecoder::frameSizeAtIndex(size_t index, SubsamplingLevel subsamplingLevel) const
+{
+    RetainPtr&lt;CFDictionaryRef&gt; properties = adoptCF(CGImageSourceCopyPropertiesAtIndex(m_nativeDecoder.get(), index, imageSourceOptions(subsamplingLevel).get()));
+    
+    if (!properties)
+        return { };
+    
+    int width = 0;
+    int height = 0;
+    CFNumberRef num = (CFNumberRef)CFDictionaryGetValue(properties.get(), kCGImagePropertyPixelWidth);
+    if (num)
+        CFNumberGetValue(num, kCFNumberIntType, &amp;width);
+    
+    num = (CFNumberRef)CFDictionaryGetValue(properties.get(), kCGImagePropertyPixelHeight);
+    if (num)
+        CFNumberGetValue(num, kCFNumberIntType, &amp;height);
+    
+    return IntSize(width, height);
+}
+
+bool ImageDecoder::frameIsCompleteAtIndex(size_t index) const
+{
+    ASSERT(frameCount());
+    return CGImageSourceGetStatusAtIndex(m_nativeDecoder.get(), index) == kCGImageStatusComplete;
+}
+
+ImageOrientation ImageDecoder::orientationAtIndex(size_t index) const
+{
+    RetainPtr&lt;CFDictionaryRef&gt; properties = adoptCF(CGImageSourceCopyPropertiesAtIndex(m_nativeDecoder.get(), index, imageSourceOptions().get()));
+    if (!properties)
+        return ImageOrientation();
+    
+    return orientationFromProperties(properties.get());
+}
+
+float ImageDecoder::frameDurationAtIndex(size_t index) const
+{
+    float duration = 0;
+    RetainPtr&lt;CFDictionaryRef&gt; properties = adoptCF(CGImageSourceCopyPropertiesAtIndex(m_nativeDecoder.get(), index, imageSourceOptions().get()));
+    if (properties) {
+        CFDictionaryRef gifProperties = (CFDictionaryRef)CFDictionaryGetValue(properties.get(), kCGImagePropertyGIFDictionary);
+        if (gifProperties) {
+            if (CFNumberRef num = (CFNumberRef)CFDictionaryGetValue(gifProperties, kCGImagePropertyGIFUnclampedDelayTime)) {
+                // Use the unclamped frame delay if it exists.
+                CFNumberGetValue(num, kCFNumberFloatType, &amp;duration);
+            } else if (CFNumberRef num = (CFNumberRef)CFDictionaryGetValue(gifProperties, kCGImagePropertyGIFDelayTime)) {
+                // Fall back to the clamped frame delay if the unclamped frame delay does not exist.
+                CFNumberGetValue(num, kCFNumberFloatType, &amp;duration);
+            }
+        }
+        
+        CFDictionaryRef pngProperties = (CFDictionaryRef)CFDictionaryGetValue(properties.get(), kCGImagePropertyPNGDictionary);
+        if (pngProperties) {
+            if (CFNumberRef num = (CFNumberRef)CFDictionaryGetValue(pngProperties, WebCoreCGImagePropertyAPNGUnclampedDelayTime))
+                CFNumberGetValue(num, kCFNumberFloatType, &amp;duration);
+            else if (CFNumberRef num = (CFNumberRef)CFDictionaryGetValue(pngProperties, WebCoreCGImagePropertyAPNGDelayTime))
+                CFNumberGetValue(num, kCFNumberFloatType, &amp;duration);
+        }
+    }
+    
+    // Many annoying ads specify a 0 duration to make an image flash as quickly as possible.
+    // We follow Firefox's behavior and use a duration of 100 ms for any frames that specify
+    // a duration of &lt;= 10 ms. See &lt;rdar://problem/7689300&gt; and &lt;http://webkit.org/b/36082&gt;
+    // for more information.
+    if (duration &lt; 0.011f)
+        return 0.1f;
+    return duration;
+}
+
+bool ImageDecoder::allowSubsamplingOfFrameAtIndex(size_t) const
+{
+    RetainPtr&lt;CFDictionaryRef&gt; properties = adoptCF(CGImageSourceCopyPropertiesAtIndex(m_nativeDecoder.get(), 0, imageSourceOptions().get()));
+    if (!properties)
+        return false;
+    
+    CFDictionaryRef jfifProperties = static_cast&lt;CFDictionaryRef&gt;(CFDictionaryGetValue(properties.get(), kCGImagePropertyJFIFDictionary));
+    if (jfifProperties) {
+        CFBooleanRef isProgCFBool = static_cast&lt;CFBooleanRef&gt;(CFDictionaryGetValue(jfifProperties, kCGImagePropertyJFIFIsProgressive));
+        if (isProgCFBool) {
+            bool isProgressive = CFBooleanGetValue(isProgCFBool);
+            // Workaround for &lt;rdar://problem/5184655&gt; - Hang rendering very large progressive JPEG. Decoding progressive
+            // images hangs for a very long time right now. Until this is fixed, don't sub-sample progressive images. This
+            // will cause them to fail our large image check and they won't be decoded.
+            // FIXME: Remove once underlying issue is fixed (&lt;rdar://problem/5191418&gt;)
+            return !isProgressive;
+        }
+    }
+    
+    return true;
+}
+
+bool ImageDecoder::frameHasAlphaAtIndex(size_t index) const
+{
+    if (!frameIsCompleteAtIndex(index))
+        return true;
+    
+    CFStringRef imageType = CGImageSourceGetType(m_nativeDecoder.get());
+    
+    // Return false if there is no image type or the image type is JPEG, because
+    // JPEG does not support alpha transparency.
+    if (!imageType || CFEqual(imageType, CFSTR(&quot;public.jpeg&quot;)))
+        return false;
+    
+    // FIXME: Could return false for other non-transparent image formats.
+    // FIXME: Could maybe return false for a GIF Frame if we have enough info in the GIF properties dictionary
+    // to determine whether or not a transparent color was defined.
+    return true;
+}
+
+unsigned ImageDecoder::frameBytesAtIndex(size_t index, SubsamplingLevel subsamplingLevel) const
+{
+    IntSize frameSize = frameSizeAtIndex(index, subsamplingLevel);
+    return frameSize.area() * 4;
+}
+
+NativeImagePtr ImageDecoder::createFrameImageAtIndex(size_t index, SubsamplingLevel subsamplingLevel) const
+{
+    RetainPtr&lt;CGImageRef&gt; image = adoptCF(CGImageSourceCreateImageAtIndex(m_nativeDecoder.get(), index, imageSourceOptions(subsamplingLevel).get()));
+    
+#if PLATFORM(IOS)
+    // &lt;rdar://problem/7371198&gt; - CoreGraphics changed the default caching behaviour in iOS 4.0 to kCGImageCachingTransient
+    // which caused a performance regression for us since the images had to be resampled/recreated every time we called
+    // CGContextDrawImage. We now tell CG to cache the drawn images. See also &lt;rdar://problem/14366755&gt; -
+    // CoreGraphics needs to un-deprecate kCGImageCachingTemporary since it's still not the default.
+#if COMPILER(CLANG)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored &quot;-Wdeprecated-declarations&quot;
+#endif
+    CGImageSetCachingFlags(image.get(), kCGImageCachingTemporary);
+#if COMPILER(CLANG)
+#pragma clang diagnostic pop
+#endif
+#endif // PLATFORM(IOS)
+    
+    CFStringRef imageUTI = CGImageSourceGetType(m_nativeDecoder.get());
+    static const CFStringRef xbmUTI = CFSTR(&quot;public.xbitmap-image&quot;);
+    
+    if (!imageUTI)
+        return image;
+    
+    if (!CFEqual(imageUTI, xbmUTI))
+        return image;
+    
+    // If it is an xbm image, mask out all the white areas to render them transparent.
+    const CGFloat maskingColors[6] = {255, 255,  255, 255, 255, 255};
+    RetainPtr&lt;CGImageRef&gt; maskedImage = adoptCF(CGImageCreateWithMaskingColors(image.get(), maskingColors));
+    return maskedImage ? maskedImage : image;
+}
+
+void ImageDecoder::setData(CFDataRef data, bool allDataReceived)
+{
+    CGImageSourceUpdateData(m_nativeDecoder.get(), data, allDataReceived);
+}
+
+void ImageDecoder::setData(SharedBuffer* data, bool allDataReceived)
+{
+#if PLATFORM(COCOA)
+    // On Mac the NSData inside the SharedBuffer can be secretly appended to without the SharedBuffer's knowledge.
+    // We use SharedBuffer's ability to wrap itself inside CFData to get around this, ensuring that ImageIO is
+    // really looking at the SharedBuffer.
+    setData(data-&gt;createCFData().get(), allDataReceived);
+#else
+    // Create a CGDataProvider to wrap the SharedBuffer.
+    data-&gt;ref();
+    // We use the GetBytesAtPosition callback rather than the GetBytePointer one because SharedBuffer
+    // does not provide a way to lock down the byte pointer and guarantee that it won't move, which
+    // is a requirement for using the GetBytePointer callback.
+    CGDataProviderDirectCallbacks providerCallbacks = { 0, 0, 0, sharedBufferGetBytesAtPosition, sharedBufferRelease };
+    RetainPtr&lt;CGDataProviderRef&gt; dataProvider = adoptCF(CGDataProviderCreateDirect(data, data-&gt;size(), &amp;providerCallbacks));
+    CGImageSourceUpdateDataProvider(m_nativeDecoder.get(), dataProvider.get(), allDataReceived);
+#endif
+}
+
+}
+
+#endif // USE(CG)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgImageDecoderCGh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/graphics/cg/ImageDecoderCG.h (0 => 198849)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/ImageDecoderCG.h                                (rev 0)
+++ trunk/Source/WebCore/platform/graphics/cg/ImageDecoderCG.h        2016-03-30 19:10:18 UTC (rev 198849)
</span><span class="lines">@@ -0,0 +1,76 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ImageDecoderCG_h
+#define ImageDecoderCG_h
+
+#include &quot;ImageSourceCG.h&quot;
+#include &quot;IntSize.h&quot;
+
+namespace WebCore {
+
+class ImageDecoder {
+public:
+    ImageDecoder();
+    
+    static std::unique_ptr&lt;ImageDecoder&gt; create()
+    {
+        return std::make_unique&lt;ImageDecoder&gt;();
+    }
+    
+    static size_t bytesDecodedToDetermineProperties();
+    static SubsamplingLevel subsamplingLevelForScale(float scale, SubsamplingLevel maximumSubsamplingLevel);
+    
+    String filenameExtension() const;
+    bool isSizeAvailable() const;
+    
+    // Always original size, without subsampling.
+    IntSize size() const;
+    size_t frameCount() const;
+    int repetitionCount() const;
+    bool hotSpot(IntPoint&amp; hotSpot) const;
+    
+    IntSize frameSizeAtIndex(size_t, SubsamplingLevel) const;
+    bool frameIsCompleteAtIndex(size_t) const;
+    ImageOrientation orientationAtIndex(size_t) const;
+    
+    float frameDurationAtIndex(size_t) const;
+    bool frameHasAlphaAtIndex(size_t) const;
+    bool allowSubsamplingOfFrameAtIndex(size_t) const;
+    unsigned frameBytesAtIndex(size_t, SubsamplingLevel = 0) const;
+    
+    NativeImagePtr createFrameImageAtIndex(size_t, SubsamplingLevel) const;
+    
+    void setData(CFDataRef, bool allDataReceived);
+    void setData(SharedBuffer*, bool allDataReceived);
+    
+protected:
+    mutable IntSize m_size;
+    RetainPtr&lt;CGImageSourceRef&gt; m_nativeDecoder;
+};
+
+}
+
+#endif // ImageDecoderCG_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgImageSourceCGcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/ImageSourceCG.cpp (198848 => 198849)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/ImageSourceCG.cpp        2016-03-30 18:31:47 UTC (rev 198848)
+++ trunk/Source/WebCore/platform/graphics/cg/ImageSourceCG.cpp        2016-03-30 19:10:18 UTC (rev 198849)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004, 2005, 2006, 2008, 2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -29,425 +29,12 @@
</span><span class="cx"> #if USE(CG)
</span><span class="cx"> #include &quot;ImageSourceCG.h&quot;
</span><span class="cx"> 
</span><del>-#include &quot;CoreGraphicsSPI.h&quot;
</del><ins>+#include &quot;ImageDecoderCG.h&quot;
</ins><span class="cx"> #include &quot;ImageOrientation.h&quot;
</span><del>-#include &quot;IntPoint.h&quot;
-#include &quot;IntSize.h&quot;
-#include &quot;MIMETypeRegistry.h&quot;
</del><span class="cx"> #include &quot;SharedBuffer.h&quot;
</span><del>-#include &lt;wtf/NeverDestroyed.h&gt;
</del><span class="cx"> 
</span><del>-#if !PLATFORM(IOS)
-#include &lt;ApplicationServices/ApplicationServices.h&gt;
-#else
-#include &lt;ImageIO/ImageIO.h&gt;
-#include &lt;wtf/RetainPtr.h&gt;
-#endif
-
-#if USE(APPLE_INTERNAL_SDK)
-#import &lt;ImageIO/CGImageSourcePrivate.h&gt;
-#else
-const CFStringRef kCGImageSourceSubsampleFactor = CFSTR(&quot;kCGImageSourceSubsampleFactor&quot;);
-#endif
-
</del><span class="cx"> namespace WebCore {
</span><del>-    
-class ImageDecoder {
-public:
-    ImageDecoder();
-    
-    static std::unique_ptr&lt;ImageDecoder&gt; create()
-    {
-        return std::make_unique&lt;ImageDecoder&gt;();
-    }
</del><span class="cx"> 
</span><del>-    static size_t bytesDecodedToDetermineProperties();
-    static SubsamplingLevel subsamplingLevelForScale(float scale, SubsamplingLevel maximumSubsamplingLevel);
-
-    String filenameExtension() const;
-    bool isSizeAvailable() const;
-    
-    // Always original size, without subsampling.
-    IntSize size() const;
-    size_t frameCount() const;
-    int repetitionCount() const;
-    bool hotSpot(IntPoint&amp; hotSpot) const;
-
-    IntSize frameSizeAtIndex(size_t, SubsamplingLevel) const;
-    bool frameIsCompleteAtIndex(size_t) const;
-    ImageOrientation orientationAtIndex(size_t) const;
-
-    float frameDurationAtIndex(size_t) const;
-    bool frameHasAlphaAtIndex(size_t) const;
-    bool allowSubsamplingOfFrameAtIndex(size_t) const;
-    unsigned frameBytesAtIndex(size_t, SubsamplingLevel = 0) const;
-
-    NativeImagePtr createFrameImageAtIndex(size_t, SubsamplingLevel) const;
-
-    void setData(CFDataRef, bool allDataReceived);
-    void setData(SharedBuffer*, bool allDataReceived);
-
-protected:
-    mutable IntSize m_size;
-    RetainPtr&lt;CGImageSourceRef&gt; m_nativeDecoder;
-};
-
-const CFStringRef WebCoreCGImagePropertyAPNGUnclampedDelayTime = CFSTR(&quot;UnclampedDelayTime&quot;);
-const CFStringRef WebCoreCGImagePropertyAPNGDelayTime = CFSTR(&quot;DelayTime&quot;);
-const CFStringRef WebCoreCGImagePropertyAPNGLoopCount = CFSTR(&quot;LoopCount&quot;);
-
-const CFStringRef kCGImageSourceShouldPreferRGB32 = CFSTR(&quot;kCGImageSourceShouldPreferRGB32&quot;);
-const CFStringRef kCGImageSourceSkipMetadata = CFSTR(&quot;kCGImageSourceSkipMetadata&quot;);
-
-static RetainPtr&lt;CFDictionaryRef&gt; createImageSourceOptions(SubsamplingLevel subsamplingLevel)
-{
-    if (!subsamplingLevel) {
-        const unsigned numOptions = 3;
-        const void* keys[numOptions] = { kCGImageSourceShouldCache, kCGImageSourceShouldPreferRGB32, kCGImageSourceSkipMetadata };
-        const void* values[numOptions] = { kCFBooleanTrue, kCFBooleanTrue, kCFBooleanTrue };
-        return CFDictionaryCreate(nullptr, keys, values, numOptions, &amp;kCFTypeDictionaryKeyCallBacks, &amp;kCFTypeDictionaryValueCallBacks);
-    }
-
-    short constrainedSubsamplingLevel = std::min&lt;short&gt;(3, std::max&lt;short&gt;(0, subsamplingLevel));
-    int subsampleInt = 1 &lt;&lt; constrainedSubsamplingLevel; // [0..3] =&gt; [1, 2, 4, 8]
-
-    RetainPtr&lt;CFNumberRef&gt; subsampleNumber = adoptCF(CFNumberCreate(nullptr,  kCFNumberIntType,  &amp;subsampleInt));
-    const CFIndex numOptions = 4;
-    const void* keys[numOptions] = { kCGImageSourceShouldCache, kCGImageSourceShouldPreferRGB32, kCGImageSourceSkipMetadata, kCGImageSourceSubsampleFactor };
-    const void* values[numOptions] = { kCFBooleanTrue, kCFBooleanTrue, kCFBooleanTrue, subsampleNumber.get() };
-    return adoptCF(CFDictionaryCreate(nullptr, keys, values, numOptions, &amp;kCFTypeDictionaryKeyCallBacks, &amp;kCFTypeDictionaryValueCallBacks));
-}
-
-static RetainPtr&lt;CFDictionaryRef&gt; imageSourceOptions(SubsamplingLevel subsamplingLevel = 0)
-{
-    if (subsamplingLevel)
-        return createImageSourceOptions(subsamplingLevel);
-
-    static NeverDestroyed&lt;RetainPtr&lt;CFDictionaryRef&gt;&gt; options = createImageSourceOptions(0);
-    return options;
-}
-
-static ImageOrientation orientationFromProperties(CFDictionaryRef imageProperties)
-{
-    ASSERT(imageProperties);
-    CFNumberRef orientationProperty = (CFNumberRef)CFDictionaryGetValue(imageProperties, kCGImagePropertyOrientation);
-    if (!orientationProperty)
-        return ImageOrientation();
-
-    int exifValue;
-    CFNumberGetValue(orientationProperty, kCFNumberIntType, &amp;exifValue);
-    return ImageOrientation::fromEXIFValue(exifValue);
-}
-
-#if !PLATFORM(COCOA)
-size_t sharedBufferGetBytesAtPosition(void* info, void* buffer, off_t position, size_t count)
-{
-    SharedBuffer* sharedBuffer = static_cast&lt;SharedBuffer*&gt;(info);
-    size_t sourceSize = sharedBuffer-&gt;size();
-    if (position &gt;= sourceSize)
-        return 0;
-
-    const char* source = sharedBuffer-&gt;data() + position;
-    size_t amount = std::min&lt;size_t&gt;(count, sourceSize - position);
-    memcpy(buffer, source, amount);
-    return amount;
-}
-
-void sharedBufferRelease(void* info)
-{
-    SharedBuffer* sharedBuffer = static_cast&lt;SharedBuffer*&gt;(info);
-    sharedBuffer-&gt;deref();
-}
-#endif
-    
-ImageDecoder::ImageDecoder()
-{
-    m_nativeDecoder = adoptCF(CGImageSourceCreateIncremental(nullptr));
-}
-    
-SubsamplingLevel ImageDecoder::subsamplingLevelForScale(float scale, SubsamplingLevel maximumSubsamplingLevel)
-{
-    // There are four subsampling levels: 0 = 1x, 1 = 0.5x, 2 = 0.25x, 3 = 0.125x.
-    float clampedScale = std::max&lt;float&gt;(0.125, std::min&lt;float&gt;(1, scale));
-    SubsamplingLevel result = ceilf(log2f(1 / clampedScale));
-    ASSERT(result &gt;=0 &amp;&amp; result &lt;= 3);
-    return std::min(result, maximumSubsamplingLevel);
-}
-
-size_t ImageDecoder::bytesDecodedToDetermineProperties()
-{
-    // Measured by tracing malloc/calloc calls on Mac OS 10.6.6, x86_64.
-    // A non-zero value ensures cached images with no decoded frames still enter
-    // the live decoded resources list when the CGImageSource decodes image
-    // properties, allowing the cache to prune the partially decoded image.
-    // This value is likely to be inaccurate on other platforms, but the overall
-    // behavior is unchanged.
-    return 13088;
-}
-    
-String ImageDecoder::filenameExtension() const
-{
-    CFStringRef imageSourceType = CGImageSourceGetType(m_nativeDecoder.get());
-    return WebCore::preferredExtensionForImageSourceType(imageSourceType);
-}
-
-bool ImageDecoder::isSizeAvailable() const
-{
-    // Ragnaros yells: TOO SOON! You have awakened me TOO SOON, Executus!
-    if (CGImageSourceGetStatus(m_nativeDecoder.get()) &lt; kCGImageStatusIncomplete)
-        return false;
-
-    RetainPtr&lt;CFDictionaryRef&gt; image0Properties = adoptCF(CGImageSourceCopyPropertiesAtIndex(m_nativeDecoder.get(), 0, imageSourceOptions().get()));
-    if (!image0Properties)
-        return false;
-
-    return CFDictionaryContainsKey(image0Properties.get(), kCGImagePropertyPixelWidth)
-        &amp;&amp; CFDictionaryContainsKey(image0Properties.get(), kCGImagePropertyPixelHeight);
-}
-
-IntSize ImageDecoder::size() const
-{
-    if (m_size.isEmpty())
-        m_size = frameSizeAtIndex(0, 0);
-    return m_size;
-}
-
-size_t ImageDecoder::frameCount() const
-{
-    return CGImageSourceGetCount(m_nativeDecoder.get());
-}
-
-int ImageDecoder::repetitionCount() const
-{
-    RetainPtr&lt;CFDictionaryRef&gt; properties = adoptCF(CGImageSourceCopyProperties(m_nativeDecoder.get(), imageSourceOptions().get()));
-    if (!properties)
-        return cAnimationLoopOnce;
-
-    CFDictionaryRef gifProperties = (CFDictionaryRef)CFDictionaryGetValue(properties.get(), kCGImagePropertyGIFDictionary);
-    if (gifProperties) {
-        CFNumberRef num = (CFNumberRef)CFDictionaryGetValue(gifProperties, kCGImagePropertyGIFLoopCount);
-
-        // No property means loop once.
-        if (!num)
-            return cAnimationLoopOnce;
-
-        int loopCount;
-        CFNumberGetValue(num, kCFNumberIntType, &amp;loopCount);
-
-        // A property with value 0 means loop forever.
-        return loopCount ? loopCount : cAnimationLoopInfinite;
-    }
-
-    CFDictionaryRef pngProperties = (CFDictionaryRef)CFDictionaryGetValue(properties.get(), kCGImagePropertyPNGDictionary);
-    if (pngProperties) {
-        CFNumberRef num = (CFNumberRef)CFDictionaryGetValue(pngProperties, WebCoreCGImagePropertyAPNGLoopCount);
-        if (!num)
-            return cAnimationLoopOnce;
-
-        int loopCount;
-        CFNumberGetValue(num, kCFNumberIntType, &amp;loopCount);
-        return loopCount ? loopCount : cAnimationLoopInfinite;
-    }
-
-    // Turns out we're not an animated image after all, so we don't animate.
-    return cAnimationNone;
-}
-
-bool ImageDecoder::hotSpot(IntPoint&amp; hotSpot) const
-{
-    RetainPtr&lt;CFDictionaryRef&gt; properties = adoptCF(CGImageSourceCopyPropertiesAtIndex(m_nativeDecoder.get(), 0, imageSourceOptions().get()));
-    if (!properties)
-        return false;
-
-    int x = -1, y = -1;
-    CFNumberRef num = (CFNumberRef)CFDictionaryGetValue(properties.get(), CFSTR(&quot;hotspotX&quot;));
-    if (!num || !CFNumberGetValue(num, kCFNumberIntType, &amp;x))
-        return false;
-
-    num = (CFNumberRef)CFDictionaryGetValue(properties.get(), CFSTR(&quot;hotspotY&quot;));
-    if (!num || !CFNumberGetValue(num, kCFNumberIntType, &amp;y))
-        return false;
-
-    if (x &lt; 0 || y &lt; 0)
-        return false;
-
-    hotSpot = IntPoint(x, y);
-    return true;
-}
-
-IntSize ImageDecoder::frameSizeAtIndex(size_t index, SubsamplingLevel subsamplingLevel) const
-{
-    RetainPtr&lt;CFDictionaryRef&gt; properties = adoptCF(CGImageSourceCopyPropertiesAtIndex(m_nativeDecoder.get(), index, imageSourceOptions(subsamplingLevel).get()));
-
-    if (!properties)
-        return { };
-
-    int width = 0;
-    int height = 0;
-    CFNumberRef num = (CFNumberRef)CFDictionaryGetValue(properties.get(), kCGImagePropertyPixelWidth);
-    if (num)
-        CFNumberGetValue(num, kCFNumberIntType, &amp;width);
-
-    num = (CFNumberRef)CFDictionaryGetValue(properties.get(), kCGImagePropertyPixelHeight);
-    if (num)
-        CFNumberGetValue(num, kCFNumberIntType, &amp;height);
-
-    return IntSize(width, height);
-}
-
-bool ImageDecoder::frameIsCompleteAtIndex(size_t index) const
-{
-    ASSERT(frameCount());
-    return CGImageSourceGetStatusAtIndex(m_nativeDecoder.get(), index) == kCGImageStatusComplete;
-}
-
-ImageOrientation ImageDecoder::orientationAtIndex(size_t index) const
-{
-    RetainPtr&lt;CFDictionaryRef&gt; properties = adoptCF(CGImageSourceCopyPropertiesAtIndex(m_nativeDecoder.get(), index, imageSourceOptions().get()));
-    if (!properties)
-        return ImageOrientation();
-
-    return orientationFromProperties(properties.get());
-}
-
-float ImageDecoder::frameDurationAtIndex(size_t index) const
-{
-    float duration = 0;
-    RetainPtr&lt;CFDictionaryRef&gt; properties = adoptCF(CGImageSourceCopyPropertiesAtIndex(m_nativeDecoder.get(), index, imageSourceOptions().get()));
-    if (properties) {
-        CFDictionaryRef gifProperties = (CFDictionaryRef)CFDictionaryGetValue(properties.get(), kCGImagePropertyGIFDictionary);
-        if (gifProperties) {
-            if (CFNumberRef num = (CFNumberRef)CFDictionaryGetValue(gifProperties, kCGImagePropertyGIFUnclampedDelayTime)) {
-                // Use the unclamped frame delay if it exists.
-                CFNumberGetValue(num, kCFNumberFloatType, &amp;duration);
-            } else if (CFNumberRef num = (CFNumberRef)CFDictionaryGetValue(gifProperties, kCGImagePropertyGIFDelayTime)) {
-                // Fall back to the clamped frame delay if the unclamped frame delay does not exist.
-                CFNumberGetValue(num, kCFNumberFloatType, &amp;duration);
-            }
-        }
-
-        CFDictionaryRef pngProperties = (CFDictionaryRef)CFDictionaryGetValue(properties.get(), kCGImagePropertyPNGDictionary);
-        if (pngProperties) {
-            if (CFNumberRef num = (CFNumberRef)CFDictionaryGetValue(pngProperties, WebCoreCGImagePropertyAPNGUnclampedDelayTime))
-                CFNumberGetValue(num, kCFNumberFloatType, &amp;duration);
-            else if (CFNumberRef num = (CFNumberRef)CFDictionaryGetValue(pngProperties, WebCoreCGImagePropertyAPNGDelayTime))
-                CFNumberGetValue(num, kCFNumberFloatType, &amp;duration);
-        }
-    }
-
-    // Many annoying ads specify a 0 duration to make an image flash as quickly as possible.
-    // We follow Firefox's behavior and use a duration of 100 ms for any frames that specify
-    // a duration of &lt;= 10 ms. See &lt;rdar://problem/7689300&gt; and &lt;http://webkit.org/b/36082&gt;
-    // for more information.
-    if (duration &lt; 0.011f)
-        return 0.1f;
-    return duration;
-}
-
-bool ImageDecoder::allowSubsamplingOfFrameAtIndex(size_t) const
-{
-    RetainPtr&lt;CFDictionaryRef&gt; properties = adoptCF(CGImageSourceCopyPropertiesAtIndex(m_nativeDecoder.get(), 0, imageSourceOptions().get()));
-    if (!properties)
-        return false;
-
-    CFDictionaryRef jfifProperties = static_cast&lt;CFDictionaryRef&gt;(CFDictionaryGetValue(properties.get(), kCGImagePropertyJFIFDictionary));
-    if (jfifProperties) {
-        CFBooleanRef isProgCFBool = static_cast&lt;CFBooleanRef&gt;(CFDictionaryGetValue(jfifProperties, kCGImagePropertyJFIFIsProgressive));
-        if (isProgCFBool) {
-            bool isProgressive = CFBooleanGetValue(isProgCFBool);
-            // Workaround for &lt;rdar://problem/5184655&gt; - Hang rendering very large progressive JPEG. Decoding progressive
-            // images hangs for a very long time right now. Until this is fixed, don't sub-sample progressive images. This
-            // will cause them to fail our large image check and they won't be decoded.
-            // FIXME: Remove once underlying issue is fixed (&lt;rdar://problem/5191418&gt;)
-            return !isProgressive;
-        }
-    }
-
-    return true;
-}
-
-bool ImageDecoder::frameHasAlphaAtIndex(size_t index) const
-{
-    if (!frameIsCompleteAtIndex(index))
-        return true;
-
-    CFStringRef imageType = CGImageSourceGetType(m_nativeDecoder.get());
-
-    // Return false if there is no image type or the image type is JPEG, because
-    // JPEG does not support alpha transparency.
-    if (!imageType || CFEqual(imageType, CFSTR(&quot;public.jpeg&quot;)))
-        return false;
-
-    // FIXME: Could return false for other non-transparent image formats.
-    // FIXME: Could maybe return false for a GIF Frame if we have enough info in the GIF properties dictionary
-    // to determine whether or not a transparent color was defined.
-    return true;
-}
-
-unsigned ImageDecoder::frameBytesAtIndex(size_t index, SubsamplingLevel subsamplingLevel) const
-{
-    IntSize frameSize = frameSizeAtIndex(index, subsamplingLevel);
-    return frameSize.area() * 4;
-}
-
-NativeImagePtr ImageDecoder::createFrameImageAtIndex(size_t index, SubsamplingLevel subsamplingLevel) const
-{
-    RetainPtr&lt;CGImageRef&gt; image = adoptCF(CGImageSourceCreateImageAtIndex(m_nativeDecoder.get(), index, imageSourceOptions(subsamplingLevel).get()));
-
-#if PLATFORM(IOS)
-    // &lt;rdar://problem/7371198&gt; - CoreGraphics changed the default caching behaviour in iOS 4.0 to kCGImageCachingTransient
-    // which caused a performance regression for us since the images had to be resampled/recreated every time we called
-    // CGContextDrawImage. We now tell CG to cache the drawn images. See also &lt;rdar://problem/14366755&gt; -
-    // CoreGraphics needs to un-deprecate kCGImageCachingTemporary since it's still not the default.
-#if COMPILER(CLANG)
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored &quot;-Wdeprecated-declarations&quot;
-#endif
-        CGImageSetCachingFlags(image.get(), kCGImageCachingTemporary);
-#if COMPILER(CLANG)
-#pragma clang diagnostic pop
-#endif
-#endif // PLATFORM(IOS)
-
-    CFStringRef imageUTI = CGImageSourceGetType(m_nativeDecoder.get());
-    static const CFStringRef xbmUTI = CFSTR(&quot;public.xbitmap-image&quot;);
-
-    if (!imageUTI)
-        return image;
-
-    if (!CFEqual(imageUTI, xbmUTI))
-        return image;
-
-    // If it is an xbm image, mask out all the white areas to render them transparent.
-    const CGFloat maskingColors[6] = {255, 255,  255, 255, 255, 255};
-    RetainPtr&lt;CGImageRef&gt; maskedImage = adoptCF(CGImageCreateWithMaskingColors(image.get(), maskingColors));
-    return maskedImage ? maskedImage : image;
-}
-
-void ImageDecoder::setData(CFDataRef data, bool allDataReceived)
-{
-    CGImageSourceUpdateData(m_nativeDecoder.get(), data, allDataReceived);
-}
-
-void ImageDecoder::setData(SharedBuffer* data, bool allDataReceived)
-{
-#if PLATFORM(COCOA)
-    // On Mac the NSData inside the SharedBuffer can be secretly appended to without the SharedBuffer's knowledge.
-    // We use SharedBuffer's ability to wrap itself inside CFData to get around this, ensuring that ImageIO is
-    // really looking at the SharedBuffer.
-    setData(data-&gt;createCFData().get(), allDataReceived);
-#else
-    // Create a CGDataProvider to wrap the SharedBuffer.
-    data-&gt;ref();
-    // We use the GetBytesAtPosition callback rather than the GetBytePointer one because SharedBuffer
-    // does not provide a way to lock down the byte pointer and guarantee that it won't move, which
-    // is a requirement for using the GetBytePointer callback.
-    CGDataProviderDirectCallbacks providerCallbacks = { 0, 0, 0, sharedBufferGetBytesAtPosition, sharedBufferRelease };
-    RetainPtr&lt;CGDataProviderRef&gt; dataProvider = adoptCF(CGDataProviderCreateDirect(data, data-&gt;size(), &amp;providerCallbacks));
-    CGImageSourceUpdateDataProvider(m_nativeDecoder.get(), dataProvider.get(), allDataReceived);
-#endif
-}
-
</del><span class="cx"> ImageSource::ImageSource(ImageSource::AlphaOption, ImageSource::GammaAndColorProfileOption)
</span><span class="cx"> {
</span><span class="cx">     // FIXME: AlphaOption and GammaAndColorProfileOption are ignored.
</span></span></pre>
</div>
</div>

</body>
</html>