Make WKViews work when layer-backed
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 7 Jan 2013 19:52:01 +0000 (19:52 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 7 Jan 2013 19:52:01 +0000 (19:52 +0000)
commitf54d20521f8ef3a45278bedc5d82297a8bbd0876
tree9dfde24fcb3c2ad3a97f8e2dd7096863bdc34bd3
parent22348a398e1e966e275741706f56f57f5a873245
Make WKViews work when layer-backed
https://bugs.webkit.org/show_bug.cgi?id=106166

Reviewed by Sam Weinig.

When not in TileCache mode, WebKit2 views had redraw problems on scrolling,
if layer-backed.

The issue is that the DrawingAreaProxy code tries to optimize scrolling by
calling -scrollRect:by: on the WKView (an NSView) to copy bits, rather than
repainting the entire view. However, -scrollRect:by: does nothing for NSViews
that have layers.

Fix by plumbing through a canScrollView() function which PageClientImpl()
implements, returning true if the view does not have layer backing.
When canScrollView() is false, DrawingAreaProxyImpl::incorporateUpdate()
dirties the entire view.

* UIProcess/API/gtk/PageClientImpl.h:
(WebKit::PageClientImpl::canScrollView):
* UIProcess/API/mac/PageClientImpl.h:
(PageClientImpl):
* UIProcess/API/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::canScrollView):
* UIProcess/API/qt/raw/qrawwebview_p_p.h:
(QRawWebViewPrivate::canScrollView):
* UIProcess/DrawingAreaProxyImpl.cpp:
(WebKit::DrawingAreaProxyImpl::incorporateUpdate):
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::canScrollView):
* UIProcess/WebPageProxy.h:
* UIProcess/efl/PageClientBase.h:
(WebKit::PageClientBase::canScrollView):
* UIProcess/qt/QtPageClient.h:
(WebKit::QtPageClient::canScrollView):
* UIProcess/win/WebView.h:
(WebKit::WebView::canScrollView):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@138973 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h
Source/WebKit2/UIProcess/API/mac/PageClientImpl.h
Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm
Source/WebKit2/UIProcess/API/qt/raw/qrawwebview_p_p.h
Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp
Source/WebKit2/UIProcess/PageClient.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/efl/PageClientBase.h
Source/WebKit2/UIProcess/qt/QtPageClient.h
Source/WebKit2/UIProcess/win/WebView.h