<!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>[190259] branches/safari-601-branch/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/190259">190259</a></dd>
<dt>Author</dt> <dd>bfulgham@apple.com</dd>
<dt>Date</dt> <dd>2015-09-25 17:13:00 -0700 (Fri, 25 Sep 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/190235">r190235</a>. rdar://problem/22852382

    2015-09-24  Brent Fulgham  &lt;bfulgham@apple.com&gt;

    [Win] Support composited content in WebView render-to-context methods
    https://bugs.webkit.org/show_bug.cgi?id=149516
    &lt;rdar://problem/22635080&gt;

    Reviewed by Simon Fraser.

Source/WebCore:

    Extend the CACFLayerTreeHost implementation to render into a passed
    device context when requested. When no context is provided (the default
    case) paint as normal.

    Will be tested by existing compositing tests in a future bug. DumpRenderTree
    has to be extended to do this painting properly.

    * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
    (WebCore::CACFLayerTreeHost::paint): Accept an optional HDC argument, and
    pass it to the render method.
    * platform/graphics/ca/win/CACFLayerTreeHost.h:
    * platform/graphics/ca/win/LegacyCACFLayerTreeHost.cpp: Add missing SOFT_LINK
    command for the WKCACFViewDrawIntoDC.
    (WebCore::LegacyCACFLayerTreeHost::paint): Accept optional HDC argument and
    pass it to the parent class.
    (WebCore::LegacyCACFLayerTreeHost::render): Accept new optional HDC argument.
    If provided, call WKCACFViewDrawIntoDC. Otherwise, call WKCACFVIewDraw.
    * platform/graphics/ca/win/LegacyCACFLayerTreeHost.h:
    * platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp: Add missing SOFT_LINK
    command for the WKCACFViewDrawIntoDC.
    (WebCore::WKCACFViewLayerTreeHost::paint): Accept optional HDC argument and
    pass it to the parent class.
    (WebCore::WKCACFViewLayerTreeHost::render): Accept new optional HDC argument.
    If provided, call WKCACFViewDrawIntoDC. Otherwise, call WKCACFVIewDraw.
    * platform/graphics/ca/win/WKCACFViewLayerTreeHost.h:

Source/WebKit/win:

    * WebView.cpp:
    (WebView::paint): Call the new 'paintCompositedContentToHDC' method. If
    it handles the pain, return.
    (WebView::paintCompositedContentToHDC): New method to share code with other
    paint methods.
    (WebView::paintDocumentRectToContext): Call new 'paintCompositedContentToHDC'
    to handle any composited layers. Otherwise, use slow drawing path.
    (WebView::paintScrollViewRectToContextAtPoint): Ditto.
    (WebView::unused5): Work around a linker issue that may appear when building
    test infrastructure on this branch.
    * WebView.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari601branchSourceWebCoreChangeLog">branches/safari-601-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari601branchSourceWebCoreplatformgraphicscawinCACFLayerTreeHostcpp">branches/safari-601-branch/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp</a></li>
<li><a href="#branchessafari601branchSourceWebCoreplatformgraphicscawinCACFLayerTreeHosth">branches/safari-601-branch/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.h</a></li>
<li><a href="#branchessafari601branchSourceWebCoreplatformgraphicscawinLegacyCACFLayerTreeHostcpp">branches/safari-601-branch/Source/WebCore/platform/graphics/ca/win/LegacyCACFLayerTreeHost.cpp</a></li>
<li><a href="#branchessafari601branchSourceWebCoreplatformgraphicscawinLegacyCACFLayerTreeHosth">branches/safari-601-branch/Source/WebCore/platform/graphics/ca/win/LegacyCACFLayerTreeHost.h</a></li>
<li><a href="#branchessafari601branchSourceWebCoreplatformgraphicscawinWKCACFViewLayerTreeHostcpp">branches/safari-601-branch/Source/WebCore/platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp</a></li>
<li><a href="#branchessafari601branchSourceWebCoreplatformgraphicscawinWKCACFViewLayerTreeHosth">branches/safari-601-branch/Source/WebCore/platform/graphics/ca/win/WKCACFViewLayerTreeHost.h</a></li>
<li><a href="#branchessafari601branchSourceWebKitwinChangeLog">branches/safari-601-branch/Source/WebKit/win/ChangeLog</a></li>
<li><a href="#branchessafari601branchSourceWebKitwinWebViewcpp">branches/safari-601-branch/Source/WebKit/win/WebView.cpp</a></li>
<li><a href="#branchessafari601branchSourceWebKitwinWebViewh">branches/safari-601-branch/Source/WebKit/win/WebView.h</a></li>
</ul>

<h3>Property Changed</h3>
<ul>
<li><a href="#branchessafari601branchSourceWebCore">branches/safari-601-branch/Source/WebCore/</a></li>
<li><a href="#branchessafari601branchSourceWebKit">branches/safari-601-branch/Source/WebKit/</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari601branchSourceWebCore"></a>
<div class="propset"><h4>Property changes: branches/safari-601-branch/Source/WebCore</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svnmergeinfo"></a>
<div class="modfile"><h4>Modified: svn:mergeinfo</h4></div>
<span class="cx">/trunk/Source/WebCore:186677,186980
</span><span class="cx">/trunk/WebCore:53455
</span><span class="cx">   + /branches/ftlopt/Source/WebCore:170680
</span><span class="cx">/trunk/Source/WebCore:186677,186980,190235
</span><span class="cx">/trunk/WebCore:53455
</span><a id="branchessafari601branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebCore/ChangeLog (190258 => 190259)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebCore/ChangeLog        2015-09-25 23:52:42 UTC (rev 190258)
+++ branches/safari-601-branch/Source/WebCore/ChangeLog        2015-09-26 00:13:00 UTC (rev 190259)
</span><span class="lines">@@ -1,3 +1,41 @@
</span><ins>+2015-09-25  Brent Fulgham  &lt;bfulgham@apple.com&gt;
+
+        Merge r190235. rdar://problem/22852382
+
+    2015-09-24  Brent Fulgham  &lt;bfulgham@apple.com&gt;
+
+            [Win] Support composited content in WebView render-to-context methods
+            https://bugs.webkit.org/show_bug.cgi?id=149516
+            &lt;rdar://problem/22635080&gt;
+
+            Reviewed by Simon Fraser.
+
+            Extend the CACFLayerTreeHost implementation to render into a passed
+            device context when requested. When no context is provided (the default
+            case) paint as normal.
+
+            Will be tested by existing compositing tests in a future bug. DumpRenderTree
+            has to be extended to do this painting properly.
+
+            * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
+            (WebCore::CACFLayerTreeHost::paint): Accept an optional HDC argument, and
+            pass it to the render method.
+            * platform/graphics/ca/win/CACFLayerTreeHost.h:
+            * platform/graphics/ca/win/LegacyCACFLayerTreeHost.cpp: Add missing SOFT_LINK
+            command for the WKCACFViewDrawIntoDC.
+            (WebCore::LegacyCACFLayerTreeHost::paint): Accept optional HDC argument and
+            pass it to the parent class.
+            (WebCore::LegacyCACFLayerTreeHost::render): Accept new optional HDC argument.
+            If provided, call WKCACFViewDrawIntoDC. Otherwise, call WKCACFVIewDraw.
+            * platform/graphics/ca/win/LegacyCACFLayerTreeHost.h:
+            * platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp: Add missing SOFT_LINK
+            command for the WKCACFViewDrawIntoDC.
+            (WebCore::WKCACFViewLayerTreeHost::paint): Accept optional HDC argument and
+            pass it to the parent class.
+            (WebCore::WKCACFViewLayerTreeHost::render): Accept new optional HDC argument.
+            If provided, call WKCACFViewDrawIntoDC. Otherwise, call WKCACFVIewDraw.
+            * platform/graphics/ca/win/WKCACFViewLayerTreeHost.h:
+
</ins><span class="cx"> 2015-09-22  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Merge r189200. rdar://problem/22803080
</span></span></pre></div>
<a id="branchessafari601branchSourceWebCoreplatformgraphicscawinCACFLayerTreeHostcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp (190258 => 190259)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp        2015-09-25 23:52:42 UTC (rev 190258)
+++ branches/safari-601-branch/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp        2015-09-26 00:13:00 UTC (rev 190259)
</span><span class="lines">@@ -260,11 +260,11 @@
</span><span class="cx">         outRects[i] = winRectToCGRect(*rect, clientRect);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CACFLayerTreeHost::paint()
</del><ins>+void CACFLayerTreeHost::paint(HDC dc)
</ins><span class="cx"> {
</span><span class="cx">     Vector&lt;CGRect&gt; dirtyRects;
</span><span class="cx">     getDirtyRects(m_window, dirtyRects);
</span><del>-    render(dirtyRects);
</del><ins>+    render(dirtyRects, dc);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CACFLayerTreeHost::flushPendingGraphicsLayerChangesSoon()
</span></span></pre></div>
<a id="branchessafari601branchSourceWebCoreplatformgraphicscawinCACFLayerTreeHosth"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.h (190258 => 190259)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.h        2015-09-25 23:52:42 UTC (rev 190258)
+++ branches/safari-601-branch/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.h        2015-09-26 00:13:00 UTC (rev 190259)
</span><span class="lines">@@ -64,7 +64,7 @@
</span><span class="cx"> 
</span><span class="cx">     void setRootChildLayer(PlatformCALayer*);
</span><span class="cx">     void setWindow(HWND);
</span><del>-    virtual void paint();
</del><ins>+    virtual void paint(HDC = nullptr);
</ins><span class="cx">     virtual void resize() = 0;
</span><span class="cx">     void flushPendingGraphicsLayerChangesSoon();
</span><span class="cx">     virtual void setShouldInvertColors(bool);
</span><span class="lines">@@ -100,7 +100,7 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void flushContext() = 0;
</span><span class="cx">     virtual CFTimeInterval lastCommitTime() const = 0;
</span><del>-    virtual void render(const Vector&lt;CGRect&gt;&amp; dirtyRects = Vector&lt;CGRect&gt;()) = 0;
</del><ins>+    virtual void render(const Vector&lt;CGRect&gt;&amp; dirtyRects = Vector&lt;CGRect&gt;(), HDC dc = nullptr) = 0;
</ins><span class="cx">     virtual void initializeContext(void* userData, PlatformCALayer*) = 0;
</span><span class="cx"> 
</span><span class="cx">     CACFLayerTreeHostClient* m_client;
</span></span></pre></div>
<a id="branchessafari601branchSourceWebCoreplatformgraphicscawinLegacyCACFLayerTreeHostcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebCore/platform/graphics/ca/win/LegacyCACFLayerTreeHost.cpp (190258 => 190259)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebCore/platform/graphics/ca/win/LegacyCACFLayerTreeHost.cpp        2015-09-25 23:52:42 UTC (rev 190258)
+++ branches/safari-601-branch/Source/WebCore/platform/graphics/ca/win/LegacyCACFLayerTreeHost.cpp        2015-09-26 00:13:00 UTC (rev 190259)
</span><span class="lines">@@ -229,7 +229,7 @@
</span><span class="cx">     paint();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void LegacyCACFLayerTreeHost::paint()
</del><ins>+void LegacyCACFLayerTreeHost::paint(HDC hdc)
</ins><span class="cx"> {
</span><span class="cx">     createRenderer();
</span><span class="cx">     if (!m_d3dDevice) {
</span><span class="lines">@@ -238,10 +238,10 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    CACFLayerTreeHost::paint();
</del><ins>+    CACFLayerTreeHost::paint(hdc);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void LegacyCACFLayerTreeHost::render(const Vector&lt;CGRect&gt;&amp; windowDirtyRects)
</del><ins>+void LegacyCACFLayerTreeHost::render(const Vector&lt;CGRect&gt;&amp; windowDirtyRects, HDC)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(m_d3dDevice);
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari601branchSourceWebCoreplatformgraphicscawinLegacyCACFLayerTreeHosth"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebCore/platform/graphics/ca/win/LegacyCACFLayerTreeHost.h (190258 => 190259)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebCore/platform/graphics/ca/win/LegacyCACFLayerTreeHost.h        2015-09-25 23:52:42 UTC (rev 190258)
+++ branches/safari-601-branch/Source/WebCore/platform/graphics/ca/win/LegacyCACFLayerTreeHost.h        2015-09-26 00:13:00 UTC (rev 190259)
</span><span class="lines">@@ -59,8 +59,8 @@
</span><span class="cx">     virtual CFTimeInterval lastCommitTime() const;
</span><span class="cx">     virtual void flushContext();
</span><span class="cx">     virtual void contextDidChange();
</span><del>-    virtual void paint();
-    virtual void render(const Vector&lt;CGRect&gt;&amp; dirtyRects = Vector&lt;CGRect&gt;());
</del><ins>+    virtual void paint(HDC = nullptr);
+    virtual void render(const Vector&lt;CGRect&gt;&amp; dirtyRects = Vector&lt;CGRect&gt;(), HDC dc = nullptr);
</ins><span class="cx"> 
</span><span class="cx"> #if USE(AVFOUNDATION)
</span><span class="cx">     virtual GraphicsDeviceAdapter* graphicsDeviceAdapter() const override { return 0; }
</span></span></pre></div>
<a id="branchessafari601branchSourceWebCoreplatformgraphicscawinWKCACFViewLayerTreeHostcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebCore/platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp (190258 => 190259)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebCore/platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp        2015-09-25 23:52:42 UTC (rev 190258)
+++ branches/safari-601-branch/Source/WebCore/platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp        2015-09-26 00:13:00 UTC (rev 190259)
</span><span class="lines">@@ -52,6 +52,7 @@
</span><span class="cx"> SOFT_LINK(WebKitQuartzCoreAdditions, WKCACFViewUpdate, void, __cdecl, (WKCACFViewRef view, HWND window, const CGRect* bounds), (view, window, bounds))
</span><span class="cx"> SOFT_LINK(WebKitQuartzCoreAdditions, WKCACFViewCanDraw, bool, __cdecl, (WKCACFViewRef view), (view))
</span><span class="cx"> SOFT_LINK(WebKitQuartzCoreAdditions, WKCACFViewDraw, void, __cdecl, (WKCACFViewRef view), (view))
</span><ins>+SOFT_LINK(WebKitQuartzCoreAdditions, WKCACFViewDrawIntoDC, void, __cdecl, (WKCACFViewRef view, HDC dc), (view, dc))
</ins><span class="cx"> SOFT_LINK(WebKitQuartzCoreAdditions, WKCACFViewFlushContext, void, __cdecl, (WKCACFViewRef view), (view))
</span><span class="cx"> SOFT_LINK(WebKitQuartzCoreAdditions, WKCACFViewInvalidateRects, void, __cdecl, (WKCACFViewRef view, const CGRect rects[], size_t count), (view, rects, count))
</span><span class="cx"> typedef void (*WKCACFViewContextDidChangeCallback)(WKCACFViewRef view, void* info);
</span><span class="lines">@@ -156,16 +157,19 @@
</span><span class="cx">     WKCACFViewFlushContext(m_view.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WKCACFViewLayerTreeHost::paint()
</del><ins>+void WKCACFViewLayerTreeHost::paint(HDC dc)
</ins><span class="cx"> {
</span><span class="cx">     updateViewIfNeeded();
</span><del>-    CACFLayerTreeHost::paint();
</del><ins>+    CACFLayerTreeHost::paint(dc);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WKCACFViewLayerTreeHost::render(const Vector&lt;CGRect&gt;&amp; dirtyRects)
</del><ins>+void WKCACFViewLayerTreeHost::render(const Vector&lt;CGRect&gt;&amp; dirtyRects, HDC dc)
</ins><span class="cx"> {
</span><span class="cx">     WKCACFViewInvalidateRects(m_view.get(), dirtyRects.data(), dirtyRects.size());
</span><del>-    WKCACFViewDraw(m_view.get());
</del><ins>+    if (dc)
+        WKCACFViewDrawIntoDC(m_view.get(), dc);
+    else
+        WKCACFViewDraw(m_view.get());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WKCACFViewLayerTreeHost::setShouldInvertColors(bool shouldInvertColors)
</span></span></pre></div>
<a id="branchessafari601branchSourceWebCoreplatformgraphicscawinWKCACFViewLayerTreeHosth"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebCore/platform/graphics/ca/win/WKCACFViewLayerTreeHost.h (190258 => 190259)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebCore/platform/graphics/ca/win/WKCACFViewLayerTreeHost.h        2015-09-25 23:52:42 UTC (rev 190258)
+++ branches/safari-601-branch/Source/WebCore/platform/graphics/ca/win/WKCACFViewLayerTreeHost.h        2015-09-26 00:13:00 UTC (rev 190259)
</span><span class="lines">@@ -49,8 +49,8 @@
</span><span class="cx">     virtual void destroyRenderer();
</span><span class="cx">     virtual void flushContext();
</span><span class="cx">     virtual void contextDidChange();
</span><del>-    virtual void paint();
-    virtual void render(const Vector&lt;CGRect&gt;&amp; dirtyRects = Vector&lt;CGRect&gt;());
</del><ins>+    void paint(HDC = nullptr) override;
+    void render(const Vector&lt;CGRect&gt;&amp; dirtyRects = Vector&lt;CGRect&gt;(), HDC dc = nullptr) override;
</ins><span class="cx">     virtual CFTimeInterval lastCommitTime() const;
</span><span class="cx">     virtual void setShouldInvertColors(bool);
</span><span class="cx"> #if USE(AVFOUNDATION)
</span></span></pre></div>
<a id="branchessafari601branchSourceWebKit"></a>
<div class="propset"><h4>Property changes: branches/safari-601-branch/Source/WebKit</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svnmergeinfo"></a>
<div class="modfile"><h4>Modified: svn:mergeinfo</h4></div>
<span class="cx">   + /trunk/Source/WebKit:190235
</span><span class="cx">/trunk/WebKit:53455
</span><a id="branchessafari601branchSourceWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebKit/win/ChangeLog (190258 => 190259)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebKit/win/ChangeLog        2015-09-25 23:52:42 UTC (rev 190258)
+++ branches/safari-601-branch/Source/WebKit/win/ChangeLog        2015-09-26 00:13:00 UTC (rev 190259)
</span><span class="lines">@@ -1,3 +1,27 @@
</span><ins>+2015-09-25  Brent Fulgham  &lt;bfulgham@apple.com&gt;
+
+        Merge r190235. rdar://problem/22852382
+
+    2015-09-24  Brent Fulgham  &lt;bfulgham@apple.com&gt;
+
+            [Win] Support composited content in WebView render-to-context methods
+            https://bugs.webkit.org/show_bug.cgi?id=149516
+            &lt;rdar://problem/22635080&gt;
+
+            Reviewed by Simon Fraser.
+
+            * WebView.cpp:
+            (WebView::paint): Call the new 'paintCompositedContentToHDC' method. If
+            it handles the pain, return.
+            (WebView::paintCompositedContentToHDC): New method to share code with other
+            paint methods.
+            (WebView::paintDocumentRectToContext): Call new 'paintCompositedContentToHDC'
+            to handle any composited layers. Otherwise, use slow drawing path.
+            (WebView::paintScrollViewRectToContextAtPoint): Ditto.
+            (WebView::unused5): Work around a linker issue that may appear when building
+            test infrastructure on this branch.
+            * WebView.h:
+
</ins><span class="cx"> 2015-08-14  Babak Shafiei  &lt;bshafiei@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Merge r188486.
</span></span></pre></div>
<a id="branchessafari601branchSourceWebKitwinWebViewcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebKit/win/WebView.cpp (190258 => 190259)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebKit/win/WebView.cpp        2015-09-25 23:52:42 UTC (rev 190258)
+++ branches/safari-601-branch/Source/WebKit/win/WebView.cpp        2015-09-26 00:13:00 UTC (rev 190259)
</span><span class="lines">@@ -130,6 +130,7 @@
</span><span class="cx"> #include &lt;WebCore/PageCache.h&gt;
</span><span class="cx"> #include &lt;WebCore/PageConfiguration.h&gt;
</span><span class="cx"> #include &lt;WebCore/PageGroup.h&gt;
</span><ins>+#include &lt;WebCore/PathUtilities.h&gt;
</ins><span class="cx"> #include &lt;WebCore/PlatformKeyboardEvent.h&gt;
</span><span class="cx"> #include &lt;WebCore/PlatformMouseEvent.h&gt;
</span><span class="cx"> #include &lt;WebCore/PlatformWheelEvent.h&gt;
</span><span class="lines">@@ -1123,21 +1124,9 @@
</span><span class="cx"> {
</span><span class="cx">     LOCAL_GDI_COUNTER(0, __FUNCTION__);
</span><span class="cx"> 
</span><del>-    if (isAcceleratedCompositing() &amp;&amp; !usesLayeredWindow()) {
-#if USE(CA)
-        m_layerTreeHost-&gt;flushPendingLayerChangesNow();
-#elif USE(TEXTURE_MAPPER_GL)
-        m_acceleratedCompositingContext-&gt;flushAndRenderLayers();
-#endif
-        // Flushing might have taken us out of compositing mode.
-        if (isAcceleratedCompositing()) {
-#if USE(CA)
-            // FIXME: We need to paint into dc (if provided). &lt;http://webkit.org/b/52578&gt;
-            m_layerTreeHost-&gt;paint();
-#endif
-            ::ValidateRect(m_viewWindow, 0);
-            return;
-        }
</del><ins>+    if (paintCompositedContentToHDC(dc)) {
+        ::ValidateRect(m_viewWindow, nullptr);
+        return;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     Frame* coreFrame = core(m_mainFrame);
</span><span class="lines">@@ -6046,6 +6035,28 @@
</span><span class="cx">     return S_OK;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool WebView::paintCompositedContentToHDC(HDC deviceContext)
+{
+    if (!isAcceleratedCompositing() || usesLayeredWindow())
+        return false;
+
+#if USE(CA)
+    m_layerTreeHost-&gt;flushPendingLayerChangesNow();
+#elif USE(TEXTURE_MAPPER_GL)
+    m_acceleratedCompositingContext-&gt;flushAndRenderLayers();
+#endif
+
+    // Flushing might have taken us out of compositing mode.
+    if (!isAcceleratedCompositing())
+        return false;
+
+#if USE(CA)
+    m_layerTreeHost-&gt;paint(deviceContext);
+#endif
+
+    return true;
+}
+
</ins><span class="cx"> HRESULT WebView::paintDocumentRectToContext(RECT rect, HDC deviceContext)
</span><span class="cx"> {
</span><span class="cx">     if (!deviceContext)
</span><span class="lines">@@ -6054,6 +6065,9 @@
</span><span class="cx">     if (!m_mainFrame)
</span><span class="cx">         return E_FAIL;
</span><span class="cx"> 
</span><ins>+    if (paintCompositedContentToHDC(deviceContext))
+        return S_OK;
+
</ins><span class="cx">     return m_mainFrame-&gt;paintDocumentRectToContext(rect, deviceContext);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -6065,6 +6079,9 @@
</span><span class="cx">     if (!m_mainFrame)
</span><span class="cx">         return E_FAIL;
</span><span class="cx"> 
</span><ins>+    if (paintCompositedContentToHDC(deviceContext))
+        return S_OK;
+
</ins><span class="cx">     return m_mainFrame-&gt;paintScrollViewRectToContextAtPoint(rect, pt, deviceContext);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -6686,6 +6703,11 @@
</span><span class="cx"> HRESULT WebView::unused5()
</span><span class="cx"> {
</span><span class="cx">     ASSERT_NOT_REACHED();
</span><ins>+
+    // The following line works around a linker issue in MSVC. unused5 should never be called,
+    // and this code does nothing more than force the symbol to be included in WebKit dll.
+    (void)WebCore::PathUtilities::pathWithShrinkWrappedRects(Vector&lt;FloatRect&gt;(), 0);
+
</ins><span class="cx">     return E_FAIL;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari601branchSourceWebKitwinWebViewh"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebKit/win/WebView.h (190258 => 190259)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebKit/win/WebView.h        2015-09-25 23:52:42 UTC (rev 190258)
+++ branches/safari-601-branch/Source/WebKit/win/WebView.h        2015-09-26 00:13:00 UTC (rev 190259)
</span><span class="lines">@@ -1033,6 +1033,7 @@
</span><span class="cx">     static LRESULT CALLBACK WebViewWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
</span><span class="cx"> 
</span><span class="cx">     void updateWindowIfNeeded(HWND hWnd, UINT message);
</span><ins>+    bool paintCompositedContentToHDC(HDC);
</ins><span class="cx"> 
</span><span class="cx">     HIMC getIMMContext();
</span><span class="cx">     void releaseIMMContext(HIMC);
</span></span></pre>
</div>
</div>

</body>
</html>