<!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>[205682] trunk/Source</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/205682">205682</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-09-08 18:06:47 -0700 (Thu, 08 Sep 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Move the BitmapImage platform dependent code to a new file named NativeImage[CG|Cairo].cpp
https://bugs.webkit.org/show_bug.cgi?id=158684
Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2016-09-08
Reviewed by Simon Fraser.
Source/WebCore:
This is a refactoring patch. It moves the BitmapImage platform dependent
code from BitmapImage to NativeImage[CG|Cairo].cpp. The new APIs are
responsible of drawing a NativeImagePtr and answering some metadata queries.
No new tests -- Code refactoring, no behavior change.
* PlatformAppleWin.cmake:
* PlatformEfl.cmake:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* PlatformWinCairo.cmake:
* WebCore.xcodeproj/project.pbxproj:
* loader/cache/MemoryCache.h:
* loader/icon/IconDatabaseBase.h:
* page/mac/TextIndicatorWindow.mm:
(-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]):
(createContentCrossfadeAnimation):
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::BitmapImage):
(WebCore::BitmapImage::destroyDecodedData):
(WebCore::BitmapImage::destroyDecodedDataIfNecessary):
(WebCore::BitmapImage::dataChanged):
(WebCore::BitmapImage::ensureFrameAtIndexIsCached):
(WebCore::BitmapImage::frameImageAtIndex):
(WebCore::BitmapImage::nativeImage):
(WebCore::BitmapImage::nativeImageForCurrentFrame):
(WebCore::BitmapImage::nativeImageOfSize):
(WebCore::BitmapImage::framesNativeImages):
(WebCore::BitmapImage::frameIsCompleteAtIndex):
(WebCore::BitmapImage::frameDurationAtIndex):
(WebCore::BitmapImage::frameHasAlphaAtIndex):
(WebCore::BitmapImage::frameOrientationAtIndex):
(WebCore::BitmapImage::singlePixelSolidColor):
(WebCore::BitmapImage::draw):
(WebCore::BitmapImage::drawPattern):
(WebCore::BitmapImage::canAnimate):
(WebCore::BitmapImage::clearTimer):
(WebCore::BitmapImage::startTimer):
(WebCore::BitmapImage::stopAnimation):
(WebCore::BitmapImage::resetAnimation):
(WebCore::BitmapImage::hasSingleSecurityOrigin): Deleted.
(WebCore::BitmapImage::filenameExtension): Deleted.
(WebCore::BitmapImage::ensureFrameIsCached): Deleted.
* platform/graphics/BitmapImage.h:
(WebCore::FrameData::FrameData):
m_hasAlpha can be initialized with false because it is accessed only in
BitmapImage::frameHasAlphaAtIndex() and it is guarded by m_haveMetadata.
Both m_haveMetadata and m_hasAlpha are set in BitmapImage constructor
and in BitmapImage::cacheFrame().
(WebCore::FrameData::~FrameData):
(WebCore::FrameData::clear):
* platform/graphics/Icon.h:
* platform/graphics/Image.h:
(WebCore::Image::nativeImage):
(WebCore::Image::nativeImageOfSize):
(WebCore::Image::framesNativeImages):
(WebCore::Image::orientationForCurrentFrame): Deleted.
(WebCore::Image::getCGImageRef): Deleted.
(WebCore::Image::getFirstCGImageRefOfSize): Deleted.
(WebCore::Image::getCGImageArray): Deleted.
* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::calculateMaximumSubsamplingLevel):
(WebCore::ImageSource::size):
(WebCore::ImageSource::sizeRespectingOrientation):
* platform/graphics/ImageSource.h:
* platform/graphics/MediaPlayer.h:
* platform/graphics/NativeImage.h: Added.
* platform/graphics/NativeImagePtr.h: Removed.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updatePausedImage):
* platform/graphics/cairo/BitmapImageCairo.cpp: Removed.
* platform/graphics/cairo/NativeImageCairo.cpp: Added.
(WebCore::nativeImageSize):
(WebCore::nativeImageHasAlpha):
(WebCore::nativeImageSinglePixelSolidColor):
(WebCore::subsamplingScale):
(WebCore::drawNativeImage):
(WebCore::clearNativeImageSubImages):
* platform/graphics/cg/BitmapImageCG.cpp: Removed.
* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::ImageDecoder::size):
* platform/graphics/cg/ImageDecoderCG.h:
* platform/graphics/cg/NativeImageCG.cpp: Added.
(WebCore::nativeImageSize):
(WebCore::nativeImageHasAlpha):
(WebCore::nativeImageSinglePixelSolidColor):
(WebCore::subsamplingScale):
(WebCore::drawNativeImage):
(WebCore::clearNativeImageSubImages):
* platform/graphics/cg/PatternCG.cpp:
(WebCore::Pattern::createPlatformPattern):
* platform/graphics/cocoa/TextTrackRepresentationCocoa.mm:
(TextTrackRepresentationCocoa::update):
* platform/graphics/mac/ImageMac.mm:
(WebCore::BitmapImage::getTIFFRepresentation):
* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
(WebCore::MockRealtimeVideoSourceMac::updatePlatformLayer):
(WebCore::MockRealtimeVideoSourceMac::updateSampleBuffer):
* platform/win/DragImageCGWin.cpp:
(WebCore::createDragImageFromImage):
Source/WebKit/mac:
* DOM/DOM.mm:
(-[DOMNode getPreviewSnapshotImage:andRects:]):
* Misc/WebCache.mm:
(+[WebCache imageForURL:]):
Replace BitmapImage::getCGImageRef() with BitmapImage::nativeImage().
Source/WebKit2:
* UIProcess/API/C/cg/WKIconDatabaseCG.cpp:
(WKIconDatabaseTryGetCGImageForURL):
(WKIconDatabaseTryCopyCGImageArrayForURL):
It was the only place in the code which uses BitmapImage::getCGImageArray().
Call BitmapImage::framesNativeImages() instead and form the returned
Vector<NativeImagePtr> build the CFArrayRef.
* UIProcess/WebIconDatabase.h:
Include "NativeImage.h" instead of "NativeImagePtr.h".
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _presentationSnapshotForPreviewItemController:]):
* WebProcess/Plugins/PluginView.cpp:
(WebKit::isAlmostSolidColor):
Call BitmapImage::getCGImageRef() instead of calling BitmapImage::nativeImage().</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="#trunkSourceWebCorePlatformEflcmake">trunk/Source/WebCore/PlatformEfl.cmake</a></li>
<li><a href="#trunkSourceWebCorePlatformGTKcmake">trunk/Source/WebCore/PlatformGTK.cmake</a></li>
<li><a href="#trunkSourceWebCorePlatformMaccmake">trunk/Source/WebCore/PlatformMac.cmake</a></li>
<li><a href="#trunkSourceWebCorePlatformWinCairocmake">trunk/Source/WebCore/PlatformWinCairo.cmake</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreloadercacheMemoryCacheh">trunk/Source/WebCore/loader/cache/MemoryCache.h</a></li>
<li><a href="#trunkSourceWebCoreloadericonIconDatabaseBaseh">trunk/Source/WebCore/loader/icon/IconDatabaseBase.h</a></li>
<li><a href="#trunkSourceWebCorepagemacTextIndicatorWindowmm">trunk/Source/WebCore/page/mac/TextIndicatorWindow.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsBitmapImagecpp">trunk/Source/WebCore/platform/graphics/BitmapImage.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsBitmapImageh">trunk/Source/WebCore/platform/graphics/BitmapImage.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsIconh">trunk/Source/WebCore/platform/graphics/Icon.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsImageh">trunk/Source/WebCore/platform/graphics/Image.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsImageSourcecpp">trunk/Source/WebCore/platform/graphics/ImageSource.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsImageSourceh">trunk/Source/WebCore/platform/graphics/ImageSource.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsMediaPlayerh">trunk/Source/WebCore/platform/graphics/MediaPlayer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaStreamAVFObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm</a></li>
<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>
<li><a href="#trunkSourceWebCoreplatformgraphicscgPatternCGcpp">trunk/Source/WebCore/platform/graphics/cg/PatternCG.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscocoaTextTrackRepresentationCocoamm">trunk/Source/WebCore/platform/graphics/cocoa/TextTrackRepresentationCocoa.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacImageMacmm">trunk/Source/WebCore/platform/graphics/mac/ImageMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreammacMockRealtimeVideoSourceMacmm">trunk/Source/WebCore/platform/mediastream/mac/MockRealtimeVideoSourceMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformwinDragImageCGWincpp">trunk/Source/WebCore/platform/win/DragImageCGWin.cpp</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacDOMDOMmm">trunk/Source/WebKit/mac/DOM/DOM.mm</a></li>
<li><a href="#trunkSourceWebKitmacMiscWebCachemm">trunk/Source/WebKit/mac/Misc/WebCache.mm</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICcgWKIconDatabaseCGcpp">trunk/Source/WebKit2/UIProcess/API/C/cg/WKIconDatabaseCG.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebIconDatabaseh">trunk/Source/WebKit2/UIProcess/WebIconDatabase.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWKContentViewInteractionmm">trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessPluginsPluginViewcpp">trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformgraphicsNativeImageh">trunk/Source/WebCore/platform/graphics/NativeImage.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscairoNativeImageCairocpp">trunk/Source/WebCore/platform/graphics/cairo/NativeImageCairo.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgNativeImageCGcpp">trunk/Source/WebCore/platform/graphics/cg/NativeImageCG.cpp</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformgraphicsNativeImagePtrh">trunk/Source/WebCore/platform/graphics/NativeImagePtr.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscairoBitmapImageCairocpp">trunk/Source/WebCore/platform/graphics/cairo/BitmapImageCairo.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgBitmapImageCGcpp">trunk/Source/WebCore/platform/graphics/cg/BitmapImageCG.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (205681 => 205682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-09-09 00:55:43 UTC (rev 205681)
+++ trunk/Source/WebCore/ChangeLog        2016-09-09 01:06:47 UTC (rev 205682)
</span><span class="lines">@@ -1,3 +1,112 @@
</span><ins>+2016-09-08 Said Abou-Hallawa <sabouhallawa@apple.com>
+
+ Move the BitmapImage platform dependent code to a new file named NativeImage[CG|Cairo].cpp
+ https://bugs.webkit.org/show_bug.cgi?id=158684
+
+ Reviewed by Simon Fraser.
+
+ This is a refactoring patch. It moves the BitmapImage platform dependent
+ code from BitmapImage to NativeImage[CG|Cairo].cpp. The new APIs are
+ responsible of drawing a NativeImagePtr and answering some metadata queries.
+
+ No new tests -- Code refactoring, no behavior change.
+
+ * PlatformAppleWin.cmake:
+ * PlatformEfl.cmake:
+ * PlatformGTK.cmake:
+ * PlatformMac.cmake:
+ * PlatformWinCairo.cmake:
+ * WebCore.xcodeproj/project.pbxproj:
+ * loader/cache/MemoryCache.h:
+ * loader/icon/IconDatabaseBase.h:
+ * page/mac/TextIndicatorWindow.mm:
+ (-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]):
+ (createContentCrossfadeAnimation):
+ * platform/graphics/BitmapImage.cpp:
+ (WebCore::BitmapImage::BitmapImage):
+ (WebCore::BitmapImage::destroyDecodedData):
+ (WebCore::BitmapImage::destroyDecodedDataIfNecessary):
+ (WebCore::BitmapImage::dataChanged):
+ (WebCore::BitmapImage::ensureFrameAtIndexIsCached):
+ (WebCore::BitmapImage::frameImageAtIndex):
+ (WebCore::BitmapImage::nativeImage):
+ (WebCore::BitmapImage::nativeImageForCurrentFrame):
+ (WebCore::BitmapImage::nativeImageOfSize):
+ (WebCore::BitmapImage::framesNativeImages):
+ (WebCore::BitmapImage::frameIsCompleteAtIndex):
+ (WebCore::BitmapImage::frameDurationAtIndex):
+ (WebCore::BitmapImage::frameHasAlphaAtIndex):
+ (WebCore::BitmapImage::frameOrientationAtIndex):
+ (WebCore::BitmapImage::singlePixelSolidColor):
+ (WebCore::BitmapImage::draw):
+ (WebCore::BitmapImage::drawPattern):
+ (WebCore::BitmapImage::canAnimate):
+ (WebCore::BitmapImage::clearTimer):
+ (WebCore::BitmapImage::startTimer):
+ (WebCore::BitmapImage::stopAnimation):
+ (WebCore::BitmapImage::resetAnimation):
+ (WebCore::BitmapImage::hasSingleSecurityOrigin): Deleted.
+ (WebCore::BitmapImage::filenameExtension): Deleted.
+ (WebCore::BitmapImage::ensureFrameIsCached): Deleted.
+ * platform/graphics/BitmapImage.h:
+ (WebCore::FrameData::FrameData):
+ m_hasAlpha can be initialized with false because it is accessed only in
+ BitmapImage::frameHasAlphaAtIndex() and it is guarded by m_haveMetadata.
+ Both m_haveMetadata and m_hasAlpha are set in BitmapImage constructor
+ and in BitmapImage::cacheFrame().
+
+ (WebCore::FrameData::~FrameData):
+ (WebCore::FrameData::clear):
+ * platform/graphics/Icon.h:
+ * platform/graphics/Image.h:
+ (WebCore::Image::nativeImage):
+ (WebCore::Image::nativeImageOfSize):
+ (WebCore::Image::framesNativeImages):
+ (WebCore::Image::orientationForCurrentFrame): Deleted.
+ (WebCore::Image::getCGImageRef): Deleted.
+ (WebCore::Image::getFirstCGImageRefOfSize): Deleted.
+ (WebCore::Image::getCGImageArray): Deleted.
+ * platform/graphics/ImageSource.cpp:
+ (WebCore::ImageSource::calculateMaximumSubsamplingLevel):
+ (WebCore::ImageSource::size):
+ (WebCore::ImageSource::sizeRespectingOrientation):
+ * platform/graphics/ImageSource.h:
+ * platform/graphics/MediaPlayer.h:
+ * platform/graphics/NativeImage.h: Added.
+ * platform/graphics/NativeImagePtr.h: Removed.
+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
+ (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updatePausedImage):
+ * platform/graphics/cairo/BitmapImageCairo.cpp: Removed.
+ * platform/graphics/cairo/NativeImageCairo.cpp: Added.
+ (WebCore::nativeImageSize):
+ (WebCore::nativeImageHasAlpha):
+ (WebCore::nativeImageSinglePixelSolidColor):
+ (WebCore::subsamplingScale):
+ (WebCore::drawNativeImage):
+ (WebCore::clearNativeImageSubImages):
+ * platform/graphics/cg/BitmapImageCG.cpp: Removed.
+ * platform/graphics/cg/ImageDecoderCG.cpp:
+ (WebCore::ImageDecoder::size):
+ * platform/graphics/cg/ImageDecoderCG.h:
+ * platform/graphics/cg/NativeImageCG.cpp: Added.
+ (WebCore::nativeImageSize):
+ (WebCore::nativeImageHasAlpha):
+ (WebCore::nativeImageSinglePixelSolidColor):
+ (WebCore::subsamplingScale):
+ (WebCore::drawNativeImage):
+ (WebCore::clearNativeImageSubImages):
+ * platform/graphics/cg/PatternCG.cpp:
+ (WebCore::Pattern::createPlatformPattern):
+ * platform/graphics/cocoa/TextTrackRepresentationCocoa.mm:
+ (TextTrackRepresentationCocoa::update):
+ * platform/graphics/mac/ImageMac.mm:
+ (WebCore::BitmapImage::getTIFFRepresentation):
+ * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
+ (WebCore::MockRealtimeVideoSourceMac::updatePlatformLayer):
+ (WebCore::MockRealtimeVideoSourceMac::updateSampleBuffer):
+ * platform/win/DragImageCGWin.cpp:
+ (WebCore::createDragImageFromImage):
+
</ins><span class="cx"> 2016-09-08 Alex Christensen <achristensen@webkit.org>
</span><span class="cx">
</span><span class="cx"> URLParser: Parsing empty URLs with a base URL should return the base URL
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformAppleWincmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformAppleWin.cmake (205681 => 205682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformAppleWin.cmake        2016-09-09 00:55:43 UTC (rev 205681)
+++ trunk/Source/WebCore/PlatformAppleWin.cmake        2016-09-09 01:06:47 UTC (rev 205682)
</span><span class="lines">@@ -55,7 +55,6 @@
</span><span class="cx"> platform/graphics/ca/win/WebTiledBackingLayerWin.cpp
</span><span class="cx"> platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp
</span><span class="cx">
</span><del>- platform/graphics/cg/BitmapImageCG.cpp
</del><span class="cx"> platform/graphics/cg/ColorCG.cpp
</span><span class="cx"> platform/graphics/cg/FloatPointCG.cpp
</span><span class="cx"> platform/graphics/cg/FloatRectCG.cpp
</span><span class="lines">@@ -72,6 +71,7 @@
</span><span class="cx"> platform/graphics/cg/IntPointCG.cpp
</span><span class="cx"> platform/graphics/cg/IntRectCG.cpp
</span><span class="cx"> platform/graphics/cg/IntSizeCG.cpp
</span><ins>+ platform/graphics/cg/NativeImageCG.cpp
</ins><span class="cx"> platform/graphics/cg/PDFDocumentImage.cpp
</span><span class="cx"> platform/graphics/cg/PathCG.cpp
</span><span class="cx"> platform/graphics/cg/PatternCG.cpp
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformEflcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformEfl.cmake (205681 => 205682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformEfl.cmake        2016-09-09 00:55:43 UTC (rev 205681)
+++ trunk/Source/WebCore/PlatformEfl.cmake        2016-09-09 01:06:47 UTC (rev 205682)
</span><span class="lines">@@ -126,7 +126,6 @@
</span><span class="cx"> platform/graphics/PlatformDisplay.cpp
</span><span class="cx">
</span><span class="cx"> platform/graphics/cairo/BackingStoreBackendCairoImpl.cpp
</span><del>- platform/graphics/cairo/BitmapImageCairo.cpp
</del><span class="cx"> platform/graphics/cairo/CairoUtilities.cpp
</span><span class="cx"> platform/graphics/cairo/FontCairo.cpp
</span><span class="cx"> platform/graphics/cairo/FontCairoHarfbuzzNG.cpp
</span><span class="lines">@@ -135,6 +134,7 @@
</span><span class="cx"> platform/graphics/cairo/ImageBufferCairo.cpp
</span><span class="cx"> platform/graphics/cairo/ImageCairo.cpp
</span><span class="cx"> platform/graphics/cairo/IntRectCairo.cpp
</span><ins>+ platform/graphics/cairo/NativeImageCairo.cpp
</ins><span class="cx"> platform/graphics/cairo/PathCairo.cpp
</span><span class="cx"> platform/graphics/cairo/PatternCairo.cpp
</span><span class="cx"> platform/graphics/cairo/PlatformContextCairo.cpp
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformGTK.cmake (205681 => 205682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformGTK.cmake        2016-09-09 00:55:43 UTC (rev 205681)
+++ trunk/Source/WebCore/PlatformGTK.cmake        2016-09-09 01:06:47 UTC (rev 205682)
</span><span class="lines">@@ -105,7 +105,6 @@
</span><span class="cx">
</span><span class="cx"> platform/graphics/cairo/BackingStoreBackendCairoImpl.cpp
</span><span class="cx"> platform/graphics/cairo/BackingStoreBackendCairoX11.cpp
</span><del>- platform/graphics/cairo/BitmapImageCairo.cpp
</del><span class="cx"> platform/graphics/cairo/CairoUtilities.cpp
</span><span class="cx"> platform/graphics/cairo/FloatRectCairo.cpp
</span><span class="cx"> platform/graphics/cairo/FontCairo.cpp
</span><span class="lines">@@ -116,6 +115,7 @@
</span><span class="cx"> platform/graphics/cairo/ImageBufferCairo.cpp
</span><span class="cx"> platform/graphics/cairo/ImageCairo.cpp
</span><span class="cx"> platform/graphics/cairo/IntRectCairo.cpp
</span><ins>+ platform/graphics/cairo/NativeImageCairo.cpp
</ins><span class="cx"> platform/graphics/cairo/PathCairo.cpp
</span><span class="cx"> platform/graphics/cairo/PatternCairo.cpp
</span><span class="cx"> platform/graphics/cairo/PlatformContextCairo.cpp
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformMaccmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformMac.cmake (205681 => 205682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformMac.cmake        2016-09-09 00:55:43 UTC (rev 205681)
+++ trunk/Source/WebCore/PlatformMac.cmake        2016-09-09 01:06:47 UTC (rev 205682)
</span><span class="lines">@@ -385,7 +385,6 @@
</span><span class="cx"> platform/graphics/ca/cocoa/WebSystemBackdropLayer.mm
</span><span class="cx"> platform/graphics/ca/cocoa/WebTiledBackingLayer.mm
</span><span class="cx">
</span><del>- platform/graphics/cg/BitmapImageCG.cpp
</del><span class="cx"> platform/graphics/cg/ColorCG.cpp
</span><span class="cx"> platform/graphics/cg/FloatPointCG.cpp
</span><span class="cx"> platform/graphics/cg/FloatRectCG.cpp
</span><span class="lines">@@ -402,6 +401,7 @@
</span><span class="cx"> platform/graphics/cg/IntPointCG.cpp
</span><span class="cx"> platform/graphics/cg/IntRectCG.cpp
</span><span class="cx"> platform/graphics/cg/IntSizeCG.cpp
</span><ins>+ platform/graphics/cg/NativeImageCG.cpp
</ins><span class="cx"> platform/graphics/cg/PDFDocumentImage.cpp
</span><span class="cx"> platform/graphics/cg/PathCG.cpp
</span><span class="cx"> platform/graphics/cg/PatternCG.cpp
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformWinCairocmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformWinCairo.cmake (205681 => 205682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformWinCairo.cmake        2016-09-09 00:55:43 UTC (rev 205681)
+++ trunk/Source/WebCore/PlatformWinCairo.cmake        2016-09-09 01:06:47 UTC (rev 205682)
</span><span class="lines">@@ -21,7 +21,6 @@
</span><span class="cx"> platform/graphics/GLContext.cpp
</span><span class="cx"> platform/graphics/PlatformDisplay.cpp
</span><span class="cx">
</span><del>- platform/graphics/cairo/BitmapImageCairo.cpp
</del><span class="cx"> platform/graphics/cairo/CairoUtilities.cpp
</span><span class="cx"> platform/graphics/cairo/FloatRectCairo.cpp
</span><span class="cx"> platform/graphics/cairo/FontCairo.cpp
</span><span class="lines">@@ -31,6 +30,7 @@
</span><span class="cx"> platform/graphics/cairo/ImageBufferCairo.cpp
</span><span class="cx"> platform/graphics/cairo/ImageCairo.cpp
</span><span class="cx"> platform/graphics/cairo/IntRectCairo.cpp
</span><ins>+ platform/graphics/cairo/NativeImageCairo.cpp
</ins><span class="cx"> platform/graphics/cairo/PathCairo.cpp
</span><span class="cx"> platform/graphics/cairo/PatternCairo.cpp
</span><span class="cx"> platform/graphics/cairo/PlatformContextCairo.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (205681 => 205682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-09-09 00:55:43 UTC (rev 205681)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-09-09 01:06:47 UTC (rev 205682)
</span><span class="lines">@@ -1424,7 +1424,7 @@
</span><span class="cx">                 375CD232119D43C800A2A859 /* Hyphenation.h in Headers */ = {isa = PBXBuildFile; fileRef = 375CD231119D43C800A2A859 /* Hyphenation.h */; };
</span><span class="cx">                 376DCCE113B4F966002EBEFC /* TextRun.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 376DCCE013B4F966002EBEFC /* TextRun.cpp */; };
</span><span class="cx">                 3774ABA50FA21EB400AD7DE9 /* OverlapTestRequestClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 3774ABA30FA21EB400AD7DE9 /* OverlapTestRequestClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-                377A3A9015EFCE9B0059F5C7 /* BitmapImageCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 377A3A8F15EFCE9A0059F5C7 /* BitmapImageCG.cpp */; };
</del><ins>+                377A3A9015EFCE9B0059F5C7 /* NativeImageCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 377A3A8F15EFCE9A0059F5C7 /* NativeImageCG.cpp */; };
</ins><span class="cx">                 37919C230B7D188600A56998 /* PositionIterator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37919C210B7D188600A56998 /* PositionIterator.cpp */; };
</span><span class="cx">                 37919C240B7D188600A56998 /* PositionIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = 37919C220B7D188600A56998 /* PositionIterator.h */; settings = {ATTRIBUTES = (); }; };
</span><span class="cx">                 3792917A1985EF3900F4B661 /* CredentialBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 379291781985EF3900F4B661 /* CredentialBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -2274,6 +2274,7 @@
</span><span class="cx">                 550A0BCA085F6039007353D6 /* QualifiedName.h in Headers */ = {isa = PBXBuildFile; fileRef = 550A0BC8085F6039007353D6 /* QualifiedName.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 555B87EC1CAAF0AB00349425 /* ImageDecoderCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 555B87EA1CAAF0AB00349425 /* ImageDecoderCG.cpp */; };
</span><span class="cx">                 555B87ED1CAAF0AB00349425 /* ImageDecoderCG.h in Headers */ = {isa = PBXBuildFile; fileRef = 555B87EB1CAAF0AB00349425 /* ImageDecoderCG.h */; };
</span><ins>+                55A336F71D8209F40022C4C7 /* NativeImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 55A336F61D8209F40022C4C7 /* NativeImage.h */; };
</ins><span class="cx">                 5709E8CD1D413D47003244AC /* WebKitSubtleCrypto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5709E8CA1D413CE3003244AC /* WebKitSubtleCrypto.cpp */; };
</span><span class="cx">                 5709E8CE1D413D5B003244AC /* JSWebKitSubtleCryptoCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1FF8F661807460800132674 /* JSWebKitSubtleCryptoCustom.cpp */; };
</span><span class="cx">                 5709E8CF1D413D9A003244AC /* WebKitSubtleCrypto.h in Headers */ = {isa = PBXBuildFile; fileRef = 5709E8CB1D413CE3003244AC /* WebKitSubtleCrypto.h */; };
</span><span class="lines">@@ -2513,7 +2514,7 @@
</span><span class="cx">                 65FEA86909833ADE00BED4AB /* Page.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65FEA86809833ADE00BED4AB /* Page.cpp */; };
</span><span class="cx">                 69A6CBAC1C6BE42C00B836E9 /* AccessibilitySVGElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 697101071C6BE1550018C7F1 /* AccessibilitySVGElement.cpp */; };
</span><span class="cx">                 69A6CBAD1C6BE42C00B836E9 /* AccessibilitySVGElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 697101081C6BE1550018C7F1 /* AccessibilitySVGElement.h */; };
</span><del>-                6B3480940EEF50D400AC1B41 /* NativeImagePtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B3480920EEF50D400AC1B41 /* NativeImagePtr.h */; settings = {ATTRIBUTES = (Private, ); }; };
</del><ins>+                6B3480940EEF50D400AC1B41 /* NativeImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B3480920EEF50D400AC1B41 /* NativeImage.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 6B693A2E1C51A82E00B03BEF /* ResourceLoadObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B693A2D1C51A82E00B03BEF /* ResourceLoadObserver.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 6B693A341C51A95D00B03BEF /* ResourceLoadObserver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6B693A331C51A95D00B03BEF /* ResourceLoadObserver.cpp */; };
</span><span class="cx">                 6C4C96DE1AD4483500365A50 /* JSReadableStreamDefaultController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6C4C96DA1AD4483500365A50 /* JSReadableStreamDefaultController.cpp */; };
</span><span class="lines">@@ -8354,7 +8355,7 @@
</span><span class="cx">                 376DCCE013B4F966002EBEFC /* TextRun.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextRun.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 3772B09516535856000A49CA /* PopupOpeningObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PopupOpeningObserver.h; sourceTree = "<group>"; };
</span><span class="cx">                 3774ABA30FA21EB400AD7DE9 /* OverlapTestRequestClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OverlapTestRequestClient.h; sourceTree = "<group>"; };
</span><del>-                377A3A8F15EFCE9A0059F5C7 /* BitmapImageCG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BitmapImageCG.cpp; sourceTree = "<group>"; };
</del><ins>+                377A3A8F15EFCE9A0059F5C7 /* NativeImageCG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NativeImageCG.cpp; sourceTree = "<group>"; };
</ins><span class="cx">                 37919C210B7D188600A56998 /* PositionIterator.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = PositionIterator.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 37919C220B7D188600A56998 /* PositionIterator.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PositionIterator.h; sourceTree = "<group>"; };
</span><span class="cx">                 379291781985EF3900F4B661 /* CredentialBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CredentialBase.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -9289,6 +9290,7 @@
</span><span class="cx">                 550A0BC8085F6039007353D6 /* QualifiedName.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = QualifiedName.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
</span><span class="cx">                 555B87EA1CAAF0AB00349425 /* ImageDecoderCG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ImageDecoderCG.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 555B87EB1CAAF0AB00349425 /* ImageDecoderCG.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageDecoderCG.h; sourceTree = "<group>"; };
</span><ins>+                55A336F61D8209F40022C4C7 /* NativeImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeImage.h; sourceTree = "<group>"; };
</ins><span class="cx">                 55D408F71A7C631800C78450 /* SVGImageClients.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGImageClients.h; sourceTree = "<group>"; };
</span><span class="cx">                 5709E8CA1D413CE3003244AC /* WebKitSubtleCrypto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitSubtleCrypto.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 5709E8CB1D413CE3003244AC /* WebKitSubtleCrypto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitSubtleCrypto.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -9554,7 +9556,7 @@
</span><span class="cx">                 65FEA86809833ADE00BED4AB /* Page.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Page.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 697101071C6BE1550018C7F1 /* AccessibilitySVGElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilitySVGElement.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 697101081C6BE1550018C7F1 /* AccessibilitySVGElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilitySVGElement.h; sourceTree = "<group>"; };
</span><del>-                6B3480920EEF50D400AC1B41 /* NativeImagePtr.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = NativeImagePtr.h; sourceTree = "<group>"; };
</del><ins>+                6B3480920EEF50D400AC1B41 /* NativeImage.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = NativeImage.h; sourceTree = "<group>"; };
</ins><span class="cx">                 6B693A2D1C51A82E00B03BEF /* ResourceLoadObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceLoadObserver.h; sourceTree = "<group>"; };
</span><span class="cx">                 6B693A331C51A95D00B03BEF /* ResourceLoadObserver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceLoadObserver.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 6C4C96DA1AD4483500365A50 /* JSReadableStreamDefaultController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSReadableStreamDefaultController.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -20506,7 +20508,6 @@
</span><span class="cx">                 B27535290B053814002CE64F /* cg */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><del>-                                377A3A8F15EFCE9A0059F5C7 /* BitmapImageCG.cpp */,
</del><span class="cx">                                 0FCF33230F2B9715004B6795 /* ColorCG.cpp */,
</span><span class="cx">                                 B275352B0B053814002CE64F /* FloatPointCG.cpp */,
</span><span class="cx">                                 B275352C0B053814002CE64F /* FloatRectCG.cpp */,
</span><span class="lines">@@ -20533,6 +20534,7 @@
</span><span class="cx">                                 A80A38FD0E50CC8200A25EBC /* PatternCG.cpp */,
</span><span class="cx">                                 B27535360B053814002CE64F /* PDFDocumentImage.cpp */,
</span><span class="cx">                                 B27535370B053814002CE64F /* PDFDocumentImage.h */,
</span><ins>+                                377A3A8F15EFCE9A0059F5C7 /* NativeImageCG.cpp */,
</ins><span class="cx">                                 1FC40FB81655C5910040F29E /* SubimageCacheWithTimer.cpp */,
</span><span class="cx">                                 1FC40FB71655C5910040F29E /* SubimageCacheWithTimer.h */,
</span><span class="cx">                                 B275352A0B053814002CE64F /* TransformationMatrixCG.cpp */,
</span><span class="lines">@@ -20724,7 +20726,7 @@
</span><span class="cx">                                 CDDC1E7918A952F30027A9D4 /* MediaSourcePrivateClient.h */,
</span><span class="cx">                                 314BE3A41B3103FB00141982 /* NamedImageGeneratedImage.cpp */,
</span><span class="cx">                                 314BE3A51B3103FB00141982 /* NamedImageGeneratedImage.h */,
</span><del>-                                6B3480920EEF50D400AC1B41 /* NativeImagePtr.h */,
</del><ins>+                                6B3480920EEF50D400AC1B41 /* NativeImage.h */,
</ins><span class="cx">                                 B27535520B053814002CE64F /* Path.cpp */,
</span><span class="cx">                                 B27535530B053814002CE64F /* Path.h */,
</span><span class="cx">                                 A88DD4880B4629B000C02990 /* PathTraversalState.cpp */,
</span><span class="lines">@@ -20766,6 +20768,7 @@
</span><span class="cx">                                 501BAAA813950E2C00F7ACEB /* WindRule.h */,
</span><span class="cx">                                 379919941200DDF400EA041C /* WOFFFileFormat.cpp */,
</span><span class="cx">                                 379919951200DDF400EA041C /* WOFFFileFormat.h */,
</span><ins>+                                55A336F61D8209F40022C4C7 /* NativeImage.h */,
</ins><span class="cx">                         );
</span><span class="cx">                         path = graphics;
</span><span class="cx">                         sourceTree = "<group>";
</span><span class="lines">@@ -25702,7 +25705,7 @@
</span><span class="cx">                                 314BE3A71B3103FB00141982 /* NamedImageGeneratedImage.h in Headers */,
</span><span class="cx">                                 A81872230977D3C0005826D9 /* NamedNodeMap.h in Headers */,
</span><span class="cx">                                 A818721E0977D3C0005826D9 /* NameNodeList.h in Headers */,
</span><del>-                                6B3480940EEF50D400AC1B41 /* NativeImagePtr.h in Headers */,
</del><ins>+                                6B3480940EEF50D400AC1B41 /* NativeImage.h in Headers */,
</ins><span class="cx">                                 83B2D1751B8BCD6A00A02E47 /* NativeNodeFilter.h in Headers */,
</span><span class="cx">                                 E10B9B6C0B747599003ED890 /* NativeXPathNSResolver.h in Headers */,
</span><span class="cx">                                 93CCF0270AF6C52900018E89 /* NavigationAction.h in Headers */,
</span><span class="lines">@@ -25780,6 +25783,7 @@
</span><span class="cx">                                 1A569D150D7E2B82007C3983 /* objc_instance.h in Headers */,
</span><span class="cx">                                 1A569D170D7E2B82007C3983 /* objc_runtime.h in Headers */,
</span><span class="cx">                                 1A569D190D7E2B82007C3983 /* objc_utility.h in Headers */,
</span><ins>+                                55A336F71D8209F40022C4C7 /* NativeImage.h in Headers */,
</ins><span class="cx">                                 E16982551134629D00894115 /* ObjCRuntimeObject.h in Headers */,
</span><span class="cx">                                 7E5D7A77161D3F8F00896C34 /* OESElementIndexUint.h in Headers */,
</span><span class="cx">                                 9001774112E0347800648462 /* OESStandardDerivatives.h in Headers */,
</span><span class="lines">@@ -27599,7 +27603,7 @@
</span><span class="cx">                                 FDC54F041399B0DA008D9117 /* BiquadFilterNode.cpp in Sources */,
</span><span class="cx">                                 FD31602612B0267600C1A359 /* BiquadProcessor.cpp in Sources */,
</span><span class="cx">                                 A89943290B42338800D7C802 /* BitmapImage.cpp in Sources */,
</span><del>-                                377A3A9015EFCE9B0059F5C7 /* BitmapImageCG.cpp in Sources */,
</del><ins>+                                377A3A9015EFCE9B0059F5C7 /* NativeImageCG.cpp in Sources */,
</ins><span class="cx">                                 1AFFC4541D5E81CB00267A66 /* BlacklistUpdater.mm in Sources */,
</span><span class="cx">                                 976D6C78122B8A3D001FD1F7 /* Blob.cpp in Sources */,
</span><span class="cx">                                 2EDEF1F3121B0EFC00726DB2 /* BlobData.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheMemoryCacheh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/MemoryCache.h (205681 => 205682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/MemoryCache.h        2016-09-09 00:55:43 UTC (rev 205681)
+++ trunk/Source/WebCore/loader/cache/MemoryCache.h        2016-09-09 01:06:47 UTC (rev 205682)
</span><span class="lines">@@ -25,7 +25,7 @@
</span><span class="cx"> #ifndef Cache_h
</span><span class="cx"> #define Cache_h
</span><span class="cx">
</span><del>-#include "NativeImagePtr.h"
</del><ins>+#include "NativeImage.h"
</ins><span class="cx"> #include "SecurityOriginHash.h"
</span><span class="cx"> #include "SessionID.h"
</span><span class="cx"> #include "Timer.h"
</span></span></pre></div>
<a id="trunkSourceWebCoreloadericonIconDatabaseBaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/icon/IconDatabaseBase.h (205681 => 205682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/icon/IconDatabaseBase.h        2016-09-09 00:55:43 UTC (rev 205681)
+++ trunk/Source/WebCore/loader/icon/IconDatabaseBase.h        2016-09-09 01:06:47 UTC (rev 205682)
</span><span class="lines">@@ -26,7 +26,7 @@
</span><span class="cx"> #ifndef IconDatabaseBase_h
</span><span class="cx"> #define IconDatabaseBase_h
</span><span class="cx">
</span><del>-#include "NativeImagePtr.h"
</del><ins>+#include "NativeImage.h"
</ins><span class="cx"> #include <wtf/Forward.h>
</span><span class="cx"> #include <wtf/Noncopyable.h>
</span><span class="cx"> #include <wtf/PassRefPtr.h>
</span></span></pre></div>
<a id="trunkSourceWebCorepagemacTextIndicatorWindowmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/mac/TextIndicatorWindow.mm (205681 => 205682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/mac/TextIndicatorWindow.mm        2016-09-09 00:55:43 UTC (rev 205681)
+++ trunk/Source/WebCore/page/mac/TextIndicatorWindow.mm        2016-09-09 01:06:47 UTC (rev 205682)
</span><span class="lines">@@ -162,9 +162,9 @@
</span><span class="cx"> contentsImageLogicalSize.scale(1 / _textIndicator->contentImageScaleFactor());
</span><span class="cx"> RetainPtr<CGImageRef> contentsImage;
</span><span class="cx"> if (indicatorWantsContentCrossfade(*_textIndicator))
</span><del>- contentsImage = _textIndicator->contentImageWithHighlight()->getCGImageRef();
</del><ins>+ contentsImage = _textIndicator->contentImageWithHighlight()->nativeImage();
</ins><span class="cx"> else
</span><del>- contentsImage = _textIndicator->contentImage()->getCGImageRef();
</del><ins>+ contentsImage = _textIndicator->contentImage()->nativeImage();
</ins><span class="cx">
</span><span class="cx"> RetainPtr<NSMutableArray> bounceLayers = adoptNS([[NSMutableArray alloc] init]);
</span><span class="cx">
</span><span class="lines">@@ -265,7 +265,7 @@
</span><span class="cx"> static RetainPtr<CABasicAnimation> createContentCrossfadeAnimation(CFTimeInterval duration, TextIndicator& textIndicator)
</span><span class="cx"> {
</span><span class="cx"> RetainPtr<CABasicAnimation> crossfadeAnimation = [CABasicAnimation animationWithKeyPath:@"contents"];
</span><del>- RetainPtr<CGImageRef> contentsImage = textIndicator.contentImage()->getCGImageRef();
</del><ins>+ RetainPtr<CGImageRef> contentsImage = textIndicator.contentImage()->nativeImage();
</ins><span class="cx"> [crossfadeAnimation setToValue:(id)contentsImage.get()];
</span><span class="cx"> [crossfadeAnimation setFillMode:kCAFillModeForwards];
</span><span class="cx"> [crossfadeAnimation setRemovedOnCompletion:NO];
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsBitmapImagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/BitmapImage.cpp (205681 => 205682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/BitmapImage.cpp        2016-09-09 00:55:43 UTC (rev 205681)
+++ trunk/Source/WebCore/platform/graphics/BitmapImage.cpp        2016-09-09 01:06:47 UTC (rev 205682)
</span><span class="lines">@@ -70,11 +70,11 @@
</span><span class="cx"> {
</span><span class="cx"> // Since we don't have a decoder, we can't figure out the image orientation.
</span><span class="cx"> // Set m_sizeRespectingOrientation to be the same as m_size so it's not 0x0.
</span><del>- m_sizeRespectingOrientation = m_size = NativeImage::size(image);
</del><ins>+ m_sizeRespectingOrientation = m_size = nativeImageSize(image);
</ins><span class="cx"> m_decodedSize = m_size.area() * 4;
</span><del>-
</del><ins>+
</ins><span class="cx"> m_frames.grow(1);
</span><del>- m_frames[0].m_hasAlpha = NativeImage::hasAlpha(image);
</del><ins>+ m_frames[0].m_hasAlpha = nativeImageHasAlpha(image);
</ins><span class="cx"> m_frames[0].m_haveMetadata = true;
</span><span class="cx"> m_frames[0].m_image = WTFMove(image);
</span><span class="cx"> }
</span><span class="lines">@@ -85,18 +85,6 @@
</span><span class="cx"> stopAnimation();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void BitmapImage::clearTimer()
-{
- m_frameTimer = nullptr;
-}
-
-void BitmapImage::startTimer(double delay)
-{
- ASSERT(!m_frameTimer);
- m_frameTimer = std::make_unique<Timer>(*this, &BitmapImage::advanceAnimation);
- m_frameTimer->startOneShot(delay);
-}
-
</del><span class="cx"> bool BitmapImage::haveFrameImageAtIndex(size_t index)
</span><span class="cx"> {
</span><span class="cx"> if (index >= frameCount())
</span><span class="lines">@@ -108,11 +96,6 @@
</span><span class="cx"> return m_frames[index].m_image;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool BitmapImage::hasSingleSecurityOrigin() const
-{
- return true;
-}
-
</del><span class="cx"> void BitmapImage::destroyDecodedData(bool destroyAll)
</span><span class="cx"> {
</span><span class="cx"> unsigned frameBytesCleared = 0;
</span><span class="lines">@@ -125,9 +108,7 @@
</span><span class="cx"> // The underlying frame isn't actually changing (we're just trying to
</span><span class="cx"> // save the memory for the framebuffer data), so we don't need to clear
</span><span class="cx"> // the metadata.
</span><del>- unsigned frameBytes = m_frames[i].m_frameBytes;
- if (m_frames[i].clear(false))
- frameBytesCleared += frameBytes;
</del><ins>+ frameBytesCleared += m_frames[i].clear(false);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> m_source.clear(destroyAll, clearBeforeFrame, data(), m_allDataReceived);
</span><span class="lines">@@ -150,8 +131,8 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> unsigned allFrameBytes = 0;
</span><del>- for (size_t i = 0; i < m_frames.size(); ++i)
- allFrameBytes += m_frames[i].usedFrameBytes();
</del><ins>+ for (auto& frame : m_frames)
+ allFrameBytes += frame.usedFrameBytes();
</ins><span class="cx">
</span><span class="cx"> if (allFrameBytes > largeAnimationCutoff) {
</span><span class="cx"> LOG(Images, "BitmapImage %p destroyDecodedDataIfNecessary destroyingData: allFrameBytes=%u cutoff=%u", this, allFrameBytes, largeAnimationCutoff);
</span><span class="lines">@@ -288,13 +269,12 @@
</span><span class="cx"> // frame affected by appending new data here. Thus we have to clear all the
</span><span class="cx"> // incomplete frames to be safe.
</span><span class="cx"> unsigned frameBytesCleared = 0;
</span><del>- for (size_t i = 0; i < m_frames.size(); ++i) {
</del><ins>+ for (auto& frame : m_frames) {
</ins><span class="cx"> // NOTE: Don't call frameIsCompleteAtIndex() here, that will try to
</span><span class="cx"> // decode any uncached (i.e. never-decoded or
</span><span class="cx"> // cleared-on-a-previous-pass) frames!
</span><del>- unsigned frameBytes = m_frames[i].m_frameBytes;
- if (m_frames[i].m_haveMetadata && !m_frames[i].m_isComplete)
- frameBytesCleared += (m_frames[i].clear(true) ? frameBytes : 0);
</del><ins>+ if (frame.m_haveMetadata && !frame.m_isComplete)
+ frameBytesCleared += frame.clear(true);
</ins><span class="cx"> }
</span><span class="cx"> destroyMetadataAndNotify(frameBytesCleared, ClearedSource::No);
</span><span class="cx"> #else
</span><span class="lines">@@ -301,8 +281,7 @@
</span><span class="cx"> // FIXME: why is this different for iOS?
</span><span class="cx"> int deltaBytes = 0;
</span><span class="cx"> if (!m_frames.isEmpty()) {
</span><del>- int bytes = m_frames[m_frames.size() - 1].m_frameBytes;
- if (m_frames[m_frames.size() - 1].clear(true)) {
</del><ins>+ if (int bytes = m_frames[m_frames.size() - 1].clear(true)) {
</ins><span class="cx"> deltaBytes += bytes;
</span><span class="cx"> deltaBytes += m_decodedPropertiesSize;
</span><span class="cx"> m_decodedPropertiesSize = 0;
</span><span class="lines">@@ -337,11 +316,6 @@
</span><span class="cx"> return isSizeAvailable();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-String BitmapImage::filenameExtension() const
-{
- return m_source.filenameExtension();
-}
-
</del><span class="cx"> size_t BitmapImage::frameCount()
</span><span class="cx"> {
</span><span class="cx"> if (!m_haveFrameCount) {
</span><span class="lines">@@ -366,7 +340,7 @@
</span><span class="cx"> return m_sizeAvailable;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool BitmapImage::ensureFrameIsCached(size_t index, ImageFrameCaching frameCaching)
</del><ins>+bool BitmapImage::ensureFrameAtIndexIsCached(size_t index, ImageFrameCaching frameCaching)
</ins><span class="cx"> {
</span><span class="cx"> if (index >= frameCount())
</span><span class="cx"> return false;
</span><span class="lines">@@ -394,8 +368,7 @@
</span><span class="cx"> LOG(Images, " subsamplingLevel was %d, resampling", m_frames[index].m_subsamplingLevel);
</span><span class="cx">
</span><span class="cx"> // If the image is already cached, but at too small a size, re-decode a larger version.
</span><del>- int sizeChange = -m_frames[index].m_frameBytes;
- m_frames[index].clear(true);
</del><ins>+ int sizeChange = -m_frames[index].clear(true);
</ins><span class="cx"> invalidatePlatformData();
</span><span class="cx"> m_decodedSize += sizeChange;
</span><span class="cx"> if (imageObserver())
</span><span class="lines">@@ -408,10 +381,49 @@
</span><span class="cx">
</span><span class="cx"> return m_frames[index].m_image;
</span><span class="cx"> }
</span><ins>+
+NativeImagePtr BitmapImage::nativeImage()
+{
+ return frameImageAtIndex(0);
+}
</ins><span class="cx">
</span><ins>+NativeImagePtr BitmapImage::nativeImageForCurrentFrame()
+{
+ return frameImageAtIndex(m_currentFrame);
+}
+
+#if USE(CG)
+NativeImagePtr BitmapImage::nativeImageOfSize(const IntSize& size)
+{
+ size_t count = frameCount();
+
+ for (size_t i = 0; i < count; ++i) {
+ auto image = frameImageAtIndex(i);
+ if (image && nativeImageSize(image) == size)
+ return image;
+ }
+
+ // Fallback to the first frame image if we can't find the right size
+ return frameImageAtIndex(0);
+}
+
+Vector<NativeImagePtr> BitmapImage::framesNativeImages()
+{
+ Vector<NativeImagePtr> images;
+ size_t count = frameCount();
+
+ for (size_t i = 0; i < count; ++i) {
+ if (auto image = frameImageAtIndex(i))
+ images.append(image);
+ }
+
+ return images;
+}
+#endif
+
</ins><span class="cx"> bool BitmapImage::frameIsCompleteAtIndex(size_t index)
</span><span class="cx"> {
</span><del>- if (!ensureFrameIsCached(index, CacheMetadataOnly))
</del><ins>+ if (!ensureFrameAtIndexIsCached(index, CacheMetadataOnly))
</ins><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> return m_frames[index].m_isComplete;
</span><span class="lines">@@ -419,20 +431,15 @@
</span><span class="cx">
</span><span class="cx"> float BitmapImage::frameDurationAtIndex(size_t index)
</span><span class="cx"> {
</span><del>- if (!ensureFrameIsCached(index, CacheMetadataOnly))
</del><ins>+ if (!ensureFrameAtIndexIsCached(index, CacheMetadataOnly))
</ins><span class="cx"> return 0;
</span><span class="cx">
</span><span class="cx"> return m_frames[index].m_duration;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-NativeImagePtr BitmapImage::nativeImageForCurrentFrame()
-{
- return frameImageAtIndex(currentFrame());
-}
-
</del><span class="cx"> bool BitmapImage::frameHasAlphaAtIndex(size_t index)
</span><span class="cx"> {
</span><del>- if (!ensureFrameIsCached(index, CacheMetadataOnly))
</del><ins>+ if (!ensureFrameAtIndexIsCached(index, CacheMetadataOnly))
</ins><span class="cx"> return true;
</span><span class="cx">
</span><span class="cx"> if (m_frames[index].m_haveMetadata)
</span><span class="lines">@@ -448,7 +455,7 @@
</span><span class="cx">
</span><span class="cx"> ImageOrientation BitmapImage::frameOrientationAtIndex(size_t index)
</span><span class="cx"> {
</span><del>- if (!ensureFrameIsCached(index, CacheMetadataOnly))
</del><ins>+ if (!ensureFrameAtIndexIsCached(index, CacheMetadataOnly))
</ins><span class="cx"> return ImageOrientation();
</span><span class="cx">
</span><span class="cx"> if (m_frames[index].m_haveMetadata)
</span><span class="lines">@@ -457,6 +464,32 @@
</span><span class="cx"> return m_source.orientationAtIndex(index);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+Color BitmapImage::singlePixelSolidColor()
+{
+ // If the image size is not available yet or if the image will be animating don't use the solid color optimization.
+ if (frameCount() != 1)
+ return Color();
+
+ if (m_solidColor)
+ return m_solidColor.value();
+
+ // If the frame image is not loaded, first use the decoder to get the size of the image.
+ if (!haveFrameImageAtIndex(0) && m_source.frameSizeAtIndex(0) != IntSize(1, 1)) {
+ m_solidColor = Color();
+ return m_solidColor.value();
+ }
+
+ // Cache the frame image. The size will be calculated from the NativeImagePtr.
+ if (!ensureFrameAtIndexIsCached(0))
+ return Color();
+
+ ASSERT(m_frames.size());
+ m_solidColor = nativeImageSinglePixelSolidColor(m_frames[0].m_image);
+
+ ASSERT(m_solidColor);
+ return m_solidColor.value();
+}
+
</ins><span class="cx"> #if !ASSERT_DISABLED
</span><span class="cx"> bool BitmapImage::notSolidColor()
</span><span class="cx"> {
</span><span class="lines">@@ -478,11 +511,93 @@
</span><span class="cx"> return m_repetitionCount;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void BitmapImage::draw(GraphicsContext& context, const FloatRect& destRect, const FloatRect& srcRect, CompositeOperator op, BlendMode mode, ImageOrientationDescription description)
+{
+ if (destRect.isEmpty() || srcRect.isEmpty())
+ return;
+
+#if PLATFORM(IOS)
+ startAnimation(DoNotCatchUp);
+#else
+ startAnimation();
+#endif
+
+ Color color = singlePixelSolidColor();
+ if (color.isValid()) {
+ fillWithSolidColor(context, destRect, color, op);
+ return;
+ }
+
+ auto image = frameImageAtIndex(m_currentFrame, subsamplingScale(context, destRect, srcRect));
+ if (!image) // If it's too early we won't have an image yet.
+ return;
+
+ ImageOrientation orientation(description.imageOrientation());
+ if (description.respectImageOrientation() == RespectImageOrientation)
+ orientation = frameOrientationAtIndex(m_currentFrame);
+
+ drawNativeImage(image, context, destRect, srcRect, m_size, op, mode, orientation);
+
+ if (imageObserver())
+ imageObserver()->didDraw(this);
+}
+
+void BitmapImage::drawPattern(GraphicsContext& ctxt, const FloatRect& tileRect, const AffineTransform& transform, const FloatPoint& phase, const FloatSize& spacing, CompositeOperator op, const FloatRect& destRect, BlendMode blendMode)
+{
+ if (tileRect.isEmpty())
+ return;
+
+ if (!ctxt.drawLuminanceMask()) {
+ Image::drawPattern(ctxt, tileRect, transform, phase, spacing, op, destRect, blendMode);
+ return;
+ }
+
+ if (!m_cachedImage) {
+ auto buffer = ImageBuffer::createCompatibleBuffer(expandedIntSize(tileRect.size()), ColorSpaceSRGB, ctxt);
+ if (!buffer)
+ return;
+
+ ImageObserver* observer = imageObserver();
+
+ // Temporarily reset image observer, we don't want to receive any changeInRect() calls due to this relayout.
+ setImageObserver(nullptr);
+
+ draw(buffer->context(), tileRect, tileRect, op, blendMode, ImageOrientationDescription());
+
+ setImageObserver(observer);
+ buffer->convertToLuminanceMask();
+
+ m_cachedImage = buffer->copyImage(DontCopyBackingStore, Unscaled);
+ if (!m_cachedImage)
+ return;
+ }
+
+ ctxt.setDrawLuminanceMask(false);
+ m_cachedImage->drawPattern(ctxt, tileRect, transform, phase, spacing, op, destRect, blendMode);
+}
+
</ins><span class="cx"> bool BitmapImage::shouldAnimate()
</span><span class="cx"> {
</span><span class="cx"> return (repetitionCount(false) != cAnimationNone && !m_animationFinished && imageObserver());
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+bool BitmapImage::canAnimate()
+{
+ return shouldAnimate() && frameCount() > 1;
+}
+
+void BitmapImage::clearTimer()
+{
+ m_frameTimer = nullptr;
+}
+
+void BitmapImage::startTimer(double delay)
+{
+ ASSERT(!m_frameTimer);
+ m_frameTimer = std::make_unique<Timer>(*this, &BitmapImage::advanceAnimation);
+ m_frameTimer->startOneShot(delay);
+}
+
</ins><span class="cx"> void BitmapImage::startAnimation(CatchUpAnimation catchUpIfNecessary)
</span><span class="cx"> {
</span><span class="cx"> if (m_frameTimer || !shouldAnimate() || frameCount() <= 1)
</span><span class="lines">@@ -580,60 +695,6 @@
</span><span class="cx"> startTimer(0);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void BitmapImage::stopAnimation()
-{
- // This timer is used to animate all occurrences of this image. Don't invalidate
- // the timer unless all renderers have stopped drawing.
- clearTimer();
-}
-
-void BitmapImage::resetAnimation()
-{
- stopAnimation();
- m_currentFrame = 0;
- m_repetitionsComplete = 0;
- m_desiredFrameStartTime = 0;
- m_animationFinished = false;
-
- // For extremely large animations, when the animation is reset, we just throw everything away.
- destroyDecodedDataIfNecessary(true);
-}
-
-void BitmapImage::drawPattern(GraphicsContext& ctxt, const FloatRect& tileRect, const AffineTransform& transform,
- const FloatPoint& phase, const FloatSize& spacing, CompositeOperator op, const FloatRect& destRect, BlendMode blendMode)
-{
- if (tileRect.isEmpty())
- return;
-
- if (!ctxt.drawLuminanceMask()) {
- Image::drawPattern(ctxt, tileRect, transform, phase, spacing, op, destRect, blendMode);
- return;
- }
- if (!m_cachedImage) {
- auto buffer = ImageBuffer::createCompatibleBuffer(expandedIntSize(tileRect.size()), ColorSpaceSRGB, ctxt);
- if (!buffer)
- return;
-
- ImageObserver* observer = imageObserver();
-
- // Temporarily reset image observer, we don't want to receive any changeInRect() calls due to this relayout.
- setImageObserver(nullptr);
-
- draw(buffer->context(), tileRect, tileRect, op, blendMode, ImageOrientationDescription());
-
- setImageObserver(observer);
- buffer->convertToLuminanceMask();
-
- m_cachedImage = buffer->copyImage(DontCopyBackingStore, Unscaled);
- if (!m_cachedImage)
- return;
- }
-
- ctxt.setDrawLuminanceMask(false);
- m_cachedImage->drawPattern(ctxt, tileRect, transform, phase, spacing, op, destRect, blendMode);
-}
-
-
</del><span class="cx"> void BitmapImage::advanceAnimation()
</span><span class="cx"> {
</span><span class="cx"> internalAdvanceAnimation();
</span><span class="lines">@@ -683,36 +744,24 @@
</span><span class="cx"> return advancedAnimation;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-Color BitmapImage::singlePixelSolidColor()
</del><ins>+void BitmapImage::stopAnimation()
</ins><span class="cx"> {
</span><del>- // If the image size is not available yet or if the image will be animating don't use the solid color optimization.
- if (frameCount() != 1)
- return Color();
-
- if (m_solidColor)
- return m_solidColor.value();
</del><ins>+ // This timer is used to animate all occurrences of this image. Don't invalidate
+ // the timer unless all renderers have stopped drawing.
+ clearTimer();
+}
</ins><span class="cx">
</span><del>- // If the frame image is not loaded, first use the decoder to get the size of the image.
- if (!haveFrameImageAtIndex(0) && m_source.frameSizeAtIndex(0, 0) != IntSize(1, 1)) {
- m_solidColor = Color();
- return m_solidColor.value();
- }
</del><ins>+void BitmapImage::resetAnimation()
+{
+ stopAnimation();
+ m_currentFrame = 0;
+ m_repetitionsComplete = 0;
+ m_desiredFrameStartTime = 0;
+ m_animationFinished = false;
</ins><span class="cx">
</span><del>- // Cache the frame image. The size will be calculated from the NativeImagePtr.
- if (!ensureFrameIsCached(0))
- return Color();
-
- ASSERT(m_frames.size());
- m_solidColor = NativeImage::singlePixelSolidColor(m_frames[0].m_image.get());
-
- ASSERT(m_solidColor);
- return m_solidColor.value();
</del><ins>+ // For extremely large animations, when the animation is reset, we just throw everything away.
+ destroyDecodedDataIfNecessary(true);
</ins><span class="cx"> }
</span><del>-
-bool BitmapImage::canAnimate()
-{
- return shouldAnimate() && frameCount() > 1;
-}
</del><span class="cx">
</span><span class="cx"> void BitmapImage::dump(TextStream& ts) const
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsBitmapImageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/BitmapImage.h (205681 => 205682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/BitmapImage.h        2016-09-09 00:55:43 UTC (rev 205681)
+++ trunk/Source/WebCore/platform/graphics/BitmapImage.h        2016-09-09 01:06:47 UTC (rev 205682)
</span><span class="lines">@@ -47,25 +47,9 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><del>- struct FrameData;
-}
</del><span class="cx">
</span><del>-namespace WTF {
- template<> struct VectorTraits<WebCore::FrameData> : public SimpleClassVectorTraits {
- static const bool canInitializeWithMemset = false; // Not all FrameData members initialize to 0.
- };
-}
-
-namespace WebCore {
-
</del><span class="cx"> class Timer;
</span><span class="cx">
</span><del>-namespace NativeImage {
- IntSize size(const NativeImagePtr&);
- bool hasAlpha(const NativeImagePtr&);
- Color singlePixelSolidColor(const NativeImagePtr&);
-}
-
</del><span class="cx"> // ================================================
</span><span class="cx"> // FrameData Class
</span><span class="cx"> // ================================================
</span><span class="lines">@@ -75,24 +59,33 @@
</span><span class="cx"> FrameData()
</span><span class="cx"> : m_haveMetadata(false)
</span><span class="cx"> , m_isComplete(false)
</span><del>- , m_hasAlpha(true)
</del><ins>+ , m_hasAlpha(false)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> ~FrameData()
</span><del>- {
- clear(true);
</del><ins>+ {
+ clearNativeImageSubImages(m_image);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- // Clear the cached image data on the frame, and (optionally) the metadata.
- // Returns whether there was cached image data to clear.
- bool clear(bool clearMetadata);
</del><ins>+ unsigned clear(bool clearMetadata)
+ {
+ unsigned frameBytes = usedFrameBytes();
+
+ if (clearMetadata)
+ m_haveMetadata = false;
+
+ m_subsamplingLevel = DefaultSubsamplingLevel;
+ m_image = nullptr;
+
+ return frameBytes;
+ }
</ins><span class="cx">
</span><span class="cx"> unsigned usedFrameBytes() const { return m_image ? m_frameBytes : 0; }
</span><span class="cx">
</span><span class="cx"> NativeImagePtr m_image;
</span><span class="cx"> ImageOrientation m_orientation { DefaultImageOrientation };
</span><del>- SubsamplingLevel m_subsamplingLevel { 0 };
</del><ins>+ SubsamplingLevel m_subsamplingLevel { DefaultSubsamplingLevel };
</ins><span class="cx"> float m_duration { 0 };
</span><span class="cx"> bool m_haveMetadata : 1;
</span><span class="cx"> bool m_isComplete : 1;
</span><span class="lines">@@ -105,10 +98,6 @@
</span><span class="cx"> // =================================================
</span><span class="cx">
</span><span class="cx"> class BitmapImage final : public Image {
</span><del>- friend class GeneratedImage;
- friend class CrossfadeGeneratedImage;
- friend class GradientImage;
- friend class GraphicsContext;
</del><span class="cx"> public:
</span><span class="cx"> static Ref<BitmapImage> create(NativeImagePtr&& nativeImage, ImageObserver* observer = nullptr)
</span><span class="cx"> {
</span><span class="lines">@@ -123,7 +112,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> virtual ~BitmapImage();
</span><span class="cx">
</span><del>- bool hasSingleSecurityOrigin() const override;
</del><ins>+ bool hasSingleSecurityOrigin() const override { return true; }
</ins><span class="cx">
</span><span class="cx"> // FloatSize due to override.
</span><span class="cx"> FloatSize size() const override;
</span><span class="lines">@@ -134,7 +123,7 @@
</span><span class="cx"> unsigned decodedSize() const { return m_decodedSize; }
</span><span class="cx">
</span><span class="cx"> bool dataChanged(bool allDataReceived) override;
</span><del>- String filenameExtension() const override;
</del><ins>+ String filenameExtension() const override { return m_source.filenameExtension(); }
</ins><span class="cx">
</span><span class="cx"> // It may look unusual that there is no start animation call as public API. This is because
</span><span class="cx"> // we start and stop animating lazily. Animation begins whenever someone draws the image. It will
</span><span class="lines">@@ -155,12 +144,6 @@
</span><span class="cx"> CFDataRef getTIFFRepresentation() override;
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-#if USE(CG)
- WEBCORE_EXPORT CGImageRef getCGImageRef() override;
- CGImageRef getFirstCGImageRefOfSize(const IntSize&) override;
- RetainPtr<CFArrayRef> getCGImageArray() override;
-#endif
-
</del><span class="cx"> #if PLATFORM(WIN)
</span><span class="cx"> bool getHBITMAP(HBITMAP) override;
</span><span class="cx"> bool getHBITMAPOfSize(HBITMAP, const IntSize*) override;
</span><span class="lines">@@ -174,7 +157,12 @@
</span><span class="cx"> Evas_Object* getEvasObject(Evas*) override;
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+ WEBCORE_EXPORT NativeImagePtr nativeImage() override;
</ins><span class="cx"> NativeImagePtr nativeImageForCurrentFrame() override;
</span><ins>+#if USE(CG)
+ NativeImagePtr nativeImageOfSize(const IntSize&) override;
+ Vector<NativeImagePtr> framesNativeImages() override;
+#endif
</ins><span class="cx"> ImageOrientation orientationForCurrentFrame() override { return frameOrientationAtIndex(currentFrame()); }
</span><span class="cx">
</span><span class="cx"> bool currentFrameKnownToBeOpaque() override;
</span><span class="lines">@@ -215,7 +203,6 @@
</span><span class="cx"> size_t frameCount();
</span><span class="cx">
</span><span class="cx"> NativeImagePtr frameImageAtIndex(size_t, float presentationScaleHint = 1);
</span><del>- NativeImagePtr copyUnscaledFrameImageAtIndex(size_t);
</del><span class="cx">
</span><span class="cx"> bool haveFrameImageAtIndex(size_t);
</span><span class="cx">
</span><span class="lines">@@ -229,7 +216,7 @@
</span><span class="cx"> void cacheFrame(size_t index, SubsamplingLevel, ImageFrameCaching = CacheMetadataAndFrame);
</span><span class="cx">
</span><span class="cx"> // Called before accessing m_frames[index] for info without decoding. Returns false on index out of bounds.
</span><del>- bool ensureFrameIsCached(size_t index, ImageFrameCaching = CacheMetadataAndFrame);
</del><ins>+ bool ensureFrameAtIndexIsCached(size_t index, ImageFrameCaching = CacheMetadataAndFrame);
</ins><span class="cx">
</span><span class="cx"> // Called to invalidate cached data. When |destroyAll| is true, we wipe out
</span><span class="cx"> // the entire frame buffer cache and tell the image source to destroy
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsIconh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/Icon.h (205681 => 205682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/Icon.h        2016-09-09 00:55:43 UTC (rev 205681)
+++ trunk/Source/WebCore/platform/graphics/Icon.h        2016-09-09 01:06:47 UTC (rev 205682)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx"> #include <wtf/Vector.h>
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(IOS)
</span><del>-#include "NativeImagePtr.h"
</del><ins>+#include "NativeImage.h"
</ins><span class="cx"> #include <CoreGraphics/CoreGraphics.h>
</span><span class="cx"> #elif PLATFORM(MAC)
</span><span class="cx"> OBJC_CLASS NSImage;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsImageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/Image.h (205681 => 205682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/Image.h        2016-09-09 00:55:43 UTC (rev 205681)
+++ trunk/Source/WebCore/platform/graphics/Image.h        2016-09-09 01:06:47 UTC (rev 205682)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx"> #include "FloatSize.h"
</span><span class="cx"> #include "GraphicsTypes.h"
</span><span class="cx"> #include "ImageOrientation.h"
</span><del>-#include "NativeImagePtr.h"
</del><ins>+#include "NativeImage.h"
</ins><span class="cx"> #include <wtf/Optional.h>
</span><span class="cx"> #include <wtf/PassRefPtr.h>
</span><span class="cx"> #include <wtf/RefCounted.h>
</span><span class="lines">@@ -137,8 +137,11 @@
</span><span class="cx">
</span><span class="cx"> enum TileRule { StretchTile, RoundTile, SpaceTile, RepeatTile };
</span><span class="cx">
</span><ins>+ virtual NativeImagePtr nativeImage() { return nullptr; }
+ virtual NativeImagePtr nativeImageOfSize(const IntSize&) { return nullptr; }
</ins><span class="cx"> virtual NativeImagePtr nativeImageForCurrentFrame() { return nullptr; }
</span><span class="cx"> virtual ImageOrientation orientationForCurrentFrame() { return ImageOrientation(); }
</span><ins>+ virtual Vector<NativeImagePtr> framesNativeImages() { return { }; }
</ins><span class="cx">
</span><span class="cx"> // Accessors for native image formats.
</span><span class="cx">
</span><span class="lines">@@ -150,12 +153,6 @@
</span><span class="cx"> virtual CFDataRef getTIFFRepresentation() { return nullptr; }
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-#if USE(CG)
- virtual CGImageRef getCGImageRef() { return nullptr; }
- virtual CGImageRef getFirstCGImageRefOfSize(const IntSize&) { return nullptr; }
- virtual RetainPtr<CFArrayRef> getCGImageArray() { return nullptr; }
-#endif
-
</del><span class="cx"> #if PLATFORM(WIN)
</span><span class="cx"> virtual bool getHBITMAP(HBITMAP) { return false; }
</span><span class="cx"> virtual bool getHBITMAPOfSize(HBITMAP, const IntSize*) { return false; }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsImageSourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ImageSource.cpp (205681 => 205682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ImageSource.cpp        2016-09-09 00:55:43 UTC (rev 205681)
+++ trunk/Source/WebCore/platform/graphics/ImageSource.cpp        2016-09-09 01:06:47 UTC (rev 205682)
</span><span class="lines">@@ -94,20 +94,19 @@
</span><span class="cx"> SubsamplingLevel ImageSource::calculateMaximumSubsamplingLevel() const
</span><span class="cx"> {
</span><span class="cx"> if (!m_allowSubsampling || !allowSubsamplingOfFrameAtIndex(0))
</span><del>- return 0;
</del><ins>+ return DefaultSubsamplingLevel;
</ins><span class="cx">
</span><span class="cx"> // FIXME: this value was chosen to be appropriate for iOS since the image
</span><span class="cx"> // subsampling is only enabled by default on iOS. Choose a different value
</span><span class="cx"> // if image subsampling is enabled on other platform.
</span><span class="cx"> const int maximumImageAreaBeforeSubsampling = 5 * 1024 * 1024;
</span><del>- const SubsamplingLevel maxSubsamplingLevel = 3;
-
- for (SubsamplingLevel level = 0; level < maxSubsamplingLevel; ++level) {
</del><ins>+
+ for (SubsamplingLevel level = MinSubsamplingLevel; level < MaxSubsamplingLevel; ++level) {
</ins><span class="cx"> if (frameSizeAtIndex(0, level).area() < maximumImageAreaBeforeSubsampling)
</span><span class="cx"> return level;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- return maxSubsamplingLevel;
</del><ins>+ return MaxSubsamplingLevel;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void ImageSource::updateMetadata()
</span><span class="lines">@@ -148,12 +147,12 @@
</span><span class="cx">
</span><span class="cx"> IntSize ImageSource::size() const
</span><span class="cx"> {
</span><del>- return frameSizeAtIndex(0, 0);
</del><ins>+ return frameSizeAtIndex(0, DefaultSubsamplingLevel);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> IntSize ImageSource::sizeRespectingOrientation() const
</span><span class="cx"> {
</span><del>- return frameSizeAtIndex(0, 0, RespectImageOrientation);
</del><ins>+ return frameSizeAtIndex(0, DefaultSubsamplingLevel, RespectImageOrientation);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> size_t ImageSource::frameCount()
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsImageSourceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ImageSource.h (205681 => 205682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ImageSource.h        2016-09-09 00:55:43 UTC (rev 205681)
+++ trunk/Source/WebCore/platform/graphics/ImageSource.h        2016-09-09 01:06:47 UTC (rev 205682)
</span><span class="lines">@@ -29,7 +29,7 @@
</span><span class="cx">
</span><span class="cx"> #include "ImageOrientation.h"
</span><span class="cx"> #include "IntPoint.h"
</span><del>-#include "NativeImagePtr.h"
</del><ins>+#include "NativeImage.h"
</ins><span class="cx"> #include "TextStream.h"
</span><span class="cx"> #include <wtf/Forward.h>
</span><span class="cx"> #include <wtf/Noncopyable.h>
</span><span class="lines">@@ -62,8 +62,15 @@
</span><span class="cx"> const int cAnimationNone = -2;
</span><span class="cx">
</span><span class="cx"> // SubsamplingLevel. 0 is no subsampling, 1 is half dimensions on each axis etc.
</span><del>-typedef short SubsamplingLevel;
</del><ins>+using SubsamplingLevel = int;
</ins><span class="cx">
</span><ins>+enum : SubsamplingLevel {
+ NilSubsamplingLevel = -1,
+ MinSubsamplingLevel = 0,
+ MaxSubsamplingLevel = 3,
+ DefaultSubsamplingLevel = MinSubsamplingLevel
+};
+
</ins><span class="cx"> class ImageSource {
</span><span class="cx"> WTF_MAKE_NONCOPYABLE(ImageSource);
</span><span class="cx"> friend class BitmapImage;
</span><span class="lines">@@ -130,11 +137,11 @@
</span><span class="cx"> bool allowSubsamplingOfFrameAtIndex(size_t) const;
</span><span class="cx">
</span><span class="cx"> // Size of optionally subsampled frame.
</span><del>- IntSize frameSizeAtIndex(size_t, SubsamplingLevel = 0, RespectImageOrientationEnum = DoNotRespectImageOrientation) const;
</del><ins>+ IntSize frameSizeAtIndex(size_t, SubsamplingLevel = DefaultSubsamplingLevel, RespectImageOrientationEnum = DoNotRespectImageOrientation) const;
</ins><span class="cx">
</span><span class="cx"> // Return the number of bytes in the decoded frame. If the frame is not yet
</span><span class="cx"> // decoded then return 0.
</span><del>- unsigned frameBytesAtIndex(size_t, SubsamplingLevel = 0) const;
</del><ins>+ unsigned frameBytesAtIndex(size_t, SubsamplingLevel = DefaultSubsamplingLevel) const;
</ins><span class="cx">
</span><span class="cx"> float frameDurationAtIndex(size_t);
</span><span class="cx"> ImageOrientation orientationAtIndex(size_t) const; // EXIF image orientation
</span><span class="lines">@@ -141,7 +148,7 @@
</span><span class="cx">
</span><span class="cx"> // Callers should not call this after calling clear() with a higher index;
</span><span class="cx"> // see comments on clear() above.
</span><del>- NativeImagePtr createFrameImageAtIndex(size_t, SubsamplingLevel = 0);
</del><ins>+ NativeImagePtr createFrameImageAtIndex(size_t, SubsamplingLevel = DefaultSubsamplingLevel);
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> void clearFrameBufferCache(size_t);
</span><span class="lines">@@ -153,7 +160,7 @@
</span><span class="cx">
</span><span class="cx"> bool m_needsUpdateMetadata { false };
</span><span class="cx"> size_t m_frameCount { 0 };
</span><del>- Optional<SubsamplingLevel> m_maximumSubsamplingLevel { 0 };
</del><ins>+ Optional<SubsamplingLevel> m_maximumSubsamplingLevel { DefaultSubsamplingLevel };
</ins><span class="cx">
</span><span class="cx"> // The default value of m_allowSubsampling should be the same as defaultImageSubsamplingEnabled in Settings.cpp
</span><span class="cx"> #if PLATFORM(IOS)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsMediaPlayerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.h (205681 => 205682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/MediaPlayer.h        2016-09-09 00:55:43 UTC (rev 205681)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.h        2016-09-09 01:06:47 UTC (rev 205682)
</span><span class="lines">@@ -36,7 +36,7 @@
</span><span class="cx"> #include "URL.h"
</span><span class="cx"> #include "LayoutRect.h"
</span><span class="cx"> #include "MediaPlayerEnums.h"
</span><del>-#include "NativeImagePtr.h"
</del><ins>+#include "NativeImage.h"
</ins><span class="cx"> #include "PlatformLayer.h"
</span><span class="cx"> #include "PlatformMediaResourceLoader.h"
</span><span class="cx"> #include "PlatformMediaSession.h"
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsNativeImagehfromrev205681trunkSourceWebCoreplatformgraphicsNativeImagePtrh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/graphics/NativeImage.h (from rev 205681, trunk/Source/WebCore/platform/graphics/NativeImagePtr.h) (0 => 205682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/NativeImage.h         (rev 0)
+++ trunk/Source/WebCore/platform/graphics/NativeImage.h        2016-09-09 01:06:47 UTC (rev 205682)
</span><span class="lines">@@ -0,0 +1,66 @@
</span><ins>+/*
+ * Copyright (C) 2004, 2005, 2006, 2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2007-2008 Torch Mobile, Inc.
+ * Copyright (C) 2012 Company 100 Inc.
+ *
+ * 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.
+ */
+
+#pragma once
+
+#include "GraphicsTypes.h"
+#include "ImageOrientation.h"
+
+#if USE(CG)
+#include <wtf/RetainPtr.h>
+typedef struct CGImage* CGImageRef;
+#elif USE(CAIRO)
+#include "RefPtrCairo.h"
+#elif USE(WINGDI)
+#include "SharedBitmap.h"
+#endif
+
+namespace WebCore {
+
+class Color;
+class FloatRect;
+class IntSize;
+class GraphicsContext;
+
+#if USE(CG)
+typedef RetainPtr<CGImageRef> NativeImagePtr;
+#elif USE(CAIRO)
+typedef RefPtr<cairo_surface_t> NativeImagePtr;
+#elif USE(WINGDI)
+typedef RefPtr<SharedBitmap> NativeImagePtr;
+#endif
+
+IntSize nativeImageSize(const NativeImagePtr&);
+bool nativeImageHasAlpha(const NativeImagePtr&);
+Color nativeImageSinglePixelSolidColor(const NativeImagePtr&);
+
+float subsamplingScale(GraphicsContext&, const FloatRect& destRect, const FloatRect& srcRect);
+
+void drawNativeImage(const NativeImagePtr&, GraphicsContext&, const FloatRect&, const FloatRect&, const IntSize&, CompositeOperator, BlendMode, const ImageOrientation&);
+void clearNativeImageSubImages(const NativeImagePtr&);
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsNativeImagePtrh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/NativeImagePtr.h (205681 => 205682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/NativeImagePtr.h        2016-09-09 00:55:43 UTC (rev 205681)
+++ trunk/Source/WebCore/platform/graphics/NativeImagePtr.h        2016-09-09 01:06:47 UTC (rev 205682)
</span><span class="lines">@@ -1,52 +0,0 @@
</span><del>-/*
- * Copyright (C) 2004, 2005, 2006 Apple Inc. All rights reserved.
- * Copyright (C) 2007-2008 Torch Mobile, Inc.
- * Copyright (C) 2012 Company 100 Inc.
- *
- * 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 NativeImagePtr_h
-#define NativeImagePtr_h
-
-#if USE(CG)
-#include <wtf/RetainPtr.h>
-typedef struct CGImage* CGImageRef;
-#elif USE(CAIRO)
-#include "RefPtrCairo.h"
-#elif USE(WINGDI)
-#include "SharedBitmap.h"
-#endif
-
-namespace WebCore {
-
-#if USE(CG)
-typedef RetainPtr<CGImageRef> NativeImagePtr;
-#elif USE(CAIRO)
-typedef RefPtr<cairo_surface_t> NativeImagePtr;
-#elif USE(WINGDI)
-typedef RefPtr<SharedBitmap> NativeImagePtr;
-#endif
-
-}
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaStreamAVFObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm (205681 => 205682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm        2016-09-09 00:55:43 UTC (rev 205681)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm        2016-09-09 01:06:47 UTC (rev 205682)
</span><span class="lines">@@ -297,7 +297,7 @@
</span><span class="cx"> if (!image)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- m_pausedImage = image->getCGImageRef();
</del><ins>+ m_pausedImage = image->nativeImage();
</ins><span class="cx"> ASSERT(m_pausedImage);
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscairoBitmapImageCairocpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/cairo/BitmapImageCairo.cpp (205681 => 205682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cairo/BitmapImageCairo.cpp        2016-09-09 00:55:43 UTC (rev 205681)
+++ trunk/Source/WebCore/platform/graphics/cairo/BitmapImageCairo.cpp        2016-09-09 01:06:47 UTC (rev 205682)
</span><span class="lines">@@ -1,142 +0,0 @@
</span><del>-/*
- * Copyright (C) 2004, 2005, 2006 Apple Inc. All rights reserved.
- * Copyright (C) 2007 Alp Toker <alp@atoker.com>
- * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
- *
- * 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 "config.h"
-#include "BitmapImage.h"
-
-#if USE(CAIRO)
-
-#include "CairoUtilities.h"
-#include "ImageObserver.h"
-#include "PlatformContextCairo.h"
-#include "Timer.h"
-#include <cairo.h>
-
-namespace WebCore {
-
-namespace NativeImage {
-
-IntSize size(const RefPtr<cairo_surface_t>& image)
-{
- return cairoSurfaceSize(image.get());
-}
-
-bool hasAlpha(const RefPtr<cairo_surface_t>& image)
-{
- return cairo_surface_get_content(image.get()) != CAIRO_CONTENT_COLOR;
-}
-
-Color singlePixelSolidColor(const RefPtr<cairo_surface_t>& image)
-{
- ASSERT(image);
-
- if (NativeImage::size(image) != IntSize(1, 1))
- return Color();
-
- if (cairo_surface_get_type(image.get()) != CAIRO_SURFACE_TYPE_IMAGE)
- return Color();
-
- RGBA32* pixel = reinterpret_cast_ptr<RGBA32*>(cairo_image_surface_get_data(image.get()));
- return colorFromPremultipliedARGB(*pixel);
-}
-
-}
-
-void BitmapImage::draw(GraphicsContext& context, const FloatRect& dst, const FloatRect& src, CompositeOperator op,
- BlendMode blendMode, ImageOrientationDescription description)
-{
- if (!dst.width() || !dst.height() || !src.width() || !src.height())
- return;
-
- startAnimation();
-
- auto surface = frameImageAtIndex(m_currentFrame);
- if (!surface) // If it's too early we won't have an image yet.
- return;
-
- Color color = singlePixelSolidColor();
- if (color.isValid()) {
- fillWithSolidColor(context, dst, color, op);
- return;
- }
-
- context.save();
-
- // Set the compositing operation.
- if (op == CompositeSourceOver && blendMode == BlendModeNormal && !frameHasAlphaAtIndex(m_currentFrame))
- context.setCompositeOperation(CompositeCopy);
- else
- context.setCompositeOperation(op, blendMode);
-
-#if ENABLE(IMAGE_DECODER_DOWN_SAMPLING)
- IntSize scaledSize = cairoSurfaceSize(surface.get());
- FloatRect adjustedSrcRect = adjustSourceRectForDownSampling(src, scaledSize);
-#else
- FloatRect adjustedSrcRect(src);
-#endif
-
- ImageOrientation frameOrientation(description.imageOrientation());
- if (description.respectImageOrientation() == RespectImageOrientation)
- frameOrientation = frameOrientationAtIndex(m_currentFrame);
-
- FloatRect dstRect = dst;
-
- if (frameOrientation != DefaultImageOrientation) {
- // ImageOrientation expects the origin to be at (0, 0).
- context.translate(dstRect.x(), dstRect.y());
- dstRect.setLocation(FloatPoint());
- context.concatCTM(frameOrientation.transformFromDefault(dstRect.size()));
- if (frameOrientation.usesWidthAsHeight()) {
- // The destination rectangle will have it's width and height already reversed for the orientation of
- // the image, as it was needed for page layout, so we need to reverse it back here.
- dstRect = FloatRect(dstRect.x(), dstRect.y(), dstRect.height(), dstRect.width());
- }
- }
-
- context.platformContext()->drawSurfaceToContext(surface.get(), dstRect, adjustedSrcRect, context);
-
- context.restore();
-
- if (imageObserver())
- imageObserver()->didDraw(this);
-}
-
-bool FrameData::clear(bool clearMetadata)
-{
- if (clearMetadata)
- m_haveMetadata = false;
-
- if (m_image) {
- m_image = nullptr;
- return true;
- }
- return false;
-}
-
-} // namespace WebCore
-
-#endif // USE(CAIRO)
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscairoNativeImageCairocpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/graphics/cairo/NativeImageCairo.cpp (0 => 205682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cairo/NativeImageCairo.cpp         (rev 0)
+++ trunk/Source/WebCore/platform/graphics/cairo/NativeImageCairo.cpp        2016-09-09 01:06:47 UTC (rev 205682)
</span><span class="lines">@@ -0,0 +1,105 @@
</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 "config.h"
+#include "NativeImage.h"
+
+#if USE(CAIRO)
+
+#include "CairoUtilities.h"
+#include "PlatformContextCairo.h"
+#include <cairo.h>
+
+namespace WebCore {
+
+IntSize nativeImageSize(const NativeImagePtr& image)
+{
+ return image ? cairoSurfaceSize(image.get()) : IntSize();
+}
+
+bool nativeImageHasAlpha(const NativeImagePtr& image)
+{
+ return !image || cairo_surface_get_content(image.get()) != CAIRO_CONTENT_COLOR;
+}
+
+Color nativeImageSinglePixelSolidColor(const NativeImagePtr& image)
+{
+ if (!image || nativeImageSize(image) != IntSize(1, 1))
+ return Color();
+
+ if (cairo_surface_get_type(image.get()) != CAIRO_SURFACE_TYPE_IMAGE)
+ return Color();
+
+ RGBA32* pixel = reinterpret_cast_ptr<RGBA32*>(cairo_image_surface_get_data(image.get()));
+ return colorFromPremultipliedARGB(*pixel);
+}
+
+float subsamplingScale(GraphicsContext&, const FloatRect&, const FloatRect&)
+{
+ return 1;
+}
+
+void drawNativeImage(const NativeImagePtr& image, GraphicsContext& context, const FloatRect& destRect, const FloatRect& srcRect, const IntSize&, CompositeOperator op, BlendMode mode, const ImageOrientation& orientation)
+{
+ context.save();
+
+ // Set the compositing operation.
+ if (op == CompositeSourceOver && mode == BlendModeNormal && !nativeImageHasAlpha(image))
+ context.setCompositeOperation(CompositeCopy);
+ else
+ context.setCompositeOperation(op, mode);
+
+#if ENABLE(IMAGE_DECODER_DOWN_SAMPLING)
+ IntSize scaledSize = nativeImageSize(image);
+ FloatRect adjustedSrcRect = adjustSourceRectForDownSampling(srcRect, scaledSize);
+#else
+ FloatRect adjustedSrcRect(srcRect);
+#endif
+
+ FloatRect adjustedDestRect = destRect;
+
+ if (orientation != DefaultImageOrientation) {
+ // ImageOrientation expects the origin to be at (0, 0).
+ context.translate(destRect.x(), destRect.y());
+ adjustedDestRect.setLocation(FloatPoint());
+ context.concatCTM(orientation.transformFromDefault(adjustedDestRect.size()));
+ if (orientation.usesWidthAsHeight()) {
+ // The destination rectangle will have it's width and height already reversed for the orientation of
+ // the image, as it was needed for page layout, so we need to reverse it back here.
+ adjustedDestRect.setSize(adjustedDestRect.size().transposedSize());
+ }
+ }
+
+ context.platformContext()->drawSurfaceToContext(image.get(), adjustedDestRect, adjustedSrcRect, context);
+ context.restore();
+}
+
+void clearNativeImageSubImages(const NativeImagePtr&)
+{
+}
+
+} // namespace WebCore
+
+#endif // USE(CAIRO)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgBitmapImageCGcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/cg/BitmapImageCG.cpp (205681 => 205682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/BitmapImageCG.cpp        2016-09-09 00:55:43 UTC (rev 205681)
+++ trunk/Source/WebCore/platform/graphics/cg/BitmapImageCG.cpp        2016-09-09 01:06:47 UTC (rev 205682)
</span><span class="lines">@@ -1,206 +0,0 @@
</span><del>-/*
- * Copyright (C) 2004, 2005, 2006 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 "config.h"
-#include "BitmapImage.h"
-
-#if USE(CG)
-
-#include "CoreGraphicsSPI.h"
-#include "FloatConversion.h"
-#include "GeometryUtilities.h"
-#include "GraphicsContextCG.h"
-#include "ImageObserver.h"
-#include "SubimageCacheWithTimer.h"
-#include <wtf/RetainPtr.h>
-
-#if USE(APPKIT)
-#include <ApplicationServices/ApplicationServices.h>
-#endif
-
-#if PLATFORM(COCOA)
-#include "WebCoreSystemInterface.h"
-#endif
-
-#if PLATFORM(WIN)
-#include <WebKitSystemInterface/WebKitSystemInterface.h>
-#endif
-
-namespace WebCore {
-
-namespace NativeImage {
-
-IntSize size(const RetainPtr<CGImageRef>& image)
-{
- ASSERT(image);
- return IntSize(CGImageGetWidth(image.get()), CGImageGetHeight(image.get()));
-}
-
-bool hasAlpha(const RetainPtr<CGImageRef>&)
-{
- // FIXME: Answer correctly the question: does the CGImageRef have alpha channnel?
- return true;
-}
-
-Color singlePixelSolidColor(const RetainPtr<CGImageRef>& image)
-{
- ASSERT(image);
-
- if (NativeImage::size(image) != IntSize(1, 1))
- return Color();
-
- unsigned char pixel[4]; // RGBA
- auto bitmapContext = adoptCF(CGBitmapContextCreate(pixel, 1, 1, 8, sizeof(pixel), sRGBColorSpaceRef(),
- kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big));
-
- if (!bitmapContext)
- return Color();
-
- CGContextSetBlendMode(bitmapContext.get(), kCGBlendModeCopy);
- CGContextDrawImage(bitmapContext.get(), CGRectMake(0, 0, 1, 1), image.get());
-
- if (!pixel[3])
- return Color(0, 0, 0, 0);
-
- return Color(pixel[0] * 255 / pixel[3], pixel[1] * 255 / pixel[3], pixel[2] * 255 / pixel[3], pixel[3]);
-}
-
-}
-
-bool FrameData::clear(bool clearMetadata)
-{
- if (clearMetadata)
- m_haveMetadata = false;
-
- m_subsamplingLevel = 0;
-
- if (m_image) {
-#if CACHE_SUBIMAGES
- subimageCache().clearImage(m_image.get());
-#endif
- m_image = nullptr;
- return true;
- }
- return false;
-}
-
-CGImageRef BitmapImage::getCGImageRef()
-{
- return frameImageAtIndex(0).get();
-}
-
-CGImageRef BitmapImage::getFirstCGImageRefOfSize(const IntSize& size)
-{
- size_t count = frameCount();
- for (size_t i = 0; i < count; ++i) {
- CGImageRef cgImage = frameImageAtIndex(i).get();
- if (cgImage && IntSize(CGImageGetWidth(cgImage), CGImageGetHeight(cgImage)) == size)
- return cgImage;
- }
-
- // Fallback to the default CGImageRef if we can't find the right size
- return getCGImageRef();
-}
-
-RetainPtr<CFArrayRef> BitmapImage::getCGImageArray()
-{
- size_t count = frameCount();
- if (!count)
- return nullptr;
-
- CFMutableArrayRef array = CFArrayCreateMutable(NULL, count, &kCFTypeArrayCallBacks);
- for (size_t i = 0; i < count; ++i) {
- if (CGImageRef currFrame = frameImageAtIndex(i).get())
- CFArrayAppendValue(array, currFrame);
- }
- return adoptCF(array);
-}
-
-void BitmapImage::draw(GraphicsContext& ctxt, const FloatRect& destRect, const FloatRect& srcRect, CompositeOperator compositeOp, BlendMode blendMode, ImageOrientationDescription description)
-{
-#if PLATFORM(IOS)
- startAnimation(DoNotCatchUp);
-#else
- startAnimation();
-#endif
-
- RetainPtr<CGImageRef> image;
- // Never use subsampled images for drawing into PDF contexts.
- if (wkCGContextIsPDFContext(ctxt.platformContext()))
- image = copyUnscaledFrameImageAtIndex(m_currentFrame);
- else {
- CGRect transformedDestinationRect = CGRectApplyAffineTransform(destRect, CGContextGetCTM(ctxt.platformContext()));
- float subsamplingScale = std::min<float>(1, std::max(transformedDestinationRect.size.width / srcRect.width(), transformedDestinationRect.size.height / srcRect.height()));
-
- image = frameImageAtIndex(m_currentFrame, subsamplingScale);
- }
-
- if (!image) // If it's too early we won't have an image yet.
- return;
-
- Color color = singlePixelSolidColor();
- if (color.isValid()) {
- fillWithSolidColor(ctxt, destRect, color, compositeOp);
- return;
- }
-
- // Subsampling may have given us an image that is smaller than size().
- IntSize imageSize(CGImageGetWidth(image.get()), CGImageGetHeight(image.get()));
-
- // srcRect is in the coordinates of the unsubsampled image, so we have to map it to the subsampled image.
- FloatRect scaledSrcRect = srcRect;
- if (imageSize != m_size) {
- FloatRect originalImageBounds(FloatPoint(), m_size);
- FloatRect subsampledImageBounds(FloatPoint(), imageSize);
- scaledSrcRect = mapRect(srcRect, originalImageBounds, subsampledImageBounds);
- }
-
- ImageOrientation orientation;
- if (description.respectImageOrientation() == RespectImageOrientation)
- orientation = frameOrientationAtIndex(m_currentFrame);
-
- ctxt.drawNativeImage(image, imageSize, destRect, scaledSrcRect, compositeOp, blendMode, orientation);
-
- if (imageObserver())
- imageObserver()->didDraw(this);
-}
-
-RetainPtr<CGImageRef> BitmapImage::copyUnscaledFrameImageAtIndex(size_t index)
-{
- if (index >= frameCount())
- return nullptr;
-
- if (index >= m_frames.size() || !m_frames[index].m_image)
- cacheFrame(index, 0);
-
- if (!m_frames[index].m_subsamplingLevel)
- return m_frames[index].m_image;
-
- return m_source.createFrameImageAtIndex(index);
-}
-
-}
-
-#endif // USE(CG)
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgImageDecoderCGcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp (205681 => 205682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp        2016-09-09 00:55:43 UTC (rev 205681)
+++ trunk/Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp        2016-09-09 01:06:47 UTC (rev 205682)
</span><span class="lines">@@ -157,7 +157,7 @@
</span><span class="cx"> IntSize ImageDecoder::size() const
</span><span class="cx"> {
</span><span class="cx"> if (m_size.isEmpty())
</span><del>- m_size = frameSizeAtIndex(0, 0);
</del><ins>+ m_size = frameSizeAtIndex(0);
</ins><span class="cx"> return m_size;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgImageDecoderCGh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/ImageDecoderCG.h (205681 => 205682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/ImageDecoderCG.h        2016-09-09 00:55:43 UTC (rev 205681)
+++ trunk/Source/WebCore/platform/graphics/cg/ImageDecoderCG.h        2016-09-09 01:06:47 UTC (rev 205682)
</span><span class="lines">@@ -57,7 +57,7 @@
</span><span class="cx"> int repetitionCount() const;
</span><span class="cx"> Optional<IntPoint> hotSpot() const;
</span><span class="cx">
</span><del>- IntSize frameSizeAtIndex(size_t, SubsamplingLevel) const;
</del><ins>+ IntSize frameSizeAtIndex(size_t, SubsamplingLevel = DefaultSubsamplingLevel) const;
</ins><span class="cx"> bool frameIsCompleteAtIndex(size_t) const;
</span><span class="cx"> ImageOrientation orientationAtIndex(size_t) const;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgNativeImageCGcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/graphics/cg/NativeImageCG.cpp (0 => 205682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/NativeImageCG.cpp         (rev 0)
+++ trunk/Source/WebCore/platform/graphics/cg/NativeImageCG.cpp        2016-09-09 01:06:47 UTC (rev 205682)
</span><span class="lines">@@ -0,0 +1,109 @@
</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 "config.h"
+#include "NativeImage.h"
+
+#if USE(CG)
+
+#include "Color.h"
+#include "CoreGraphicsSPI.h"
+#include "FloatRect.h"
+#include "GeometryUtilities.h"
+#include "GraphicsContextCG.h"
+#include "IntSize.h"
+#include "SubimageCacheWithTimer.h"
+
+#if PLATFORM(WIN)
+#include <WebKitSystemInterface/WebKitSystemInterface.h>
+#endif
+
+namespace WebCore {
+
+IntSize nativeImageSize(const NativeImagePtr& image)
+{
+ return image ? IntSize(CGImageGetWidth(image.get()), CGImageGetHeight(image.get())) : IntSize();
+}
+
+bool nativeImageHasAlpha(const NativeImagePtr&)
+{
+ // FIXME: Answer correctly the question: does the CGImageRef have alpha channnel?
+ return true;
+}
+
+Color nativeImageSinglePixelSolidColor(const NativeImagePtr& image)
+{
+ if (!image || nativeImageSize(image) != IntSize(1, 1))
+ return Color();
+
+ unsigned char pixel[4]; // RGBA
+ auto bitmapContext = adoptCF(CGBitmapContextCreate(pixel, 1, 1, 8, sizeof(pixel), sRGBColorSpaceRef(), kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big));
+
+ if (!bitmapContext)
+ return Color();
+
+ CGContextSetBlendMode(bitmapContext.get(), kCGBlendModeCopy);
+ CGContextDrawImage(bitmapContext.get(), CGRectMake(0, 0, 1, 1), image.get());
+
+ if (!pixel[3])
+ return Color(0, 0, 0, 0);
+
+ return Color(pixel[0] * 255 / pixel[3], pixel[1] * 255 / pixel[3], pixel[2] * 255 / pixel[3], pixel[3]);
+}
+
+float subsamplingScale(GraphicsContext& context, const FloatRect& destRect, const FloatRect& srcRect)
+{
+ // Never use subsampled images for drawing into PDF contexts.
+ if (wkCGContextIsPDFContext(context.platformContext()))
+ return 1;
+
+ CGRect transformedDestinationRect = CGRectApplyAffineTransform(destRect, CGContextGetCTM(context.platformContext()));
+ return std::min<float>(1, std::max(transformedDestinationRect.size.width / srcRect.width(), transformedDestinationRect.size.height / srcRect.height()));
+}
+
+void drawNativeImage(const NativeImagePtr& image, GraphicsContext& context, const FloatRect& destRect, const FloatRect& srcRect, const IntSize& srcSize, CompositeOperator op, BlendMode mode, const ImageOrientation& orientation)
+{
+ // Subsampling may have given us an image that is smaller than size().
+ IntSize subsampledImageSize = nativeImageSize(image);
+
+ // srcRect is in the coordinates of the unsubsampled image, so we have to map it to the subsampled image.
+ FloatRect adjustedSrcRect = srcRect;
+ if (subsampledImageSize != srcSize)
+ adjustedSrcRect = mapRect(srcRect, FloatRect({ }, srcSize), FloatRect({ }, subsampledImageSize));
+
+ context.drawNativeImage(image, subsampledImageSize, destRect, adjustedSrcRect, op, mode, orientation);
+}
+
+void clearNativeImageSubImages(const NativeImagePtr& image)
+{
+#if CACHE_SUBIMAGES
+ if (image)
+ subimageCache().clearImage(image.get());
+#endif
+}
+
+}
+
+#endif // USE(CG)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgPatternCGcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/PatternCG.cpp (205681 => 205682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/PatternCG.cpp        2016-09-09 00:55:43 UTC (rev 205681)
+++ trunk/Source/WebCore/platform/graphics/cg/PatternCG.cpp        2016-09-09 01:06:47 UTC (rev 205682)
</span><span class="lines">@@ -72,7 +72,7 @@
</span><span class="cx"> // If we're repeating in both directions, we can use image-backed patterns
</span><span class="cx"> // instead of custom patterns, and avoid tiling-edge pixel cracks.
</span><span class="cx"> if (m_repeatX && m_repeatY)
</span><del>- return wkCGPatternCreateWithImageAndTransform(tileImage()->getCGImageRef(), patternTransform, wkPatternTilingConstantSpacing);
</del><ins>+ return wkCGPatternCreateWithImageAndTransform(tileImage()->nativeImage().get(), patternTransform, wkPatternTilingConstantSpacing);
</ins><span class="cx">
</span><span class="cx"> // If FLT_MAX should also be used for xStep or yStep, nothing is rendered. Using fractions of FLT_MAX also
</span><span class="cx"> // result in nothing being rendered.
</span><span class="lines">@@ -83,7 +83,7 @@
</span><span class="cx"> CGFloat yStep = m_repeatY ? tileRect.height() : (1 << 22);
</span><span class="cx">
</span><span class="cx"> // The pattern will release the CGImageRef when it's done rendering in patternReleaseCallback
</span><del>- CGImageRef platformImage = CGImageRetain(tileImage()->getCGImageRef());
</del><ins>+ CGImageRef platformImage = tileImage()->nativeImage().leakRef();
</ins><span class="cx">
</span><span class="cx"> const CGPatternCallbacks patternCallbacks = { 0, patternCallback, patternReleaseCallback };
</span><span class="cx"> return CGPatternCreate(platformImage, tileRect, patternTransform, xStep, yStep, kCGPatternTilingConstantSpacing, TRUE, &patternCallbacks);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscocoaTextTrackRepresentationCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cocoa/TextTrackRepresentationCocoa.mm (205681 => 205682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cocoa/TextTrackRepresentationCocoa.mm        2016-09-09 00:55:43 UTC (rev 205681)
+++ trunk/Source/WebCore/platform/graphics/cocoa/TextTrackRepresentationCocoa.mm        2016-09-09 01:06:47 UTC (rev 205682)
</span><span class="lines">@@ -129,7 +129,7 @@
</span><span class="cx"> void TextTrackRepresentationCocoa::update()
</span><span class="cx"> {
</span><span class="cx"> if (auto representation = m_client.createTextTrackRepresentationImage())
</span><del>- [m_layer.get() setContents:(id)representation->getCGImageRef()];
</del><ins>+ [m_layer.get() setContents:(id)representation->nativeImage().get()];
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void TextTrackRepresentationCocoa::setContentScale(float scale)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacImageMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/ImageMac.mm (205681 => 205682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/ImageMac.mm        2016-09-09 00:55:43 UTC (rev 205681)
+++ trunk/Source/WebCore/platform/graphics/mac/ImageMac.mm        2016-09-09 01:06:47 UTC (rev 205682)
</span><span class="lines">@@ -79,31 +79,22 @@
</span><span class="cx"> if (m_tiffRep)
</span><span class="cx"> return m_tiffRep.get();
</span><span class="cx">
</span><del>- unsigned numFrames = frameCount();
</del><ins>+ auto nativeImages = this->framesNativeImages();
</ins><span class="cx">
</span><del>- // If numFrames is zero, we know for certain this image doesn't have valid data
</del><ins>+ // If framesImages.size() is zero, we know for certain this image doesn't have valid data
</ins><span class="cx"> // Even though the call to CGImageDestinationCreateWithData will fail and we'll handle it gracefully,
</span><span class="cx"> // in certain circumstances that call will spam the console with an error message
</span><del>- if (!numFrames)
- return 0;
</del><ins>+ if (!nativeImages.size())
+ return nullptr;
</ins><span class="cx">
</span><del>- Vector<CGImageRef> images;
- for (unsigned i = 0; i < numFrames; ++i ) {
- CGImageRef cgImage = frameImageAtIndex(i).get();
- if (cgImage)
- images.append(cgImage);
- }
-
- unsigned numValidFrames = images.size();
-
</del><span class="cx"> RetainPtr<CFMutableDataRef> data = adoptCF(CFDataCreateMutable(0, 0));
</span><del>- RetainPtr<CGImageDestinationRef> destination = adoptCF(CGImageDestinationCreateWithData(data.get(), kUTTypeTIFF, numValidFrames, 0));
</del><ins>+ RetainPtr<CGImageDestinationRef> destination = adoptCF(CGImageDestinationCreateWithData(data.get(), kUTTypeTIFF, nativeImages.size(), 0));
</ins><span class="cx">
</span><span class="cx"> if (!destination)
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx">
</span><del>- for (unsigned i = 0; i < numValidFrames; ++i)
- CGImageDestinationAddImage(destination.get(), images[i], 0);
</del><ins>+ for (auto nativeImage : nativeImages)
+ CGImageDestinationAddImage(destination.get(), nativeImage.get(), 0);
</ins><span class="cx">
</span><span class="cx"> CGImageDestinationFinalize(destination.get());
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreammacMockRealtimeVideoSourceMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/mac/MockRealtimeVideoSourceMac.mm (205681 => 205682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/mac/MockRealtimeVideoSourceMac.mm        2016-09-09 00:55:43 UTC (rev 205681)
+++ trunk/Source/WebCore/platform/mediastream/mac/MockRealtimeVideoSourceMac.mm        2016-09-09 01:06:47 UTC (rev 205682)
</span><span class="lines">@@ -142,7 +142,7 @@
</span><span class="cx"> if (!image)
</span><span class="cx"> break;
</span><span class="cx">
</span><del>- m_previewImage = image->getCGImageRef();
</del><ins>+ m_previewImage = image->nativeImage();
</ins><span class="cx"> if (!m_previewImage)
</span><span class="cx"> break;
</span><span class="cx">
</span><span class="lines">@@ -154,7 +154,7 @@
</span><span class="cx">
</span><span class="cx"> void MockRealtimeVideoSourceMac::updateSampleBuffer()
</span><span class="cx"> {
</span><del>- auto pixelBuffer = pixelBufferFromCGImage(imageBuffer()->copyImage()->getCGImageRef());
</del><ins>+ auto pixelBuffer = pixelBufferFromCGImage(imageBuffer()->copyImage()->nativeImage().get());
</ins><span class="cx"> auto sampleBuffer = CMSampleBufferFromPixelBuffer(pixelBuffer.get());
</span><span class="cx">
</span><span class="cx"> mediaDataUpdated(MediaSampleAVFObjC::create(sampleBuffer.get()));
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformwinDragImageCGWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/win/DragImageCGWin.cpp (205681 => 205682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/win/DragImageCGWin.cpp        2016-09-09 00:55:43 UTC (rev 205681)
+++ trunk/Source/WebCore/platform/win/DragImageCGWin.cpp        2016-09-09 01:06:47 UTC (rev 205682)
</span><span class="lines">@@ -136,9 +136,9 @@
</span><span class="cx"> CGContextScaleCTM(drawContext, 1, -1);
</span><span class="cx"> CGContextSetFillColor(drawContext, white);
</span><span class="cx"> CGContextFillRect(drawContext, rect);
</span><del>- if (auto srcImage = img->getCGImageRef()) {
</del><ins>+ if (auto srcImage = img->nativeImage()) {
</ins><span class="cx"> CGContextSetBlendMode(drawContext, kCGBlendModeNormal);
</span><del>- CGContextDrawImage(drawContext, rect, srcImage);
</del><ins>+ CGContextDrawImage(drawContext, rect, srcImage.get());
</ins><span class="cx"> }
</span><span class="cx"> CGContextRelease(drawContext);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (205681 => 205682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2016-09-09 00:55:43 UTC (rev 205681)
+++ trunk/Source/WebKit/mac/ChangeLog        2016-09-09 01:06:47 UTC (rev 205682)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2016-09-08 Said Abou-Hallawa <sabouhallawa@apple.com>
+
+ Move the BitmapImage platform dependent code to a new file named NativeImage[CG|Cairo].cpp
+ https://bugs.webkit.org/show_bug.cgi?id=158684
+
+ Reviewed by Simon Fraser.
+
+ * DOM/DOM.mm:
+ (-[DOMNode getPreviewSnapshotImage:andRects:]):
+ * Misc/WebCache.mm:
+ (+[WebCache imageForURL:]):
+ Replace BitmapImage::getCGImageRef() with BitmapImage::nativeImage().
+
</ins><span class="cx"> 2016-09-07 Joseph Pecoraro <pecoraro@apple.com>
</span><span class="cx">
</span><span class="cx"> [Mac] Address some clang static analyzer warnings in WebKit
</span></span></pre></div>
<a id="trunkSourceWebKitmacDOMDOMmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/DOM/DOM.mm (205681 => 205682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/DOM/DOM.mm        2016-09-09 00:55:43 UTC (rev 205681)
+++ trunk/Source/WebKit/mac/DOM/DOM.mm        2016-09-09 01:06:47 UTC (rev 205682)
</span><span class="lines">@@ -561,7 +561,7 @@
</span><span class="cx">
</span><span class="cx"> if (textIndicator) {
</span><span class="cx"> if (Image* image = textIndicator->contentImage())
</span><del>- *cgImage = (CGImageRef)CFAutorelease(CGImageRetain(image->getCGImageRef()));
</del><ins>+ *cgImage = image->nativeImage().autorelease();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> RetainPtr<NSMutableArray> rectArray = adoptNS([[NSMutableArray alloc] init]);
</span></span></pre></div>
<a id="trunkSourceWebKitmacMiscWebCachemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/Misc/WebCache.mm (205681 => 205682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/Misc/WebCache.mm        2016-09-09 00:55:43 UTC (rev 205681)
+++ trunk/Source/WebKit/mac/Misc/WebCache.mm        2016-09-09 01:06:47 UTC (rev 205682)
</span><span class="lines">@@ -204,7 +204,7 @@
</span><span class="cx"> WebCore::CachedImage& cachedImage = downcast<WebCore::CachedImage>(*cachedResource);
</span><span class="cx"> if (!cachedImage.hasImage())
</span><span class="cx"> return nullptr;
</span><del>- return cachedImage.image()->getCGImageRef();
</del><ins>+ return cachedImage.image()->nativeImage().get();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #endif // PLATFORM(IOS)
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (205681 => 205682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-09-09 00:55:43 UTC (rev 205681)
+++ trunk/Source/WebKit2/ChangeLog        2016-09-09 01:06:47 UTC (rev 205682)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2016-09-08 Said Abou-Hallawa <sabouhallawa@apple.com>
+
+ Move the BitmapImage platform dependent code to a new file named NativeImage[CG|Cairo].cpp
+ https://bugs.webkit.org/show_bug.cgi?id=158684
+
+ Reviewed by Simon Fraser.
+
+ * UIProcess/API/C/cg/WKIconDatabaseCG.cpp:
+ (WKIconDatabaseTryGetCGImageForURL):
+ (WKIconDatabaseTryCopyCGImageArrayForURL):
+ It was the only place in the code which uses BitmapImage::getCGImageArray().
+ Call BitmapImage::framesNativeImages() instead and form the returned
+ Vector<NativeImagePtr> build the CFArrayRef.
+
+ * UIProcess/WebIconDatabase.h:
+ Include "NativeImage.h" instead of "NativeImagePtr.h".
+
+ * UIProcess/ios/WKContentViewInteraction.mm:
+ (-[WKContentView _presentationSnapshotForPreviewItemController:]):
+ * WebProcess/Plugins/PluginView.cpp:
+ (WebKit::isAlmostSolidColor):
+ Call BitmapImage::getCGImageRef() instead of calling BitmapImage::nativeImage().
+
</ins><span class="cx"> 2016-09-08 Zan Dobersek <zdobersek@igalia.com>
</span><span class="cx">
</span><span class="cx"> Move webkit2gtk.pc.in, webkit2gtk-web-extension.pc.in files under Source/WebKit2/gtk/
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICcgWKIconDatabaseCGcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/cg/WKIconDatabaseCG.cpp (205681 => 205682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/cg/WKIconDatabaseCG.cpp        2016-09-09 00:55:43 UTC (rev 205681)
+++ trunk/Source/WebKit2/UIProcess/API/C/cg/WKIconDatabaseCG.cpp        2016-09-09 01:06:47 UTC (rev 205682)
</span><span class="lines">@@ -37,12 +37,23 @@
</span><span class="cx"> CGImageRef WKIconDatabaseTryGetCGImageForURL(WKIconDatabaseRef iconDatabaseRef, WKURLRef urlRef, WKSize size)
</span><span class="cx"> {
</span><span class="cx"> Image* image = toImpl(iconDatabaseRef)->imageForPageURL(toWTFString(urlRef));
</span><del>- return image ? image->getFirstCGImageRefOfSize(IntSize(static_cast<int>(size.width), static_cast<int>(size.height))) : 0;
</del><ins>+ return image ? image->nativeImageOfSize(IntSize(static_cast<int>(size.width), static_cast<int>(size.height))).get() : nullptr;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> CFArrayRef WKIconDatabaseTryCopyCGImageArrayForURL(WKIconDatabaseRef iconDatabaseRef, WKURLRef urlRef)
</span><span class="cx"> {
</span><span class="cx"> Image* image = toImpl(iconDatabaseRef)->imageForPageURL(toWTFString(urlRef));
</span><del>- return image ? image->getCGImageArray().leakRef() : 0;
</del><ins>+ if (!image)
+ return nullptr;
+
+ auto nativeImages = image->framesNativeImages();
+ if (!nativeImages.size())
+ return nullptr;
+
+ CFMutableArrayRef array = CFArrayCreateMutable(nullptr, nativeImages.size(), &kCFTypeArrayCallBacks);
+ for (auto nativeImage : nativeImages)
+ CFArrayAppendValue(array, nativeImage.get());
+
+ return static_cast<CFArrayRef>(CFRetain(array));
</ins><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebIconDatabaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebIconDatabase.h (205681 => 205682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebIconDatabase.h        2016-09-09 00:55:43 UTC (rev 205681)
+++ trunk/Source/WebKit2/UIProcess/WebIconDatabase.h        2016-09-09 01:06:47 UTC (rev 205682)
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx"> #include "WebIconDatabaseClient.h"
</span><span class="cx"> #include <WebCore/IconDatabaseClient.h>
</span><span class="cx"> #include <WebCore/IntSize.h>
</span><del>-#include <WebCore/NativeImagePtr.h>
</del><ins>+#include <WebCore/NativeImage.h>
</ins><span class="cx">
</span><span class="cx"> namespace API {
</span><span class="cx"> class Data;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWKContentViewInteractionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm (205681 => 205682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm        2016-09-09 00:55:43 UTC (rev 205681)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm        2016-09-09 01:06:47 UTC (rev 205682)
</span><span class="lines">@@ -4131,7 +4131,7 @@
</span><span class="cx"> {
</span><span class="cx"> if (!_positionInformation.linkIndicator.contentImage)
</span><span class="cx"> return nullptr;
</span><del>- return [[[UIImage alloc] initWithCGImage:_positionInformation.linkIndicator.contentImage->getCGImageRef()] autorelease];
</del><ins>+ return [[[UIImage alloc] initWithCGImage:_positionInformation.linkIndicator.contentImage->nativeImage().get()] autorelease];
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (NSArray *)_presentationRectsForPreviewItemController:(UIPreviewItemController *)controller
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessPluginsPluginViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp (205681 => 205682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp        2016-09-09 00:55:43 UTC (rev 205681)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp        2016-09-09 01:06:47 UTC (rev 205682)
</span><span class="lines">@@ -1730,7 +1730,7 @@
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx"> static bool isAlmostSolidColor(BitmapImage* bitmap)
</span><span class="cx"> {
</span><del>- CGImageRef image = bitmap->getCGImageRef();
</del><ins>+ CGImageRef image = bitmap->nativeImage().get();
</ins><span class="cx"> ASSERT(CGImageGetBitsPerComponent(image) == 8);
</span><span class="cx">
</span><span class="cx"> CGBitmapInfo imageInfo = CGImageGetBitmapInfo(image);
</span></span></pre>
</div>
</div>
</body>
</html>