[Win] Support composited content in WebView render-to-context methods
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Sep 2015 03:41:35 +0000 (03:41 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Sep 2015 03:41:35 +0000 (03:41 +0000)
commitb2fae87dfa082000d796f98b7f24dc88234ead55
treee0330303a744e07dbe4be6269328f826db1fb971
parentf703aedc97e3ec9f0cdf2fe38bcb6df3449be471
[Win] Support composited content in WebView render-to-context methods
https://bugs.webkit.org/show_bug.cgi?id=149516
<rdar://problem/22635080>

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/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.
(WebCore::WKCACFViewLayerTreeHost::setShouldInvertColors):
* 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.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@190235 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp
Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.h
Source/WebCore/platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp
Source/WebCore/platform/graphics/ca/win/WKCACFViewLayerTreeHost.h
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebView.cpp
Source/WebKit/win/WebView.h