<!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>[174830] 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/174830">174830</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2014-10-17 12:50:09 -0700 (Fri, 17 Oct 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>[WinCairo] Accelerated compositing is not implemented.
https://bugs.webkit.org/show_bug.cgi?id=137345
Patch by peavo@outlook.com <peavo@outlook.com> on 2014-10-17
Reviewed by Brent Fulgham.
This patch is based on GTK, and the texture mapper graphics layer type.
Source/WebCore:
* WebCore.vcxproj/copyForwardingHeaders.cmd: Copy texmap headers.
* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp: Added method and flag indicating whether animation has started.
(WebCore::GraphicsLayerTextureMapper::GraphicsLayerTextureMapper):
(WebCore::GraphicsLayerTextureMapper::addAnimation):
* platform/graphics/texmap/GraphicsLayerTextureMapper.h: Ditto.
(WebCore::GraphicsLayerTextureMapper::startedAnimation):
* platform/graphics/texmap/TextureMapperShaderProgram.cpp: Use same precision for uniform in vertex shader as in fragment shader.
Otherwise glLinkProgram() will fail, and nothing will be rendered.
Source/WebKit:
* WebKit.vcxproj/WebKit/WebKit.vcxproj: Added new accelerated compositing source files.
* WebKit.vcxproj/WebKit/WebKit.vcxproj.filters: Ditto.
Source/WebKit/win:
* WebCoreSupport/AcceleratedCompositingContext.cpp: Added.
(WebKit::AcceleratedCompositingContext::AcceleratedCompositingContext):
(WebKit::getWebViewSize):
(WebKit::AcceleratedCompositingContext::initialize):
(WebKit::AcceleratedCompositingContext::~AcceleratedCompositingContext):
(WebKit::AcceleratedCompositingContext::stopAnyPendingLayerFlush):
(WebKit::AcceleratedCompositingContext::enabled):
(WebKit::AcceleratedCompositingContext::prepareForRendering):
(WebKit::AcceleratedCompositingContext::startedAnimation):
(WebKit::AcceleratedCompositingContext::compositeLayersToContext):
(WebKit::AcceleratedCompositingContext::setRootCompositingLayer):
(WebKit::AcceleratedCompositingContext::setNonCompositedContentsNeedDisplay):
(WebKit::AcceleratedCompositingContext::setNeedsDisplayInRect):
(WebKit::AcceleratedCompositingContext::resizeRootLayer):
(WebKit::AcceleratedCompositingContext::scrollNonCompositedContents):
(WebKit::AcceleratedCompositingContext::scheduleLayerFlush):
(WebKit::AcceleratedCompositingContext::flushPendingLayerChanges):
(WebKit::AcceleratedCompositingContext::flushPendingLayerChangesSoon):
(WebKit::AcceleratedCompositingContext::flushAndRenderLayers):
(WebKit::AcceleratedCompositingContext::layerFlushTimerFired):
(WebKit::AcceleratedCompositingContext::notifyAnimationStarted):
(WebKit::AcceleratedCompositingContext::notifyFlushRequired):
(WebKit::AcceleratedCompositingContext::paintContents):
* WebCoreSupport/AcceleratedCompositingContext.h: Added.
(WebKit::AcceleratedCompositingContext::LayerFlushTimer::LayerFlushTimer):
(WebKit::AcceleratedCompositingContext::LayerFlushTimer::fired):
* WebView.cpp:
(WebView::WebView):
(WebView::addToDirtyRegion):
(WebView::scrollBackingStore):
(WebView::sizeChanged):
(WebView::paint):
(WebView::setRootChildLayer):
(WebView::flushPendingGraphicsLayerChangesSoon):
(WebView::setAcceleratedCompositing):
* WebView.h:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojcopyForwardingHeaderscmd">trunk/Source/WebCore/WebCore.vcxproj/copyForwardingHeaders.cmd</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicstexmapGraphicsLayerTextureMappercpp">trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicstexmapGraphicsLayerTextureMapperh">trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicstexmapTextureMapperShaderProgramcpp">trunk/Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.cpp</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitWebKitvcxprojWebKitWebKitvcxproj">trunk/Source/WebKit/WebKit.vcxproj/WebKit/WebKit.vcxproj</a></li>
<li><a href="#trunkSourceWebKitWebKitvcxprojWebKitWebKitvcxprojfilters">trunk/Source/WebKit/WebKit.vcxproj/WebKit/WebKit.vcxproj.filters</a></li>
<li><a href="#trunkSourceWebKitwinChangeLog">trunk/Source/WebKit/win/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitwinWebViewcpp">trunk/Source/WebKit/win/WebView.cpp</a></li>
<li><a href="#trunkSourceWebKitwinWebViewh">trunk/Source/WebKit/win/WebView.h</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKitwinWebCoreSupportAcceleratedCompositingContextcpp">trunk/Source/WebKit/win/WebCoreSupport/AcceleratedCompositingContext.cpp</a></li>
<li><a href="#trunkSourceWebKitwinWebCoreSupportAcceleratedCompositingContexth">trunk/Source/WebKit/win/WebCoreSupport/AcceleratedCompositingContext.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (174829 => 174830)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-10-17 19:21:01 UTC (rev 174829)
+++ trunk/Source/WebCore/ChangeLog        2014-10-17 19:50:09 UTC (rev 174830)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2014-10-17 peavo@outlook.com <peavo@outlook.com>
+
+ [WinCairo] Accelerated compositing is not implemented.
+ https://bugs.webkit.org/show_bug.cgi?id=137345
+
+ Reviewed by Brent Fulgham.
+
+ This patch is based on GTK, and the texture mapper graphics layer type.
+
+ * WebCore.vcxproj/copyForwardingHeaders.cmd: Copy texmap headers.
+ * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp: Added method and flag indicating whether animation has started.
+ (WebCore::GraphicsLayerTextureMapper::GraphicsLayerTextureMapper):
+ (WebCore::GraphicsLayerTextureMapper::addAnimation):
+ * platform/graphics/texmap/GraphicsLayerTextureMapper.h: Ditto.
+ (WebCore::GraphicsLayerTextureMapper::startedAnimation):
+ * platform/graphics/texmap/TextureMapperShaderProgram.cpp: Use same precision for uniform in vertex shader as in fragment shader.
+ Otherwise glLinkProgram() will fail, and nothing will be rendered.
+
</ins><span class="cx"> 2014-10-17 Alexey Proskuryakov <ap@apple.com>
</span><span class="cx">
</span><span class="cx"> [iOS] Crash when load is canceled while waiting for the user to type HTTP authentication credentials
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojcopyForwardingHeaderscmd"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/copyForwardingHeaders.cmd (174829 => 174830)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/copyForwardingHeaders.cmd        2014-10-17 19:21:01 UTC (rev 174829)
+++ trunk/Source/WebCore/WebCore.vcxproj/copyForwardingHeaders.cmd        2014-10-17 19:50:09 UTC (rev 174830)
</span><span class="lines">@@ -58,6 +58,8 @@
</span><span class="cx"> xcopy /y /d "%ProjectDir%..\platform\graphics\win\*.h" "%CONFIGURATIONBUILDDIR%\include\WebCore"
</span><span class="cx"> xcopy /y /d "%ProjectDir%..\platform\graphics\win\%1\*.h" "%CONFIGURATIONBUILDDIR%\include\WebCore"
</span><span class="cx"> xcopy /y /d "%ProjectDir%..\platform\graphics\opentype\*.h" "%CONFIGURATIONBUILDDIR%\include\WebCore"
</span><ins>+xcopy /y /d "%ProjectDir%..\platform\graphics\opengl\*.h" "%CONFIGURATIONBUILDDIR%\include\WebCore"
+xcopy /y /d "%ProjectDir%..\platform\graphics\texmap\*.h" "%CONFIGURATIONBUILDDIR%\include\WebCore"
</ins><span class="cx"> xcopy /y /d "%ProjectDir%..\platform\mock\*.h" "%CONFIGURATIONBUILDDIR%\include\WebCore"
</span><span class="cx"> xcopy /y /d "%ProjectDir%..\platform\text\*.h" "%CONFIGURATIONBUILDDIR%\include\WebCore"
</span><span class="cx"> xcopy /y /d "%ProjectDir%..\platform\text\icu\*.h" "%CONFIGURATIONBUILDDIR%\include\WebCore"
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicstexmapGraphicsLayerTextureMappercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp (174829 => 174830)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp        2014-10-17 19:21:01 UTC (rev 174829)
+++ trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp        2014-10-17 19:50:09 UTC (rev 174830)
</span><span class="lines">@@ -54,6 +54,7 @@
</span><span class="cx"> , m_contentsLayer(0)
</span><span class="cx"> , m_animationStartTime(0)
</span><span class="cx"> , m_isScrollable(false)
</span><ins>+ , m_startedAnimation(false)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -591,6 +592,7 @@
</span><span class="cx"> m_animationStartTime = currentTime - timeOffset;
</span><span class="cx"> notifyChange(AnimationChange);
</span><span class="cx"> notifyChange(AnimationStarted);
</span><ins>+ m_startedAnimation = true;
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicstexmapGraphicsLayerTextureMapperh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h (174829 => 174830)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h        2014-10-17 19:21:01 UTC (rev 174829)
+++ trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h        2014-10-17 19:50:09 UTC (rev 174830)
</span><span class="lines">@@ -100,6 +100,8 @@
</span><span class="cx"> float debugBorderWidth() const { return m_debugBorderWidth; }
</span><span class="cx"> void setRepaintCount(int);
</span><span class="cx">
</span><ins>+ bool startedAnimation() const { return m_startedAnimation; }
+
</ins><span class="cx"> private:
</span><span class="cx"> virtual void willBeDestroyed();
</span><span class="cx">
</span><span class="lines">@@ -177,6 +179,7 @@
</span><span class="cx">
</span><span class="cx"> IntSize m_committedScrollOffset;
</span><span class="cx"> bool m_isScrollable;
</span><ins>+ bool m_startedAnimation;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> inline static GraphicsLayerTextureMapper* toGraphicsLayerTextureMapper(GraphicsLayer* layer)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicstexmapTextureMapperShaderProgramcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.cpp (174829 => 174830)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.cpp        2014-10-17 19:21:01 UTC (rev 174829)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.cpp        2014-10-17 19:50:09 UTC (rev 174830)
</span><span class="lines">@@ -208,6 +208,8 @@
</span><span class="cx"> ANTIALIASING_TEX_COORD_DIRECTIVE
</span><span class="cx"> BLUR_CONSTANTS
</span><span class="cx"> STRINGIFY(
</span><ins>+ precision highp float;
+ uniform mat4 u_textureSpaceMatrix;
</ins><span class="cx"> precision mediump float;
</span><span class="cx"> uniform SamplerType s_sampler;
</span><span class="cx"> uniform sampler2D s_contentTexture;
</span><span class="lines">@@ -220,7 +222,6 @@
</span><span class="cx"> uniform vec2 u_shadowOffset;
</span><span class="cx"> uniform vec4 u_color;
</span><span class="cx"> uniform float u_gaussianKernel[GAUSSIAN_KERNEL_HALF_WIDTH];
</span><del>- uniform mat4 u_textureSpaceMatrix;
</del><span class="cx">
</span><span class="cx"> void noop(inout vec4 dummyParameter) { }
</span><span class="cx"> void noop(inout vec4 dummyParameter, vec2 texCoord) { }
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (174829 => 174830)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog        2014-10-17 19:21:01 UTC (rev 174829)
+++ trunk/Source/WebKit/ChangeLog        2014-10-17 19:50:09 UTC (rev 174830)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2014-10-17 peavo@outlook.com <peavo@outlook.com>
+
+ [WinCairo] Accelerated compositing is not implemented.
+ https://bugs.webkit.org/show_bug.cgi?id=137345
+
+ Reviewed by Brent Fulgham.
+
+ This patch is based on GTK, and the texture mapper graphics layer type.
+
+ * WebKit.vcxproj/WebKit/WebKit.vcxproj: Added new accelerated compositing source files.
+ * WebKit.vcxproj/WebKit/WebKit.vcxproj.filters: Ditto.
+
</ins><span class="cx"> 2014-10-16 Tim Horton <timothy_horton@apple.com>
</span><span class="cx">
</span><span class="cx"> Implement selection services menu for Legacy WebKit
</span></span></pre></div>
<a id="trunkSourceWebKitWebKitvcxprojWebKitWebKitvcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebKit.vcxproj/WebKit/WebKit.vcxproj (174829 => 174830)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebKit.vcxproj/WebKit/WebKit.vcxproj        2014-10-17 19:21:01 UTC (rev 174829)
+++ trunk/Source/WebKit/WebKit.vcxproj/WebKit/WebKit.vcxproj        2014-10-17 19:50:09 UTC (rev 174830)
</span><span class="lines">@@ -323,6 +323,7 @@
</span><span class="cx"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
</span><span class="cx"> </ClCompile>
</span><span class="cx"> <ClCompile Include="..\..\win\WebCoreStatistics.cpp" />
</span><ins>+ <ClCompile Include="..\..\win\WebCoreSupport\AcceleratedCompositingContext.cpp" />
</ins><span class="cx"> <ClCompile Include="..\..\win\WebCoreSupport\EmbeddedWidget.cpp" />
</span><span class="cx"> <ClCompile Include="..\..\win\WebCoreSupport\WebChromeClient.cpp" />
</span><span class="cx"> <ClCompile Include="..\..\win\WebCoreSupport\WebContextMenuClient.cpp" />
</span><span class="lines">@@ -460,6 +461,7 @@
</span><span class="cx"> <ClInclude Include="..\..\win\WebCachedFramePlatformData.h" />
</span><span class="cx"> <ClInclude Include="..\..\win\WebCookieManager.h" />
</span><span class="cx"> <ClInclude Include="..\..\win\WebCoreStatistics.h" />
</span><ins>+ <ClInclude Include="..\..\win\WebCoreSupport\AcceleratedCompositingContext.h" />
</ins><span class="cx"> <ClInclude Include="..\..\win\WebCoreSupport\EmbeddedWidget.h" />
</span><span class="cx"> <ClInclude Include="..\..\win\WebCoreSupport\WebChromeClient.h" />
</span><span class="cx"> <ClInclude Include="..\..\win\WebCoreSupport\WebContextMenuClient.h" />
</span></span></pre></div>
<a id="trunkSourceWebKitWebKitvcxprojWebKitWebKitvcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebKit.vcxproj/WebKit/WebKit.vcxproj.filters (174829 => 174830)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebKit.vcxproj/WebKit/WebKit.vcxproj.filters        2014-10-17 19:21:01 UTC (rev 174829)
+++ trunk/Source/WebKit/WebKit.vcxproj/WebKit/WebKit.vcxproj.filters        2014-10-17 19:50:09 UTC (rev 174830)
</span><span class="lines">@@ -275,6 +275,9 @@
</span><span class="cx"> <ClCompile Include="..\..\win\AccessibleTextImpl.cpp">
</span><span class="cx"> <Filter>Sources</Filter>
</span><span class="cx"> </ClCompile>
</span><ins>+ <ClCompile Include="..\..\win\WebCoreSupport\AcceleratedCompositingContext.cpp">
+ <Filter>WebCoreSupport</Filter>
+ </ClCompile>
</ins><span class="cx"> </ItemGroup>
</span><span class="cx"> <ItemGroup>
</span><span class="cx"> <ClInclude Include="..\..\win\WebCoreSupport\EmbeddedWidget.h">
</span><span class="lines">@@ -536,6 +539,9 @@
</span><span class="cx"> <ClInclude Include="..\..\win\AccessibleTextImpl.h">
</span><span class="cx"> <Filter>Header Files</Filter>
</span><span class="cx"> </ClInclude>
</span><ins>+ <ClInclude Include="..\..\win\WebCoreSupport\AcceleratedCompositingContext.h">
+ <Filter>WebCoreSupport</Filter>
+ </ClInclude>
</ins><span class="cx"> </ItemGroup>
</span><span class="cx"> <ItemGroup>
</span><span class="cx"> <None Include="WebKitPostBuild.cmd" />
</span></span></pre></div>
<a id="trunkSourceWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/ChangeLog (174829 => 174830)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/ChangeLog        2014-10-17 19:21:01 UTC (rev 174829)
+++ trunk/Source/WebKit/win/ChangeLog        2014-10-17 19:50:09 UTC (rev 174830)
</span><span class="lines">@@ -1,3 +1,49 @@
</span><ins>+2014-10-17 peavo@outlook.com <peavo@outlook.com>
+
+ [WinCairo] Accelerated compositing is not implemented.
+ https://bugs.webkit.org/show_bug.cgi?id=137345
+
+ Reviewed by Brent Fulgham.
+
+ This patch is based on GTK, and the texture mapper graphics layer type.
+
+ * WebCoreSupport/AcceleratedCompositingContext.cpp: Added.
+ (WebKit::AcceleratedCompositingContext::AcceleratedCompositingContext):
+ (WebKit::getWebViewSize):
+ (WebKit::AcceleratedCompositingContext::initialize):
+ (WebKit::AcceleratedCompositingContext::~AcceleratedCompositingContext):
+ (WebKit::AcceleratedCompositingContext::stopAnyPendingLayerFlush):
+ (WebKit::AcceleratedCompositingContext::enabled):
+ (WebKit::AcceleratedCompositingContext::prepareForRendering):
+ (WebKit::AcceleratedCompositingContext::startedAnimation):
+ (WebKit::AcceleratedCompositingContext::compositeLayersToContext):
+ (WebKit::AcceleratedCompositingContext::setRootCompositingLayer):
+ (WebKit::AcceleratedCompositingContext::setNonCompositedContentsNeedDisplay):
+ (WebKit::AcceleratedCompositingContext::setNeedsDisplayInRect):
+ (WebKit::AcceleratedCompositingContext::resizeRootLayer):
+ (WebKit::AcceleratedCompositingContext::scrollNonCompositedContents):
+ (WebKit::AcceleratedCompositingContext::scheduleLayerFlush):
+ (WebKit::AcceleratedCompositingContext::flushPendingLayerChanges):
+ (WebKit::AcceleratedCompositingContext::flushPendingLayerChangesSoon):
+ (WebKit::AcceleratedCompositingContext::flushAndRenderLayers):
+ (WebKit::AcceleratedCompositingContext::layerFlushTimerFired):
+ (WebKit::AcceleratedCompositingContext::notifyAnimationStarted):
+ (WebKit::AcceleratedCompositingContext::notifyFlushRequired):
+ (WebKit::AcceleratedCompositingContext::paintContents):
+ * WebCoreSupport/AcceleratedCompositingContext.h: Added.
+ (WebKit::AcceleratedCompositingContext::LayerFlushTimer::LayerFlushTimer):
+ (WebKit::AcceleratedCompositingContext::LayerFlushTimer::fired):
+ * WebView.cpp:
+ (WebView::WebView):
+ (WebView::addToDirtyRegion):
+ (WebView::scrollBackingStore):
+ (WebView::sizeChanged):
+ (WebView::paint):
+ (WebView::setRootChildLayer):
+ (WebView::flushPendingGraphicsLayerChangesSoon):
+ (WebView::setAcceleratedCompositing):
+ * WebView.h:
+
</ins><span class="cx"> 2014-10-16 Commit Queue <commit-queue@webkit.org>
</span><span class="cx">
</span><span class="cx"> Unreviewed, rolling out r174754.
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebCoreSupportAcceleratedCompositingContextcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit/win/WebCoreSupport/AcceleratedCompositingContext.cpp (0 => 174830)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebCoreSupport/AcceleratedCompositingContext.cpp         (rev 0)
+++ trunk/Source/WebKit/win/WebCoreSupport/AcceleratedCompositingContext.cpp        2014-10-17 19:50:09 UTC (rev 174830)
</span><span class="lines">@@ -0,0 +1,328 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple, 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. AND ITS CONTRIBUTORS ``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 ITS 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 "AcceleratedCompositingContext.h"
+
+#if USE(TEXTURE_MAPPER_GL)
+
+#include "WebView.h"
+
+#include <WebCore/Document.h>
+#include <WebCore/Frame.h>
+#include <WebCore/FrameView.h>
+#include <WebCore/GraphicsLayerTextureMapper.h>
+#include <WebCore/MainFrame.h>
+#include <WebCore/Page.h>
+#include <WebCore/Settings.h>
+#include <WebCore/TemporaryOpenGLSetting.h>
+#include <WebCore/TextureMapperGL.h>
+#include <WebCore/TextureMapperLayer.h>
+
+#if USE(OPENGL_ES_2)
+#include <GLES2/gl2.h>
+#else
+#include <GL/gl.h>
+#endif
+
+using namespace WebCore;
+
+AcceleratedCompositingContext::AcceleratedCompositingContext(WebView& webView)
+ : m_webView(webView)
+ , m_layerFlushTimer(*this)
+ , m_context(nullptr)
+ , m_window(0)
+{
+}
+
+static IntSize getWebViewSize(WebView& webView)
+{
+ RECT r;
+ webView.frameRect(&r);
+ return IntSize(r.right - r.left, r.bottom - r.top);
+}
+
+void AcceleratedCompositingContext::initialize()
+{
+ if (m_rootLayer)
+ return;
+
+ IntSize pageSize = getWebViewSize(m_webView);
+
+ m_window = m_webView.viewWindow();
+
+ if (!m_window)
+ return;
+
+ m_rootLayer = GraphicsLayer::create(nullptr, *this);
+ m_rootLayer->setDrawsContent(false);
+ m_rootLayer->setSize(pageSize);
+
+ // The non-composited contents are a child of the root layer.
+ m_nonCompositedContentLayer = GraphicsLayer::create(nullptr, *this);
+ m_nonCompositedContentLayer->setDrawsContent(true);
+ m_nonCompositedContentLayer->setContentsOpaque(!m_webView.transparent());
+ m_nonCompositedContentLayer->setSize(pageSize);
+ if (core(&m_webView)->settings().acceleratedDrawingEnabled())
+ m_nonCompositedContentLayer->setAcceleratesDrawing(true);
+
+#ifndef NDEBUG
+ m_rootLayer->setName("Root layer");
+ m_nonCompositedContentLayer->setName("Non-composited content");
+#endif
+
+ m_rootLayer->addChild(m_nonCompositedContentLayer.get());
+ m_nonCompositedContentLayer->setNeedsDisplay();
+
+ // The creation of the TextureMapper needs an active OpenGL context.
+ if (!m_context)
+ m_context = GLContext::createContextForWindow(m_window, GLContext::sharingContext());
+
+ m_context->makeContextCurrent();
+
+ m_textureMapper = TextureMapperGL::create(TextureMapper::OpenGLMode);
+ static_cast<TextureMapperGL*>(m_textureMapper.get())->setEnableEdgeDistanceAntialiasing(true);
+ toTextureMapperLayer(m_rootLayer.get())->setTextureMapper(m_textureMapper.get());
+
+ scheduleLayerFlush();
+}
+
+AcceleratedCompositingContext::~AcceleratedCompositingContext()
+{
+ stopAnyPendingLayerFlush();
+}
+
+void AcceleratedCompositingContext::stopAnyPendingLayerFlush()
+{
+ m_layerFlushTimer.stop();
+}
+
+bool AcceleratedCompositingContext::enabled()
+{
+ return m_window && m_rootLayer && m_textureMapper;
+}
+
+bool AcceleratedCompositingContext::prepareForRendering()
+{
+ if (!enabled())
+ return false;
+
+ if (!m_context)
+ return false;
+
+ if (!m_context->makeContextCurrent())
+ return false;
+
+ return true;
+}
+
+bool AcceleratedCompositingContext::startedAnimation(WebCore::GraphicsLayer* layer)
+{
+ if (!layer)
+ return false;
+
+ if (toGraphicsLayerTextureMapper(layer)->startedAnimation())
+ return true;
+
+ for (auto childLayer : layer->children()) {
+ if (startedAnimation(childLayer))
+ return true;
+ }
+
+ return false;
+}
+
+void AcceleratedCompositingContext::compositeLayersToContext(CompositePurpose purpose)
+{
+ if (!prepareForRendering())
+ return;
+
+ RECT r;
+ if (!::GetClientRect(m_window, &r))
+ return;
+ IntSize windowSize(r.right, r.bottom);
+ glViewport(0, 0, windowSize.width(), windowSize.height());
+
+ if (purpose == ForResize) {
+ TemporaryOpenGLSetting scopedScissor(GL_SCISSOR_TEST, GL_FALSE);
+ glClearColor(1, 1, 1, 0);
+ glClear(GL_COLOR_BUFFER_BIT);
+ }
+
+ m_textureMapper->beginPainting();
+ toTextureMapperLayer(m_rootLayer.get())->paint();
+ m_fpsCounter.updateFPSAndDisplay(m_textureMapper.get());
+ m_textureMapper->endPainting();
+
+ m_context->swapBuffers();
+}
+
+void AcceleratedCompositingContext::setRootCompositingLayer(GraphicsLayer* graphicsLayer)
+{
+ prepareForRendering();
+
+ if (!graphicsLayer) {
+ stopAnyPendingLayerFlush();
+ m_rootLayer = nullptr;
+ m_nonCompositedContentLayer = nullptr;
+ m_textureMapper = nullptr;
+ return;
+ }
+
+ // Add the accelerated layer tree hierarchy.
+ initialize();
+ if (!m_window)
+ return;
+
+ m_nonCompositedContentLayer->removeAllChildren();
+ m_nonCompositedContentLayer->addChild(graphicsLayer);
+
+ stopAnyPendingLayerFlush();
+
+ scheduleLayerFlush();
+}
+
+void AcceleratedCompositingContext::setNonCompositedContentsNeedDisplay(const IntRect& rect)
+{
+ if (!m_rootLayer)
+ return;
+ if (rect.isEmpty()) {
+ m_rootLayer->setNeedsDisplay();
+ return;
+ }
+ m_nonCompositedContentLayer->setNeedsDisplayInRect(rect);
+ scheduleLayerFlush();
+}
+
+void AcceleratedCompositingContext::setNeedsDisplayInRect(const IntRect& rect)
+{
+ if (!m_rootLayer)
+ return;
+ if (rect.isEmpty()) {
+ m_rootLayer->setNeedsDisplay();
+ return;
+ }
+ m_rootLayer->setNeedsDisplayInRect(rect);
+ scheduleLayerFlush();
+}
+
+void AcceleratedCompositingContext::resizeRootLayer(const IntSize& newSize)
+{
+ if (!enabled())
+ return;
+
+ if (m_rootLayer->size() == newSize)
+ return;
+
+ m_rootLayer->setSize(newSize);
+
+ // If the newSize exposes new areas of the non-composited content a setNeedsDisplay is needed
+ // for those newly exposed areas.
+ FloatSize oldSize = m_nonCompositedContentLayer->size();
+ m_nonCompositedContentLayer->setSize(newSize);
+
+ if (newSize.width() > oldSize.width()) {
+ float height = std::min(static_cast<float>(newSize.height()), oldSize.height());
+ m_nonCompositedContentLayer->setNeedsDisplayInRect(FloatRect(oldSize.width(), 0, newSize.width() - oldSize.width(), height));
+ }
+
+ if (newSize.height() > oldSize.height())
+ m_nonCompositedContentLayer->setNeedsDisplayInRect(FloatRect(0, oldSize.height(), newSize.width(), newSize.height() - oldSize.height()));
+
+ m_nonCompositedContentLayer->setNeedsDisplayInRect(IntRect(IntPoint(), newSize));
+ compositeLayersToContext(ForResize);
+ scheduleLayerFlush();
+}
+
+void AcceleratedCompositingContext::scrollNonCompositedContents(const IntRect& scrollRect, const IntSize& /* scrollOffset */)
+{
+ m_nonCompositedContentLayer->setNeedsDisplay();
+ scheduleLayerFlush();
+}
+
+void AcceleratedCompositingContext::scheduleLayerFlush()
+{
+ if (!enabled())
+ return;
+
+ if (m_layerFlushTimer.isActive())
+ return;
+
+ m_layerFlushTimer.startOneShot(0);
+}
+
+bool AcceleratedCompositingContext::flushPendingLayerChanges()
+{
+ m_rootLayer->flushCompositingStateForThisLayerOnly();
+ m_nonCompositedContentLayer->flushCompositingStateForThisLayerOnly();
+ return core(&m_webView)->mainFrame().view()->flushCompositingStateIncludingSubframes();
+}
+
+bool AcceleratedCompositingContext::flushPendingLayerChangesSoon()
+{
+ scheduleLayerFlush();
+ return true;
+}
+
+void AcceleratedCompositingContext::flushAndRenderLayers()
+{
+ if (!enabled())
+ return;
+
+ Frame& frame = core(&m_webView)->mainFrame();
+ if (!frame.contentRenderer() || !frame.view())
+ return;
+ frame.view()->updateLayoutAndStyleIfNeededRecursive();
+
+ if (!enabled())
+ return;
+
+ if (m_context && !m_context->makeContextCurrent())
+ return;
+
+ if (!flushPendingLayerChanges())
+ return;
+
+ compositeLayersToContext();
+}
+
+void AcceleratedCompositingContext::layerFlushTimerFired()
+{
+ flushAndRenderLayers();
+
+ // In case an animation is running, we should flush again soon.
+ if (startedAnimation(m_rootLayer.get()))
+ scheduleLayerFlush();
+}
+
+void AcceleratedCompositingContext::paintContents(const GraphicsLayer*, GraphicsContext& context, GraphicsLayerPaintingPhase, const FloatRect& rectToPaint)
+{
+ context.save();
+ context.clip(rectToPaint);
+ core(&m_webView)->mainFrame().view()->paint(&context, enclosingIntRect(rectToPaint));
+ context.restore();
+}
+
+#endif // USE(TEXTURE_MAPPER_GL)
</ins></span></pre></div>
<a id="trunkSourceWebKitwinWebCoreSupportAcceleratedCompositingContexth"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit/win/WebCoreSupport/AcceleratedCompositingContext.h (0 => 174830)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebCoreSupport/AcceleratedCompositingContext.h         (rev 0)
+++ trunk/Source/WebKit/win/WebCoreSupport/AcceleratedCompositingContext.h        2014-10-17 19:50:09 UTC (rev 174830)
</span><span class="lines">@@ -0,0 +1,102 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple, 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. AND ITS CONTRIBUTORS ``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 ITS 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 AcceleratedCompositingContext_h
+#define AcceleratedCompositingContext_h
+
+#if USE(TEXTURE_MAPPER_GL)
+
+#include <WebCore/FloatRect.h>
+#include <WebCore/GLContext.h>
+#include <WebCore/GraphicsLayer.h>
+#include <WebCore/GraphicsLayerClient.h>
+#include <WebCore/IntRect.h>
+#include <WebCore/IntSize.h>
+#include <WebCore/TextureMapperFPSCounter.h>
+#include <WebCore/Timer.h>
+#include <wtf/PassOwnPtr.h>
+
+class WebView;
+
+class AcceleratedCompositingContext : public WebCore::GraphicsLayerClient {
+ WTF_MAKE_NONCOPYABLE(AcceleratedCompositingContext);
+public:
+ explicit AcceleratedCompositingContext(WebView&);
+ virtual ~AcceleratedCompositingContext();
+
+ void setRootCompositingLayer(WebCore::GraphicsLayer*);
+ void setNonCompositedContentsNeedDisplay(const WebCore::IntRect&);
+ void setNeedsDisplayInRect(const WebCore::IntRect&);
+ void scheduleLayerFlush();
+ void resizeRootLayer(const WebCore::IntSize&);
+ bool enabled();
+
+ // GraphicsLayerClient
+ virtual void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::FloatRect& rectToPaint);
+
+ void initialize();
+
+ enum CompositePurpose { ForResize, NotForResize };
+ void compositeLayersToContext(CompositePurpose = NotForResize);
+
+ void flushAndRenderLayers();
+ bool flushPendingLayerChanges();
+ bool flushPendingLayerChangesSoon();
+ void scrollNonCompositedContents(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollOffset);
+
+private:
+ WebView& m_webView;
+ OwnPtr<WebCore::GLContext> m_context;
+ HWND m_window;
+ std::unique_ptr<WebCore::GraphicsLayer> m_rootLayer;
+ std::unique_ptr<WebCore::GraphicsLayer> m_nonCompositedContentLayer;
+ std::unique_ptr<WebCore::TextureMapper> m_textureMapper;
+ WebCore::TextureMapperFPSCounter m_fpsCounter;
+
+ class LayerFlushTimer : public WebCore::TimerBase {
+ public:
+ LayerFlushTimer(AcceleratedCompositingContext& context)
+ : m_context(context)
+ {
+ }
+
+ private:
+ virtual void fired()
+ {
+ m_context.layerFlushTimerFired();
+ }
+
+ AcceleratedCompositingContext& m_context;
+ } m_layerFlushTimer;
+
+ void layerFlushTimerFired();
+ void stopAnyPendingLayerFlush();
+ bool prepareForRendering();
+ bool startedAnimation(WebCore::GraphicsLayer*);
+};
+
+#endif // TEXTURE_MAPPER_GL
+
+#endif // AcceleratedCompositingContext_h
</ins></span></pre></div>
<a id="trunkSourceWebKitwinWebViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebView.cpp (174829 => 174830)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebView.cpp        2014-10-17 19:21:01 UTC (rev 174829)
+++ trunk/Source/WebKit/win/WebView.cpp        2014-10-17 19:50:09 UTC (rev 174830)
</span><span class="lines">@@ -170,6 +170,8 @@
</span><span class="cx"> #if USE(CA)
</span><span class="cx"> #include <WebCore/CACFLayerTreeHost.h>
</span><span class="cx"> #include <WebCore/PlatformCALayer.h>
</span><ins>+#elif USE(TEXTURE_MAPPER_GL)
+#include "AcceleratedCompositingContext.h"
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if ENABLE(FULLSCREEN_API)
</span><span class="lines">@@ -409,6 +411,9 @@
</span><span class="cx"> , m_lastSetCursor(0)
</span><span class="cx"> , m_usesLayeredWindow(false)
</span><span class="cx"> , m_needsDisplay(false)
</span><ins>+#if USE(TEXTURE_MAPPER_GL)
+ , m_acceleratedCompositingContext(nullptr)
+#endif
</ins><span class="cx"> {
</span><span class="cx"> JSC::initializeThreading();
</span><span class="cx"> WTF::initializeMainThread();
</span><span class="lines">@@ -860,7 +865,11 @@
</span><span class="cx"> // http://webkit.org/b/29350.
</span><span class="cx">
</span><span class="cx"> if (isAcceleratedCompositing()) {
</span><ins>+#if USE(CA)
</ins><span class="cx"> m_backingLayer->setNeedsDisplayInRect(dirtyRect);
</span><ins>+#elif USE(TEXTURE_MAPPER_GL)
+ m_acceleratedCompositingContext->setNeedsDisplayInRect(dirtyRect);
+#endif
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -895,7 +904,11 @@
</span><span class="cx"> if (isAcceleratedCompositing()) {
</span><span class="cx"> // FIXME: We should be doing something smarter here, like moving tiles around and painting
</span><span class="cx"> // any newly-exposed tiles. <http://webkit.org/b/52714>
</span><ins>+#if USE(CA)
</ins><span class="cx"> m_backingLayer->setNeedsDisplayInRect(scrollViewRect);
</span><ins>+#elif USE(TEXTURE_MAPPER_GL)
+ m_acceleratedCompositingContext->scrollNonCompositedContents(scrollViewRect, IntSize(dx, dy));
+#endif
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -952,10 +965,14 @@
</span><span class="cx"> #if USE(CA)
</span><span class="cx"> if (m_layerTreeHost)
</span><span class="cx"> m_layerTreeHost->resize();
</span><ins>+
</ins><span class="cx"> if (m_backingLayer) {
</span><span class="cx"> m_backingLayer->setSize(newSize);
</span><span class="cx"> m_backingLayer->setNeedsDisplay();
</span><span class="cx"> }
</span><ins>+#elif USE(TEXTURE_MAPPER_GL)
+ if (m_acceleratedCompositingContext)
+ m_acceleratedCompositingContext->resizeRootLayer(newSize);
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1084,18 +1101,22 @@
</span><span class="cx"> {
</span><span class="cx"> LOCAL_GDI_COUNTER(0, __FUNCTION__);
</span><span class="cx">
</span><ins>+ if (isAcceleratedCompositing() && !usesLayeredWindow()) {
</ins><span class="cx"> #if USE(CA)
</span><del>- if (isAcceleratedCompositing() && !usesLayeredWindow()) {
</del><span class="cx"> m_layerTreeHost->flushPendingLayerChangesNow();
</span><ins>+#elif USE(TEXTURE_MAPPER_GL)
+ m_acceleratedCompositingContext->flushAndRenderLayers();
+#endif
</ins><span class="cx"> // Flushing might have taken us out of compositing mode.
</span><span class="cx"> if (isAcceleratedCompositing()) {
</span><ins>+#if USE(CA)
</ins><span class="cx"> // FIXME: We need to paint into dc (if provided). <http://webkit.org/b/52578>
</span><span class="cx"> m_layerTreeHost->paint();
</span><ins>+#endif
</ins><span class="cx"> ::ValidateRect(m_viewWindow, 0);
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx"> }
</span><del>-#endif
</del><span class="cx">
</span><span class="cx"> Frame* coreFrame = core(m_mainFrame);
</span><span class="cx"> if (!coreFrame)
</span><span class="lines">@@ -2393,8 +2414,10 @@
</span><span class="cx"> RECT windowRect;
</span><span class="cx"> ::GetClientRect(hWnd, &windowRect);
</span><span class="cx"> ::InvalidateRect(hWnd, &windowRect, false);
</span><ins>+#if USE(CA)
</ins><span class="cx"> if (webView->isAcceleratedCompositing())
</span><span class="cx"> webView->m_backingLayer->setNeedsDisplay();
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx"> break;
</span><span class="cx"> case WM_MOUSEACTIVATE:
</span><span class="lines">@@ -6551,9 +6574,15 @@
</span><span class="cx"> void WebView::setRootChildLayer(GraphicsLayer* layer)
</span><span class="cx"> {
</span><span class="cx"> setAcceleratedCompositing(layer ? true : false);
</span><ins>+#if USE(CA)
</ins><span class="cx"> if (!m_backingLayer)
</span><span class="cx"> return;
</span><span class="cx"> m_backingLayer->addChild(layer);
</span><ins>+#elif USE(TEXTURE_MAPPER_GL)
+ if (!m_acceleratedCompositingContext)
+ return;
+ m_acceleratedCompositingContext->setRootCompositingLayer(layer);
+#endif
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebView::flushPendingGraphicsLayerChangesSoon()
</span><span class="lines">@@ -6562,13 +6591,20 @@
</span><span class="cx"> if (!m_layerTreeHost)
</span><span class="cx"> return;
</span><span class="cx"> m_layerTreeHost->flushPendingGraphicsLayerChangesSoon();
</span><ins>+#elif USE(TEXTURE_MAPPER_GL)
+ if (!m_acceleratedCompositingContext)
+ return;
+ m_acceleratedCompositingContext->flushPendingLayerChangesSoon();
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebView::setAcceleratedCompositing(bool accelerated)
</span><span class="cx"> {
</span><ins>+ if (m_isAcceleratedCompositing == accelerated)
+ return;
+
</ins><span class="cx"> #if USE(CA)
</span><del>- if (m_isAcceleratedCompositing == accelerated || !CACFLayerTreeHost::acceleratedCompositingAvailable())
</del><ins>+ if (!CACFLayerTreeHost::acceleratedCompositingAvailable())
</ins><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> if (accelerated) {
</span><span class="lines">@@ -6608,6 +6644,10 @@
</span><span class="cx"> m_backingLayer = nullptr;
</span><span class="cx"> m_isAcceleratedCompositing = false;
</span><span class="cx"> }
</span><ins>+#elif USE(TEXTURE_MAPPER_GL)
+ if (accelerated && !m_acceleratedCompositingContext)
+ m_acceleratedCompositingContext = std::make_unique<AcceleratedCompositingContext>(*this);
+ m_isAcceleratedCompositing = accelerated;
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -6752,14 +6792,18 @@
</span><span class="cx"> FrameView* view = coreFrame->view();
</span><span class="cx"> if (!view)
</span><span class="cx"> return;
</span><ins>+#if USE(CA)
</ins><span class="cx"> if (!m_backingLayer)
</span><span class="cx"> return;
</span><ins>+#endif
</ins><span class="cx">
</span><span class="cx"> view->updateLayoutAndStyleIfNeededRecursive();
</span><span class="cx">
</span><ins>+#if USE(CA)
</ins><span class="cx"> // Updating layout might have taken us out of compositing mode.
</span><span class="cx"> if (m_backingLayer)
</span><span class="cx"> m_backingLayer->flushCompositingStateForThisLayerOnly();
</span><ins>+#endif
</ins><span class="cx">
</span><span class="cx"> view->flushCompositingStateIncludingSubframes();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebView.h (174829 => 174830)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebView.h        2014-10-17 19:21:01 UTC (rev 174829)
+++ trunk/Source/WebKit/win/WebView.h        2014-10-17 19:50:09 UTC (rev 174830)
</span><span class="lines">@@ -67,6 +67,9 @@
</span><span class="cx"> class WebFrame;
</span><span class="cx"> class WebInspector;
</span><span class="cx"> class WebInspectorClient;
</span><ins>+#if USE(TEXTURE_MAPPER_GL)
+class AcceleratedCompositingContext;
+#endif
</ins><span class="cx">
</span><span class="cx"> WebView* kit(WebCore::Page*);
</span><span class="cx"> WebCore::Page* core(IWebView*);
</span><span class="lines">@@ -1136,8 +1139,10 @@
</span><span class="cx"> void setAcceleratedCompositing(bool);
</span><span class="cx"> #if USE(CA)
</span><span class="cx"> RefPtr<WebCore::CACFLayerTreeHost> m_layerTreeHost;
</span><ins>+ std::unique_ptr<WebCore::GraphicsLayer> m_backingLayer;
+#elif USE(TEXTURE_MAPPER_GL)
+ std::unique_ptr<AcceleratedCompositingContext> m_acceleratedCompositingContext;
</ins><span class="cx"> #endif
</span><del>- std::unique_ptr<WebCore::GraphicsLayer> m_backingLayer;
</del><span class="cx"> bool m_isAcceleratedCompositing;
</span><span class="cx">
</span><span class="cx"> bool m_nextDisplayIsSynchronous;
</span></span></pre>
</div>
</div>
</body>
</html>