<!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>[187602] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/187602">187602</a></dd>
<dt>Author</dt> <dd>achristensen@apple.com</dd>
<dt>Date</dt> <dd>2015-07-30 13:20:55 -0700 (Thu, 30 Jul 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Remove LegacyCACFLayerTreeHost
https://bugs.webkit.org/show_bug.cgi?id=147388

Reviewed by Geoffrey Garen.

* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* platform/graphics/ca/win/CACFLayerTreeHost.cpp:
(WebCore::CACFLayerTreeHost::create):
* platform/graphics/ca/win/LegacyCACFLayerTreeHost.cpp: Removed.
* platform/graphics/ca/win/LegacyCACFLayerTreeHost.h: Removed.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscawinCACFLayerTreeHostcpp">trunk/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformgraphicscawinLegacyCACFLayerTreeHostcpp">trunk/Source/WebCore/platform/graphics/ca/win/LegacyCACFLayerTreeHost.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscawinLegacyCACFLayerTreeHosth">trunk/Source/WebCore/platform/graphics/ca/win/LegacyCACFLayerTreeHost.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (187601 => 187602)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-07-30 20:15:31 UTC (rev 187601)
+++ trunk/Source/WebCore/ChangeLog        2015-07-30 20:20:55 UTC (rev 187602)
</span><span class="lines">@@ -1,5 +1,19 @@
</span><span class="cx"> 2015-07-30  Alex Christensen  &lt;achristensen@webkit.org&gt;
</span><span class="cx"> 
</span><ins>+        Remove LegacyCACFLayerTreeHost
+        https://bugs.webkit.org/show_bug.cgi?id=147388
+
+        Reviewed by Geoffrey Garen.
+
+        * WebCore.vcxproj/WebCore.vcxproj:
+        * WebCore.vcxproj/WebCore.vcxproj.filters:
+        * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
+        (WebCore::CACFLayerTreeHost::create):
+        * platform/graphics/ca/win/LegacyCACFLayerTreeHost.cpp: Removed.
+        * platform/graphics/ca/win/LegacyCACFLayerTreeHost.h: Removed.
+
+2015-07-30  Alex Christensen  &lt;achristensen@webkit.org&gt;
+
</ins><span class="cx">         Fix Windows build after r187587.
</span><span class="cx"> 
</span><span class="cx">         * loader/SubresourceLoader.h:
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (187601 => 187602)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2015-07-30 20:15:31 UTC (rev 187601)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2015-07-30 20:20:55 UTC (rev 187602)
</span><span class="lines">@@ -8773,12 +8773,6 @@
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><del>-    &lt;ClCompile Include=&quot;..\platform\graphics\ca\win\LegacyCACFLayerTreeHost.cpp&quot;&gt;
-      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
-      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
-      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
-      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
-    &lt;/ClCompile&gt;
</del><span class="cx">     &lt;ClCompile Include=&quot;..\platform\graphics\ca\win\PlatformCAAnimationWin.cpp&quot;&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="lines">@@ -20529,7 +20523,6 @@
</span><span class="cx">     &lt;CustomBuildStep Include=&quot;..\platform\graphics\ca\win\CACFLayerTreeHost.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\platform\graphics\ca\win\CACFLayerTreeHostClient.h&quot; /&gt;
</span><span class="cx">     &lt;CustomBuildStep Include=&quot;..\platform\graphics\ca\win\LayerChangesFlusher.h&quot; /&gt;
</span><del>-    &lt;ClInclude Include=&quot;..\platform\graphics\ca\win\LegacyCACFLayerTreeHost.h&quot; /&gt;
</del><span class="cx">     &lt;ClInclude Include=&quot;..\platform\graphics\ca\win\PlatformCALayerWinInternal.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\platform\graphics\ca\win\WKCACFViewLayerTreeHost.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\platform\graphics\avfoundation\MediaPlayerPrivateAVFoundation.h&quot; /&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (187601 => 187602)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2015-07-30 20:15:31 UTC (rev 187601)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2015-07-30 20:20:55 UTC (rev 187602)
</span><span class="lines">@@ -1731,9 +1731,6 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\platform\graphics\ca\win\LayerChangesFlusher.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;platform\graphics\ca\win&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><del>-    &lt;ClCompile Include=&quot;..\platform\graphics\ca\win\LegacyCACFLayerTreeHost.cpp&quot;&gt;
-      &lt;Filter&gt;platform\graphics\ca\win&lt;/Filter&gt;
-    &lt;/ClCompile&gt;
</del><span class="cx">     &lt;ClCompile Include=&quot;..\platform\graphics\ca\win\PlatformCAAnimationWin.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;platform\graphics\ca\win&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><span class="lines">@@ -8741,9 +8738,6 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\platform\graphics\ca\win\CACFLayerTreeHostClient.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;platform\graphics\ca\win&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><del>-    &lt;ClInclude Include=&quot;..\platform\graphics\ca\win\LegacyCACFLayerTreeHost.h&quot;&gt;
-      &lt;Filter&gt;platform\graphics\ca\win&lt;/Filter&gt;
-    &lt;/ClInclude&gt;
</del><span class="cx">     &lt;ClInclude Include=&quot;..\platform\graphics\ca\win\PlatformCALayerWinInternal.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;platform\graphics\ca\win&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscawinCACFLayerTreeHostcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp (187601 => 187602)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp        2015-07-30 20:15:31 UTC (rev 187601)
+++ trunk/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp        2015-07-30 20:20:55 UTC (rev 187602)
</span><span class="lines">@@ -29,7 +29,6 @@
</span><span class="cx"> #include &quot;CACFLayerTreeHostClient.h&quot;
</span><span class="cx"> #include &quot;DefWndProcWindowClass.h&quot;
</span><span class="cx"> #include &quot;LayerChangesFlusher.h&quot;
</span><del>-#include &quot;LegacyCACFLayerTreeHost.h&quot;
</del><span class="cx"> #include &quot;PlatformCALayerWin.h&quot;
</span><span class="cx"> #include &quot;WKCACFViewLayerTreeHost.h&quot;
</span><span class="cx"> #include &quot;WebCoreInstanceHandle.h&quot;
</span><span class="lines">@@ -113,8 +112,6 @@
</span><span class="cx">     if (!acceleratedCompositingAvailable())
</span><span class="cx">         return 0;
</span><span class="cx">     RefPtr&lt;CACFLayerTreeHost&gt; host = WKCACFViewLayerTreeHost::create();
</span><del>-    if (!host)
-        host = LegacyCACFLayerTreeHost::create();
</del><span class="cx">     host-&gt;initialize();
</span><span class="cx">     return host.release();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscawinLegacyCACFLayerTreeHostcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/ca/win/LegacyCACFLayerTreeHost.cpp (187601 => 187602)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/win/LegacyCACFLayerTreeHost.cpp        2015-07-30 20:15:31 UTC (rev 187601)
+++ trunk/Source/WebCore/platform/graphics/ca/win/LegacyCACFLayerTreeHost.cpp        2015-07-30 20:20:55 UTC (rev 187602)
</span><span class="lines">@@ -1,398 +0,0 @@
</span><del>-/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include &quot;config.h&quot;
-#include &quot;LegacyCACFLayerTreeHost.h&quot;
-
-#include &quot;PlatformCALayer.h&quot;
-#include &lt;QuartzCore/CABase.h&gt;
-#include &lt;WebKitSystemInterface/WebKitSystemInterface.h&gt;
-
-#ifndef NDEBUG
-#define D3D_DEBUG_INFO
-#endif
-
-#include &lt;d3d9.h&gt;
-#include &lt;d3dx9.h&gt;
-
-#pragma comment(lib, &quot;d3d9&quot;)
-#pragma comment(lib, &quot;d3dx9&quot;)
-
-using namespace std;
-
-namespace WebCore {
-
-static IDirect3D9* s_d3d = 0;
-static IDirect3D9* d3d()
-{
-    if (s_d3d)
-        return s_d3d;
-
-    if (!LoadLibrary(TEXT(&quot;d3d9.dll&quot;)))
-        return 0;
-
-    s_d3d = Direct3DCreate9(D3D_SDK_VERSION);
-
-    return s_d3d;
-}
-
-static D3DPRESENT_PARAMETERS initialPresentationParameters()
-{
-    D3DPRESENT_PARAMETERS parameters = {0};
-    parameters.Windowed = TRUE;
-    parameters.SwapEffect = D3DSWAPEFFECT_COPY;
-    parameters.BackBufferCount = 1;
-    parameters.BackBufferFormat = D3DFMT_A8R8G8B8;
-    parameters.MultiSampleType = D3DMULTISAMPLE_NONE;
-
-    return parameters;
-}
-
-// FIXME: &lt;rdar://6507851&gt; Share this code with CoreAnimation.
-static bool hardwareCapabilitiesIndicateCoreAnimationSupport(const D3DCAPS9&amp; caps)
-{
-    // CoreAnimation needs two or more texture units.
-    if (caps.MaxTextureBlendStages &lt; 2)
-        return false;
-
-    // CoreAnimation needs non-power-of-two textures.
-    if ((caps.TextureCaps &amp; D3DPTEXTURECAPS_POW2) &amp;&amp; !(caps.TextureCaps &amp; D3DPTEXTURECAPS_NONPOW2CONDITIONAL))
-        return false;
-
-    // CoreAnimation needs vertex shader 2.0 or greater.
-    if (D3DSHADER_VERSION_MAJOR(caps.VertexShaderVersion) &lt; 2)
-        return false;
-
-    // CoreAnimation needs pixel shader 2.0 or greater.
-    if (D3DSHADER_VERSION_MAJOR(caps.PixelShaderVersion) &lt; 2)
-        return false;
-
-    return true;
-}
-
-PassRefPtr&lt;LegacyCACFLayerTreeHost&gt; LegacyCACFLayerTreeHost::create()
-{
-    return adoptRef(new LegacyCACFLayerTreeHost);
-}
-
-LegacyCACFLayerTreeHost::LegacyCACFLayerTreeHost()
-    : m_renderTimer(*this, &amp;LegacyCACFLayerTreeHost::renderTimerFired)
-    , m_context(wkCACFContextCreate())
-    , m_mightBeAbleToCreateDeviceLater(true)
-    , m_mustResetLostDeviceBeforeRendering(false)
-{
-#ifndef NDEBUG
-    char* printTreeFlag = getenv(&quot;CA_PRINT_TREE&quot;);
-    m_printTree = printTreeFlag &amp;&amp; atoi(printTreeFlag);
-#endif
-}
-
-LegacyCACFLayerTreeHost::~LegacyCACFLayerTreeHost()
-{
-    wkCACFContextDestroy(m_context);
-}
-
-void LegacyCACFLayerTreeHost::initializeContext(void* userData, PlatformCALayer* layer)
-{
-    wkCACFContextSetUserData(m_context, userData);
-    wkCACFContextSetLayer(m_context, layer-&gt;platformLayer());
-}
-
-bool LegacyCACFLayerTreeHost::createRenderer()
-{
-    if (m_d3dDevice || !m_mightBeAbleToCreateDeviceLater)
-        return m_d3dDevice;
-
-    m_mightBeAbleToCreateDeviceLater = false;
-    D3DPRESENT_PARAMETERS parameters = initialPresentationParameters();
-
-    if (!d3d() || !::IsWindow(window()))
-        return false;
-
-    // D3D doesn't like to make back buffers for 0 size windows. We skirt this problem if we make the
-    // passed backbuffer width and height non-zero. The window will necessarily get set to a non-zero
-    // size eventually, and then the backbuffer size will get reset.
-    RECT rect;
-    GetClientRect(window(), &amp;rect);
-
-    if (rect.left-rect.right == 0 || rect.bottom-rect.top == 0) {
-        parameters.BackBufferWidth = 1;
-        parameters.BackBufferHeight = 1;
-    }
-
-    D3DCAPS9 d3dCaps;
-    if (FAILED(d3d()-&gt;GetDeviceCaps(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, &amp;d3dCaps)))
-        return false;
-
-    DWORD behaviorFlags = D3DCREATE_FPU_PRESERVE;
-    if ((d3dCaps.DevCaps &amp; D3DDEVCAPS_HWTRANSFORMANDLIGHT) &amp;&amp; d3dCaps.VertexProcessingCaps)
-        behaviorFlags |= D3DCREATE_HARDWARE_VERTEXPROCESSING;
-    else
-        behaviorFlags |= D3DCREATE_SOFTWARE_VERTEXPROCESSING;
-
-    COMPtr&lt;IDirect3DDevice9&gt; device;
-    if (FAILED(d3d()-&gt;CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, window(), behaviorFlags, &amp;parameters, &amp;device))) {
-        // In certain situations (e.g., shortly after waking from sleep), Direct3DCreate9() will
-        // return an IDirect3D9 for which IDirect3D9::CreateDevice will always fail. In case we
-        // have one of these bad IDirect3D9s, get rid of it so we'll fetch a new one the next time
-        // we want to call CreateDevice.
-        s_d3d-&gt;Release();
-        s_d3d = 0;
-
-        // Even if we don't have a bad IDirect3D9, in certain situations (e.g., shortly after
-        // waking from sleep), CreateDevice will fail, but will later succeed if called again.
-        m_mightBeAbleToCreateDeviceLater = true;
-
-        return false;
-    }
-
-    // Now that we've created the IDirect3DDevice9 based on the capabilities we
-    // got from the IDirect3D9 global object, we requery the device for its
-    // actual capabilities. The capabilities returned by the device can
-    // sometimes be more complete, for example when using software vertex
-    // processing.
-    D3DCAPS9 deviceCaps;
-    if (FAILED(device-&gt;GetDeviceCaps(&amp;deviceCaps)))
-        return false;
-
-    if (!hardwareCapabilitiesIndicateCoreAnimationSupport(deviceCaps))
-        return false;
-
-    m_d3dDevice = device;
-
-    initD3DGeometry();
-
-    wkCACFContextSetD3DDevice(m_context, m_d3dDevice.get());
-
-    if (IsWindow(window())) {
-        rootLayer()-&gt;setBounds(bounds());
-        flushContext();
-    }
-
-    return true;
-}
-
-void LegacyCACFLayerTreeHost::destroyRenderer()
-{
-    wkCACFContextSetLayer(m_context, 0);
-
-    wkCACFContextSetD3DDevice(m_context, 0);
-    m_d3dDevice = 0;
-    if (s_d3d)
-        s_d3d-&gt;Release();
-
-    s_d3d = 0;
-    m_mightBeAbleToCreateDeviceLater = true;
-
-    CACFLayerTreeHost::destroyRenderer();
-}
-
-void LegacyCACFLayerTreeHost::resize()
-{
-    if (!m_d3dDevice)
-        return;
-
-    // Resetting the device might fail here. But that's OK, because if it does it we will attempt to
-    // reset the device the next time we try to render.
-    resetDevice(ChangedWindowSize);
-
-    if (rootLayer()) {
-        rootLayer()-&gt;setBounds(bounds());
-        flushContext();
-    }
-}
-
-void LegacyCACFLayerTreeHost::renderTimerFired()
-{
-    paint();
-}
-
-void LegacyCACFLayerTreeHost::paint()
-{
-    createRenderer();
-    if (!m_d3dDevice) {
-        if (m_mightBeAbleToCreateDeviceLater)
-            renderSoon();
-        return;
-    }
-
-    CACFLayerTreeHost::paint();
-}
-
-void LegacyCACFLayerTreeHost::render(const Vector&lt;CGRect&gt;&amp; windowDirtyRects)
-{
-    ASSERT(m_d3dDevice);
-
-    if (m_mustResetLostDeviceBeforeRendering &amp;&amp; !resetDevice(LostDevice)) {
-        // We can't reset the device right now. Try again soon.
-        renderSoon();
-        return;
-    }
-
-    CGRect bounds = this-&gt;bounds();
-
-    // Give the renderer some space to use. This needs to be valid until the
-    // wkCACFContextFinishUpdate() call below.
-    char space[4096];
-    if (!wkCACFContextBeginUpdate(m_context, space, sizeof(space), CACurrentMediaTime(), bounds, windowDirtyRects.data(), windowDirtyRects.size()))
-        return;
-
-    HRESULT err = S_OK;
-    CFTimeInterval timeToNextRender = numeric_limits&lt;CFTimeInterval&gt;::infinity();
-
-    do {
-        // FIXME: don't need to clear dirty region if layer tree is opaque.
-
-        WKCACFUpdateRectEnumerator* e = wkCACFContextCopyUpdateRectEnumerator(m_context);
-        if (!e)
-            break;
-
-        Vector&lt;D3DRECT, 64&gt; rects;
-        for (const CGRect* r = wkCACFUpdateRectEnumeratorNextRect(e); r; r = wkCACFUpdateRectEnumeratorNextRect(e)) {
-            D3DRECT rect;
-            rect.x1 = r-&gt;origin.x;
-            rect.x2 = rect.x1 + r-&gt;size.width;
-            rect.y1 = bounds.origin.y + bounds.size.height - (r-&gt;origin.y + r-&gt;size.height);
-            rect.y2 = rect.y1 + r-&gt;size.height;
-
-            rects.append(rect);
-        }
-        wkCACFUpdateRectEnumeratorRelease(e);
-
-        timeToNextRender = wkCACFContextGetNextUpdateTime(m_context);
-
-        if (rects.isEmpty())
-            break;
-
-        m_d3dDevice-&gt;Clear(rects.size(), rects.data(), D3DCLEAR_TARGET, 0, 1.0f, 0);
-
-        m_d3dDevice-&gt;BeginScene();
-        wkCACFContextRenderUpdate(m_context);
-        m_d3dDevice-&gt;EndScene();
-
-        err = m_d3dDevice-&gt;Present(0, 0, 0, 0);
-
-        if (err == D3DERR_DEVICELOST) {
-            wkCACFContextAddUpdateRect(m_context, bounds);
-            if (!resetDevice(LostDevice)) {
-                // We can't reset the device right now. Try again soon.
-                renderSoon();
-                return;
-            }
-        }
-    } while (err == D3DERR_DEVICELOST);
-
-    wkCACFContextFinishUpdate(m_context);
-
-#ifndef NDEBUG
-    if (m_printTree)
-        rootLayer()-&gt;printTree();
-#endif
-
-    // If timeToNextRender is not infinity, it means animations are running, so queue up to render again
-    if (timeToNextRender != numeric_limits&lt;CFTimeInterval&gt;::infinity())
-        renderSoon();
-}
-
-void LegacyCACFLayerTreeHost::renderSoon()
-{
-    if (!m_renderTimer.isActive())
-        m_renderTimer.startOneShot(0);
-}
-
-void LegacyCACFLayerTreeHost::flushContext()
-{
-    wkCACFContextFlush(m_context);
-    contextDidChange();
-}
-
-void LegacyCACFLayerTreeHost::contextDidChange()
-{
-    renderSoon();
-    CACFLayerTreeHost::contextDidChange();
-}
-
-CFTimeInterval LegacyCACFLayerTreeHost::lastCommitTime() const
-{
-    return wkCACFContextGetLastCommitTime(m_context);
-}
-
-void LegacyCACFLayerTreeHost::initD3DGeometry()
-{
-    ASSERT(m_d3dDevice);
-
-    CGRect bounds = this-&gt;bounds();
-
-    float x0 = bounds.origin.x;
-    float y0 = bounds.origin.y;
-    float x1 = x0 + bounds.size.width;
-    float y1 = y0 + bounds.size.height;
-
-    D3DXMATRIXA16 projection;
-    D3DXMatrixOrthoOffCenterRH(&amp;projection, x0, x1, y0, y1, -1.0f, 1.0f);
-
-    m_d3dDevice-&gt;SetTransform(D3DTS_PROJECTION, &amp;projection);
-}
-
-bool LegacyCACFLayerTreeHost::resetDevice(ResetReason reason)
-{
-    ASSERT(m_d3dDevice);
-    ASSERT(m_context);
-
-    HRESULT hr = m_d3dDevice-&gt;TestCooperativeLevel();
-
-    if (hr == D3DERR_DEVICELOST || hr == D3DERR_DRIVERINTERNALERROR) {
-        // The device cannot be reset at this time. Try again soon.
-        m_mustResetLostDeviceBeforeRendering = true;
-        return false;
-    }
-
-    m_mustResetLostDeviceBeforeRendering = false;
-
-    if (reason == LostDevice &amp;&amp; hr == D3D_OK) {
-        // The device wasn't lost after all.
-        return true;
-    }
-
-    // We can reset the device.
-
-    // We have to release the context's D3D resrouces whenever we reset the IDirect3DDevice9 in order to
-    // destroy any D3DPOOL_DEFAULT resources that Core Animation has allocated (e.g., textures used
-    // for mask layers). See &lt;http://msdn.microsoft.com/en-us/library/bb174425(v=VS.85).aspx&gt;.
-    wkCACFContextReleaseD3DResources(m_context);
-
-    D3DPRESENT_PARAMETERS parameters = initialPresentationParameters();
-    hr = m_d3dDevice-&gt;Reset(&amp;parameters);
-
-    // TestCooperativeLevel told us the device may be reset now, so we should
-    // not be told here that the device is lost.
-    ASSERT(hr != D3DERR_DEVICELOST);
-
-    initD3DGeometry();
-
-    return true;
-}
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscawinLegacyCACFLayerTreeHosth"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/ca/win/LegacyCACFLayerTreeHost.h (187601 => 187602)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/win/LegacyCACFLayerTreeHost.h        2015-07-30 20:15:31 UTC (rev 187601)
+++ trunk/Source/WebCore/platform/graphics/ca/win/LegacyCACFLayerTreeHost.h        2015-07-30 20:20:55 UTC (rev 187602)
</span><span class="lines">@@ -1,82 +0,0 @@
</span><del>-/*
- * Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef LegacyCACFLayerTreeHost_h
-#define LegacyCACFLayerTreeHost_h
-
-#include &quot;CACFLayerTreeHost.h&quot;
-
-namespace WebCore {
-
-// FIXME: Currently there is a LegacyCACFLayerTreeHost for each WebView and each
-// has its own WKCACFContext and Direct3DDevice9, which is inefficient.
-// (https://bugs.webkit.org/show_bug.cgi?id=31855)
-class LegacyCACFLayerTreeHost : public CACFLayerTreeHost {
-public:
-    static PassRefPtr&lt;LegacyCACFLayerTreeHost&gt; create();
-    virtual ~LegacyCACFLayerTreeHost();
-
-private:
-    LegacyCACFLayerTreeHost();
-
-    void initD3DGeometry();
-
-    // Call this when the device window has changed size or when IDirect3DDevice9::Present returns
-    // D3DERR_DEVICELOST. Returns true if the device was recovered, false if rendering must be
-    // aborted and reattempted soon.
-    enum ResetReason { ChangedWindowSize, LostDevice };
-    bool resetDevice(ResetReason);
-
-    void renderSoon();
-    void renderTimerFired();
-
-    virtual void initializeContext(void* userData, PlatformCALayer*);
-    virtual void resize();
-    virtual bool createRenderer();
-    virtual void destroyRenderer();
-    virtual CFTimeInterval lastCommitTime() const;
-    virtual void flushContext();
-    virtual void contextDidChange();
-    virtual void paint();
-    virtual void render(const Vector&lt;CGRect&gt;&amp; dirtyRects = Vector&lt;CGRect&gt;());
-
-#if USE(AVFOUNDATION)
-    virtual GraphicsDeviceAdapter* graphicsDeviceAdapter() const override { return 0; }
-#endif
-
-    Timer m_renderTimer;
-    COMPtr&lt;IDirect3DDevice9&gt; m_d3dDevice;
-    WKCACFContext* m_context;
-    bool m_mightBeAbleToCreateDeviceLater;
-    bool m_mustResetLostDeviceBeforeRendering;
-
-#ifndef NDEBUG
-    bool m_printTree;
-#endif
-};
-
-} // namespace WebCore
-
-#endif // LegacyCACFLayerTreeHost_h
</del></span></pre>
</div>
</div>

</body>
</html>