[Qt][WK2] Fixed layers are shaking when zoom level is not 1.0 due to a rounding error.
authoryael.aharon@nokia.com <yael.aharon@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 May 2012 01:10:35 +0000 (01:10 +0000)
committeryael.aharon@nokia.com <yael.aharon@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 May 2012 01:10:35 +0000 (01:10 +0000)
commit89c1386ede053bf6f8bbe7a19c887bd7a3a23cb6
tree7e93b55ad6b1ea11527b955da92c0871b9a878f3
parentc0ce4f6c38e5ecf3bb9fd5f731c6cd99c64c5571
[Qt][WK2] Fixed layers are shaking when zoom level is not 1.0 due to a rounding error.
https://bugs.webkit.org/show_bug.cgi?id=84306

Reviewed by Noam Rosenthal.

When zooming, we need to be careful about how to convert the visible rect from float to int.
Using toAlignedRect can produce inconsistent width and height when we are scrolling.
This patch carefully modifies each piece of the visible rect, to avoid such rounding errors.
In addition, the TransformationMatrix we use for painting, needs to be adjusted for the same rounding error.

* UIProcess/API/qt/qquickwebview.cpp:
(QQuickWebViewPrivate::visibleContentsRect):
(QQuickWebViewFlickablePrivate::_q_contentViewportChanged):
* UIProcess/DrawingAreaProxy.h:
(WebCore):
(WebKit::DrawingAreaProxy::setVisibleContentsRect):
* UIProcess/DrawingAreaProxyImpl.cpp:
(WebKit::DrawingAreaProxyImpl::setVisibleContentsRect):
* UIProcess/DrawingAreaProxyImpl.h:
(DrawingAreaProxyImpl):
* UIProcess/LayerTreeHostProxy.cpp:
(WebKit::LayerTreeHostProxy::setVisibleContentsRect):
* UIProcess/LayerTreeHostProxy.h:
(LayerTreeHostProxy):
* UIProcess/WebLayerTreeRenderer.cpp:
(WebKit::WebLayerTreeRenderer::paintToCurrentGLContext):
(WebKit::WebLayerTreeRenderer::setVisibleContentsRect):
* UIProcess/WebLayerTreeRenderer.h:
(WebLayerTreeRenderer):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@115696 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp
Source/WebKit2/UIProcess/DrawingAreaProxy.h
Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp
Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h
Source/WebKit2/UIProcess/LayerTreeHostProxy.cpp
Source/WebKit2/UIProcess/LayerTreeHostProxy.h
Source/WebKit2/UIProcess/WebLayerTreeRenderer.cpp
Source/WebKit2/UIProcess/WebLayerTreeRenderer.h