<!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>[192701] 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/192701">192701</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2015-11-20 14:55:56 -0800 (Fri, 20 Nov 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Allow more buffer formats in the IOSurface pool
https://bugs.webkit.org/show_bug.cgi?id=151516

Reviewed by Tim Horton.
Source/WebCore:

Previously IOSurface::create was only looking in the pool for RGBA-format surfaces. Change that to
always look in the pool, and to cache all format types. We include format in the criteria used
to pick a surface from the pool.

* platform/graphics/cg/IOSurfacePool.cpp:
(WebCore::surfaceMatchesParameters):
(WebCore::IOSurfacePool::takeSurface):
(WebCore::IOSurfacePool::shouldCacheFormat):
(WebCore::IOSurfacePool::shouldCacheSurface):
(WebCore::IOSurfacePool::addSurface):
* platform/graphics/cg/IOSurfacePool.h:
* platform/graphics/cocoa/IOSurface.h:
* platform/graphics/cocoa/IOSurface.mm:
(IOSurface::surfaceFromPool):
(IOSurface::create):
(IOSurface::IOSurface):

Source/WebKit2:

Have RemoteLayerBackingStore go through a static function on IOSurface to return
a surface to the pool, rather than knowing about IOSurfacePool directly.

* Shared/mac/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::Buffer::discard):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgIOSurfacePoolcpp">trunk/Source/WebCore/platform/graphics/cg/IOSurfacePool.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgIOSurfacePoolh">trunk/Source/WebCore/platform/graphics/cg/IOSurfacePool.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscocoaIOSurfaceh">trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscocoaIOSurfacemm">trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.mm</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedmacRemoteLayerBackingStoremm">trunk/Source/WebKit2/Shared/mac/RemoteLayerBackingStore.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (192700 => 192701)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-11-20 22:35:01 UTC (rev 192700)
+++ trunk/Source/WebCore/ChangeLog        2015-11-20 22:55:56 UTC (rev 192701)
</span><span class="lines">@@ -1,3 +1,27 @@
</span><ins>+2015-11-20  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+        Allow more buffer formats in the IOSurface pool
+        https://bugs.webkit.org/show_bug.cgi?id=151516
+
+        Reviewed by Tim Horton.
+
+        Previously IOSurface::create was only looking in the pool for RGBA-format surfaces. Change that to
+        always look in the pool, and to cache all format types. We include format in the criteria used
+        to pick a surface from the pool.
+        
+        * platform/graphics/cg/IOSurfacePool.cpp:
+        (WebCore::surfaceMatchesParameters):
+        (WebCore::IOSurfacePool::takeSurface):
+        (WebCore::IOSurfacePool::shouldCacheFormat):
+        (WebCore::IOSurfacePool::shouldCacheSurface):
+        (WebCore::IOSurfacePool::addSurface):
+        * platform/graphics/cg/IOSurfacePool.h:
+        * platform/graphics/cocoa/IOSurface.h:
+        * platform/graphics/cocoa/IOSurface.mm:
+        (IOSurface::surfaceFromPool):
+        (IOSurface::create):
+        (IOSurface::IOSurface):
+
</ins><span class="cx"> 2015-11-20  Brent Fulgham  &lt;bfulgham@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Win] Support High DPI drawing with CACFLayers
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgIOSurfacePoolcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/IOSurfacePool.cpp (192700 => 192701)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/IOSurfacePool.cpp        2015-11-20 22:35:01 UTC (rev 192700)
+++ trunk/Source/WebCore/platform/graphics/cg/IOSurfacePool.cpp        2015-11-20 22:55:56 UTC (rev 192701)
</span><span class="lines">@@ -29,7 +29,6 @@
</span><span class="cx"> #if USE(IOSURFACE)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;GraphicsContextCG.h&quot;
</span><del>-#include &quot;IOSurface.h&quot;
</del><span class="cx"> #include &lt;CoreGraphics/CoreGraphics.h&gt;
</span><span class="cx"> #include &lt;chrono&gt;
</span><span class="cx"> #include &lt;wtf/NeverDestroyed.h&gt;
</span><span class="lines">@@ -65,12 +64,13 @@
</span><span class="cx">     return pool;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool surfaceMatchesParameters(IOSurface&amp; surface, const IntSize&amp; requestedSize, ColorSpace colorSpace)
</del><ins>+static bool surfaceMatchesParameters(IOSurface&amp; surface, IntSize requestedSize, ColorSpace colorSpace, IOSurface::Format format)
</ins><span class="cx"> {
</span><del>-    IntSize surfaceSize = surface.size();
</del><ins>+    if (format != surface.format())
+        return false;
</ins><span class="cx">     if (colorSpace != surface.colorSpace())
</span><span class="cx">         return false;
</span><del>-    if (surfaceSize != requestedSize)
</del><ins>+    if (requestedSize != surface.size())
</ins><span class="cx">         return false;
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="lines">@@ -107,7 +107,7 @@
</span><span class="cx">     m_sizesInPruneOrder.append(size);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-std::unique_ptr&lt;IOSurface&gt; IOSurfacePool::takeSurface(IntSize size, ColorSpace colorSpace)
</del><ins>+std::unique_ptr&lt;IOSurface&gt; IOSurfacePool::takeSurface(IntSize size, ColorSpace colorSpace, IOSurface::Format format)
</ins><span class="cx"> {
</span><span class="cx">     CachedSurfaceMap::iterator mapIter = m_cachedSurfaces.find(size);
</span><span class="cx"> 
</span><span class="lines">@@ -117,7 +117,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     for (auto surfaceIter = mapIter-&gt;value.begin(); surfaceIter != mapIter-&gt;value.end(); ++surfaceIter) {
</span><del>-        if (!surfaceMatchesParameters(*surfaceIter-&gt;get(), size, colorSpace))
</del><ins>+        if (!surfaceMatchesParameters(*surfaceIter-&gt;get(), size, colorSpace, format))
</ins><span class="cx">             continue;
</span><span class="cx"> 
</span><span class="cx">         auto surface = WTF::move(*surfaceIter);
</span><span class="lines">@@ -140,7 +140,7 @@
</span><span class="cx"> 
</span><span class="cx">     // Some of the in-use surfaces may no longer actually be in-use, but we haven't moved them over yet.
</span><span class="cx">     for (auto surfaceIter = m_inUseSurfaces.begin(); surfaceIter != m_inUseSurfaces.end(); ++surfaceIter) {
</span><del>-        if (!surfaceMatchesParameters(*surfaceIter-&gt;get(), size, colorSpace))
</del><ins>+        if (!surfaceMatchesParameters(*surfaceIter-&gt;get(), size, colorSpace, format))
</ins><span class="cx">             continue;
</span><span class="cx">         if (surfaceIter-&gt;get()-&gt;isInUse())
</span><span class="cx">             continue;
</span><span class="lines">@@ -159,14 +159,22 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void IOSurfacePool::addSurface(std::unique_ptr&lt;IOSurface&gt; surface)
</del><ins>+bool IOSurfacePool::shouldCacheSurface(const IOSurface&amp; surface) const
</ins><span class="cx"> {
</span><del>-    if (surface-&gt;totalBytes() &gt; m_maximumBytesCached)
-        return;
</del><ins>+    if (surface.totalBytes() &gt; m_maximumBytesCached)
+        return false;
</ins><span class="cx"> 
</span><span class="cx">     // There's no reason to pool empty surfaces; we should never allocate them in the first place.
</span><span class="cx">     // This also covers isZero(), which would cause trouble when used as the key in m_cachedSurfaces.
</span><del>-    if (surface-&gt;size().isEmpty())
</del><ins>+    if (surface.size().isEmpty())
+        return false;
+
+    return true;
+}
+
+void IOSurfacePool::addSurface(std::unique_ptr&lt;IOSurface&gt; surface)
+{
+    if (!shouldCacheSurface(*surface))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     bool surfaceIsInUse = surface-&gt;isInUse();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgIOSurfacePoolh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/IOSurfacePool.h (192700 => 192701)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/IOSurfacePool.h        2015-11-20 22:35:01 UTC (rev 192700)
+++ trunk/Source/WebCore/platform/graphics/cg/IOSurfacePool.h        2015-11-20 22:55:56 UTC (rev 192701)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #define IOSurfacePool_h
</span><span class="cx"> 
</span><span class="cx"> #include &quot;ColorSpace.h&quot;
</span><ins>+#include &quot;IOSurface.h&quot;
</ins><span class="cx"> #include &quot;IntSize.h&quot;
</span><span class="cx"> #include &quot;IntSizeHash.h&quot;
</span><span class="cx"> #include &quot;Timer.h&quot;
</span><span class="lines">@@ -39,8 +40,6 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class IOSurface;
-
</del><span class="cx"> class IOSurfacePool {
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(IOSurfacePool);
</span><span class="cx">     WTF_MAKE_FAST_ALLOCATED;
</span><span class="lines">@@ -49,7 +48,7 @@
</span><span class="cx"> public:
</span><span class="cx">     WEBCORE_EXPORT static IOSurfacePool&amp; sharedPool();
</span><span class="cx"> 
</span><del>-    std::unique_ptr&lt;IOSurface&gt; takeSurface(IntSize, ColorSpace);
</del><ins>+    std::unique_ptr&lt;IOSurface&gt; takeSurface(IntSize, ColorSpace, IOSurface::Format);
</ins><span class="cx">     WEBCORE_EXPORT void addSurface(std::unique_ptr&lt;IOSurface&gt;);
</span><span class="cx"> 
</span><span class="cx">     void discardAllSurfaces();
</span><span class="lines">@@ -75,6 +74,8 @@
</span><span class="cx">     typedef Deque&lt;std::unique_ptr&lt;IOSurface&gt;&gt; CachedSurfaceQueue;
</span><span class="cx">     typedef HashMap&lt;IntSize, CachedSurfaceQueue&gt; CachedSurfaceMap;
</span><span class="cx">     typedef HashMap&lt;IOSurface*, CachedSurfaceDetails&gt; CachedSurfaceDetailsMap;
</span><ins>+    
+    bool shouldCacheSurface(const IOSurface&amp;) const;
</ins><span class="cx"> 
</span><span class="cx">     void willAddSurface(IOSurface&amp;, bool inUse);
</span><span class="cx">     void didRemoveSurface(IOSurface&amp;, bool inUse);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscocoaIOSurfaceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.h (192700 => 192701)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.h        2015-11-20 22:35:01 UTC (rev 192700)
+++ trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.h        2015-11-20 22:55:56 UTC (rev 192701)
</span><span class="lines">@@ -46,11 +46,13 @@
</span><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT static std::unique_ptr&lt;IOSurface&gt; create(IntSize, ColorSpace, Format = Format::RGBA);
</span><del>-    WEBCORE_EXPORT static std::unique_ptr&lt;IOSurface&gt; create(IntSize, IntSize contextSize, ColorSpace);
</del><ins>+    WEBCORE_EXPORT static std::unique_ptr&lt;IOSurface&gt; create(IntSize, IntSize contextSize, ColorSpace, Format = Format::RGBA);
</ins><span class="cx">     WEBCORE_EXPORT static std::unique_ptr&lt;IOSurface&gt; createFromSendRight(const MachSendRight&amp;, ColorSpace);
</span><span class="cx">     static std::unique_ptr&lt;IOSurface&gt; createFromSurface(IOSurfaceRef, ColorSpace);
</span><span class="cx">     WEBCORE_EXPORT static std::unique_ptr&lt;IOSurface&gt; createFromImage(CGImageRef);
</span><span class="cx"> 
</span><ins>+    WEBCORE_EXPORT static void moveToPool(std::unique_ptr&lt;IOSurface&gt;&amp;&amp;);
+
</ins><span class="cx">     static IntSize maximumSize();
</span><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT MachSendRight createSendRight() const;
</span><span class="lines">@@ -95,10 +97,10 @@
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     IOSurface(IntSize, ColorSpace, Format);
</span><del>-    IOSurface(IntSize, IntSize contextSize, ColorSpace);
</del><ins>+    IOSurface(IntSize, IntSize contextSize, ColorSpace, Format);
</ins><span class="cx">     IOSurface(IOSurfaceRef, ColorSpace);
</span><span class="cx"> 
</span><del>-    static std::unique_ptr&lt;IOSurface&gt; surfaceFromPool(IntSize, IntSize contextSize, ColorSpace);
</del><ins>+    static std::unique_ptr&lt;IOSurface&gt; surfaceFromPool(IntSize, IntSize contextSize, ColorSpace, Format);
</ins><span class="cx">     IntSize contextSize() const { return m_contextSize; }
</span><span class="cx">     void setContextSize(IntSize);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscocoaIOSurfacemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.mm (192700 => 192701)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.mm        2015-11-20 22:35:01 UTC (rev 192700)
+++ trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.mm        2015-11-20 22:55:56 UTC (rev 192701)
</span><span class="lines">@@ -41,9 +41,9 @@
</span><span class="cx"> 
</span><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><del>-inline std::unique_ptr&lt;IOSurface&gt; IOSurface::surfaceFromPool(IntSize size, IntSize contextSize, ColorSpace colorSpace)
</del><ins>+inline std::unique_ptr&lt;IOSurface&gt; IOSurface::surfaceFromPool(IntSize size, IntSize contextSize, ColorSpace colorSpace, Format pixelFormat)
</ins><span class="cx"> {
</span><del>-    auto cachedSurface = IOSurfacePool::sharedPool().takeSurface(size, colorSpace);
</del><ins>+    auto cachedSurface = IOSurfacePool::sharedPool().takeSurface(size, colorSpace, pixelFormat);
</ins><span class="cx">     if (!cachedSurface)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="lines">@@ -53,21 +53,17 @@
</span><span class="cx"> 
</span><span class="cx"> std::unique_ptr&lt;IOSurface&gt; IOSurface::create(IntSize size, ColorSpace colorSpace, Format pixelFormat)
</span><span class="cx"> {
</span><del>-    // YUV422 IOSurfaces do not go in the pool.
-    // FIXME: Want pooling of RGB10, RGB10A8.
-    if (pixelFormat == Format::RGBA) {
-        if (auto cachedSurface = surfaceFromPool(size, size, colorSpace))
-            return cachedSurface;
-    }
</del><ins>+    if (auto cachedSurface = surfaceFromPool(size, size, colorSpace, pixelFormat))
+        return cachedSurface;
</ins><span class="cx"> 
</span><span class="cx">     return std::unique_ptr&lt;IOSurface&gt;(new IOSurface(size, colorSpace, pixelFormat));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-std::unique_ptr&lt;IOSurface&gt; IOSurface::create(IntSize size, IntSize contextSize, ColorSpace colorSpace)
</del><ins>+std::unique_ptr&lt;IOSurface&gt; IOSurface::create(IntSize size, IntSize contextSize, ColorSpace colorSpace, Format pixelFormat)
</ins><span class="cx"> {
</span><del>-    if (auto cachedSurface = surfaceFromPool(size, contextSize, colorSpace))
</del><ins>+    if (auto cachedSurface = surfaceFromPool(size, contextSize, colorSpace, pixelFormat))
</ins><span class="cx">         return cachedSurface;
</span><del>-    return std::unique_ptr&lt;IOSurface&gt;(new IOSurface(size, contextSize, colorSpace));
</del><ins>+    return std::unique_ptr&lt;IOSurface&gt;(new IOSurface(size, contextSize, colorSpace, pixelFormat));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> std::unique_ptr&lt;IOSurface&gt; IOSurface::createFromSendRight(const MachSendRight&amp; sendRight, ColorSpace colorSpace)
</span><span class="lines">@@ -97,6 +93,11 @@
</span><span class="cx">     return surface;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void IOSurface::moveToPool(std::unique_ptr&lt;IOSurface&gt;&amp;&amp; surface)
+{
+    IOSurfacePool::sharedPool().addSurface(WTF::move(surface));
+}
+
</ins><span class="cx"> IOSurface::IOSurface(IntSize size, ColorSpace colorSpace, Format format)
</span><span class="cx">     : m_colorSpace(colorSpace)
</span><span class="cx">     , m_size(size)
</span><span class="lines">@@ -212,8 +213,8 @@
</span><span class="cx">         NSLog(@&quot;Surface creation failed for options %@&quot;, options);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-IOSurface::IOSurface(IntSize size, IntSize contextSize, ColorSpace colorSpace)
-    : IOSurface(size, colorSpace, Format::RGBA)
</del><ins>+IOSurface::IOSurface(IntSize size, IntSize contextSize, ColorSpace colorSpace, Format pixelFormat)
+    : IOSurface(size, colorSpace, pixelFormat)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(contextSize.width() &lt;= size.width());
</span><span class="cx">     ASSERT(contextSize.height() &lt;= size.height());
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (192700 => 192701)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-11-20 22:35:01 UTC (rev 192700)
+++ trunk/Source/WebKit2/ChangeLog        2015-11-20 22:55:56 UTC (rev 192701)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2015-11-20  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+        Allow more buffer formats in the IOSurface pool
+        https://bugs.webkit.org/show_bug.cgi?id=151516
+
+        Reviewed by Tim Horton.
+        
+        Have RemoteLayerBackingStore go through a static function on IOSurface to return
+        a surface to the pool, rather than knowing about IOSurfacePool directly.
+
+        * Shared/mac/RemoteLayerBackingStore.mm:
+        (WebKit::RemoteLayerBackingStore::Buffer::discard):
+
</ins><span class="cx"> 2015-11-20  Alex Christensen  &lt;achristensen@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove NETWORK_PROCESS compile flag
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedmacRemoteLayerBackingStoremm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/mac/RemoteLayerBackingStore.mm (192700 => 192701)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/mac/RemoteLayerBackingStore.mm        2015-11-20 22:35:01 UTC (rev 192700)
+++ trunk/Source/WebKit2/Shared/mac/RemoteLayerBackingStore.mm        2015-11-20 22:55:56 UTC (rev 192701)
</span><span class="lines">@@ -36,7 +36,6 @@
</span><span class="cx"> #import &lt;QuartzCore/QuartzCore.h&gt;
</span><span class="cx"> #import &lt;WebCore/GraphicsContextCG.h&gt;
</span><span class="cx"> #import &lt;WebCore/IOSurface.h&gt;
</span><del>-#import &lt;WebCore/IOSurfacePool.h&gt;
</del><span class="cx"> #import &lt;WebCore/MachSendRight.h&gt;
</span><span class="cx"> #import &lt;WebCore/QuartzCoreSPI.h&gt;
</span><span class="cx"> #import &lt;WebCore/WebLayer.h&gt;
</span><span class="lines">@@ -469,7 +468,7 @@
</span><span class="cx"> {
</span><span class="cx"> #if USE(IOSURFACE)
</span><span class="cx">     if (surface)
</span><del>-        IOSurfacePool::sharedPool().addSurface(WTF::move(surface));
</del><ins>+        IOSurface::moveToPool(WTF::move(surface));
</ins><span class="cx">     isVolatile = false;
</span><span class="cx"> #endif
</span><span class="cx">     bitmap = nullptr;
</span></span></pre>
</div>
</div>

</body>
</html>