Title: [111563] trunk/Source/WebKit2
Revision
111563
Author
[email protected]
Date
2012-03-21 10:19:46 -0700 (Wed, 21 Mar 2012)

Log Message

[Qt] Don't go through the UI process to update a layer's contents size.
https://bugs.webkit.org/show_bug.cgi?id=81764

Reviewed by Kenneth Rohde Christiansen.

It's happening when navigating pages that contents from the old page
is still present on the tiles until the contents size is shrunk to cut it out.
Since the contents size updates are asynchronous and go through the UI process,
this could occasionally show some glitch frames.
Even worse, the user could delay this update by starting to pan and keep
his finger on the screen.
This patch makes sure that changes to contents size are notifying the LayerTreeHost
immediately when in fixed layout mode, and remove the loop through the UI process.

* UIProcess/API/qt/qquickwebpage.cpp:
(QQuickWebPage::setContentsSize):
* UIProcess/API/qt/qquickwebpage_p_p.h:
(QQuickWebPagePrivate):
* UIProcess/API/qt/qquickwebview.cpp:
(QQuickWebViewPrivate::didRelaunchProcess):
(QQuickWebViewLegacyPrivate::updateViewportSize):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::contentsSizeChanged):
* WebProcess/WebPage/DrawingArea.h:
(WebKit):
(WebKit::DrawingArea::layerTreeHost):
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::updateBackingStoreState):
* WebProcess/WebPage/DrawingAreaImpl.h:
(WebKit::DrawingAreaImpl::layerTreeHost):
* WebProcess/WebPage/qt/LayerTreeHostQt.cpp:
(WebKit::LayerTreeHostQt::sizeDidChange):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (111562 => 111563)


--- trunk/Source/WebKit2/ChangeLog	2012-03-21 17:18:06 UTC (rev 111562)
+++ trunk/Source/WebKit2/ChangeLog	2012-03-21 17:19:46 UTC (rev 111563)
@@ -1,3 +1,38 @@
+2012-03-21  Jocelyn Turcotte  <[email protected]>
+
+        [Qt] Don't go through the UI process to update a layer's contents size.
+        https://bugs.webkit.org/show_bug.cgi?id=81764
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        It's happening when navigating pages that contents from the old page
+        is still present on the tiles until the contents size is shrunk to cut it out.
+        Since the contents size updates are asynchronous and go through the UI process,
+        this could occasionally show some glitch frames.
+        Even worse, the user could delay this update by starting to pan and keep
+        his finger on the screen.
+        This patch makes sure that changes to contents size are notifying the LayerTreeHost
+        immediately when in fixed layout mode, and remove the loop through the UI process.
+
+        * UIProcess/API/qt/qquickwebpage.cpp:
+        (QQuickWebPage::setContentsSize):
+        * UIProcess/API/qt/qquickwebpage_p_p.h:
+        (QQuickWebPagePrivate):
+        * UIProcess/API/qt/qquickwebview.cpp:
+        (QQuickWebViewPrivate::didRelaunchProcess):
+        (QQuickWebViewLegacyPrivate::updateViewportSize):
+        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+        (WebKit::WebChromeClient::contentsSizeChanged):
+        * WebProcess/WebPage/DrawingArea.h:
+        (WebKit):
+        (WebKit::DrawingArea::layerTreeHost):
+        * WebProcess/WebPage/DrawingAreaImpl.cpp:
+        (WebKit::DrawingAreaImpl::updateBackingStoreState):
+        * WebProcess/WebPage/DrawingAreaImpl.h:
+        (WebKit::DrawingAreaImpl::layerTreeHost):
+        * WebProcess/WebPage/qt/LayerTreeHostQt.cpp:
+        (WebKit::LayerTreeHostQt::sizeDidChange):
+
 2012-03-21  Kenneth Rohde Christiansen  <[email protected]>
 
         The activation highlight does not always hide

Modified: trunk/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp (111562 => 111563)


--- trunk/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp	2012-03-21 17:18:06 UTC (rev 111562)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp	2012-03-21 17:19:46 UTC (rev 111563)
@@ -63,14 +63,6 @@
     eventHandler.reset(new QtWebPageEventHandler(toAPI(webPageProxy), q, viewportItem));
 }
 
-void QQuickWebPagePrivate::setDrawingAreaSize(const QSize& size)
-{
-    DrawingAreaProxy* drawingArea = webPageProxy->drawingArea();
-    if (!drawingArea)
-        return;
-    drawingArea->setSize(WebCore::IntSize(size), WebCore::IntSize());
-}
-
 void QQuickWebPagePrivate::paint(QPainter* painter)
 {
     if (webPageProxy->drawingArea())
@@ -111,7 +103,6 @@
 
     d->contentsSize = size;
     d->updateSize();
-    d->setDrawingAreaSize(d->contentsSize.toSize());
 }
 
 const QSizeF& QQuickWebPage::contentsSize() const

Modified: trunk/Source/WebKit2/UIProcess/API/qt/qquickwebpage_p_p.h (111562 => 111563)


--- trunk/Source/WebKit2/UIProcess/API/qt/qquickwebpage_p_p.h	2012-03-21 17:18:06 UTC (rev 111562)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qquickwebpage_p_p.h	2012-03-21 17:19:46 UTC (rev 111563)
@@ -37,7 +37,6 @@
     ~QQuickWebPagePrivate();
 
     void initialize(WebKit::WebPageProxy*);
-    void setDrawingAreaSize(const QSize&);
 
     void updateSize();
 

Modified: trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp (111562 => 111563)


--- trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp	2012-03-21 17:18:06 UTC (rev 111562)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp	2012-03-21 17:19:46 UTC (rev 111563)
@@ -222,7 +222,7 @@
 void QQuickWebViewPrivate::didRelaunchProcess()
 {
     qWarning("WARNING: The web process has been successfully restarted.");
-    pageView->d->setDrawingAreaSize(viewSize());
+    webPageProxy->drawingArea()->setSize(viewSize(), IntSize());
 }
 
 PassOwnPtr<DrawingAreaProxy> QQuickWebViewPrivate::createDrawingAreaProxy()
@@ -484,6 +484,7 @@
     // The fixed layout is handled by the FrameView and the drawing area doesn't behave differently
     // whether its fixed or not. We still need to tell the drawing area which part of it
     // has to be rendered on tiles, and in desktop mode it's all of it.
+    webPageProxy->drawingArea()->setSize(viewportSize, IntSize());
     webPageProxy->drawingArea()->setVisibleContentsRect(IntRect(IntPoint(), viewportSize), 1, FloatPoint());
 }
 

Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp (111562 => 111563)


--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp	2012-03-21 17:18:06 UTC (rev 111562)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp	2012-03-21 17:19:46 UTC (rev 111563)
@@ -30,6 +30,7 @@
 #include "DrawingArea.h"
 #include "InjectedBundleNavigationAction.h"
 #include "InjectedBundleUserMessageCoders.h"
+#include "LayerTreeHost.h"
 #include "WebCoreArgumentCoders.h"
 #include "WebFrame.h"
 #include "WebFrameLoaderClient.h"
@@ -441,6 +442,7 @@
     if (m_page->useFixedLayout()) {
         // The below method updates the size().
         m_page->resizeToContentsIfNeeded();
+        m_page->drawingArea()->layerTreeHost()->sizeDidChange(m_page->size());
     }
 
     m_page->send(Messages::WebPageProxy::DidChangeContentsSize(m_page->size()));

Modified: trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h (111562 => 111563)


--- trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h	2012-03-21 17:18:06 UTC (rev 111562)
+++ trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h	2012-03-21 17:19:46 UTC (rev 111563)
@@ -44,6 +44,7 @@
 
 namespace WebKit {
 
+class LayerTreeHost;
 class WebPage;
 struct WebPageCreationParameters;
 
@@ -69,6 +70,7 @@
     virtual bool forceRepaintAsync(uint64_t callbackID) { return false; }
     virtual void setLayerTreeStateIsFrozen(bool) { }
     virtual bool layerTreeStateIsFrozen() const { return false; }
+    virtual LayerTreeHost* layerTreeHost() const { return 0; }
 
     virtual void didInstallPageOverlay() { }
     virtual void didUninstallPageOverlay() { }

Modified: trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp (111562 => 111563)


--- trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp	2012-03-21 17:18:06 UTC (rev 111562)
+++ trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp	2012-03-21 17:19:46 UTC (rev 111563)
@@ -327,7 +327,9 @@
 
         if (m_layerTreeHost) {
             m_layerTreeHost->deviceScaleFactorDidChange();
-            m_layerTreeHost->sizeDidChange(size);
+            // Use the previously set page size instead of the argument.
+            // It gets adjusted properly when using the fixed layout mode.
+            m_layerTreeHost->sizeDidChange(m_webPage->size());
         } else
             m_dirtyRegion = m_webPage->bounds();
     } else {

Modified: trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h (111562 => 111563)


--- trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h	2012-03-21 17:18:06 UTC (rev 111562)
+++ trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h	2012-03-21 17:19:46 UTC (rev 111563)
@@ -55,6 +55,7 @@
     virtual void scroll(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollOffset);
     virtual void setLayerTreeStateIsFrozen(bool);
     virtual bool layerTreeStateIsFrozen() const { return m_layerTreeStateIsFrozen; }
+    virtual LayerTreeHost* layerTreeHost() const { return m_layerTreeHost.get(); }
     virtual void forceRepaint();
 
     virtual void didInstallPageOverlay();

Modified: trunk/Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp (111562 => 111563)


--- trunk/Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp	2012-03-21 17:18:06 UTC (rev 111562)
+++ trunk/Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp	2012-03-21 17:19:46 UTC (rev 111563)
@@ -176,6 +176,9 @@
 
 void LayerTreeHostQt::sizeDidChange(const WebCore::IntSize& newSize)
 {
+    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
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to