Title: [105517] trunk/Source/WebKit2
Revision
105517
Author
[email protected]
Date
2012-01-20 08:24:29 -0800 (Fri, 20 Jan 2012)

Log Message

[Qt] Trigger forcing accelerated compositing from the UI process side.
https://bugs.webkit.org/show_bug.cgi?id=76296

Reviewed by Noam Rosenthal.

Some messages can be sent from the web view to the LayerTreeHost before
accelerated compositing is entered on the web process and signaled back.
By letting the UI process decide if AC has to be forced, we can create
the LayerTreeHostProxy earlier to send messages to the web process while
AC is being entered there.

This patch also fixes the flow of DidRenderFrame and RenderNextFrame messages
by setting the m_waitingForUIProcess flag properly and only send the
RenderNextFrame once the painting thread on the UI process is ready to paint.

This fixes the first visible content rect message not being received when
loading pages from the disk.

* Shared/WebPreferencesStore.h:
* UIProcess/API/qt/qquickwebview.cpp:
(QQuickWebViewPrivate::initialize):
* UIProcess/DrawingAreaProxyImpl.cpp:
(WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl):
* UIProcess/qt/LayerTreeHostProxyQt.cpp:
(WebKit::LayerTreeHostProxy::flushLayerChanges):
(WebKit::LayerTreeHostProxy::didRenderFrame):
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::DrawingAreaImpl):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
* WebProcess/WebPage/qt/LayerTreeHostQt.cpp:
(WebKit::LayerTreeHostQt::performScheduledLayerFlush):
* WebProcess/WebPage/qt/WebPageQt.cpp:
(WebKit::WebPage::platformInitialize):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (105516 => 105517)


--- trunk/Source/WebKit2/ChangeLog	2012-01-20 15:56:38 UTC (rev 105516)
+++ trunk/Source/WebKit2/ChangeLog	2012-01-20 16:24:29 UTC (rev 105517)
@@ -1,3 +1,40 @@
+2012-01-20  Jocelyn Turcotte  <[email protected]>
+
+        [Qt] Trigger forcing accelerated compositing from the UI process side.
+        https://bugs.webkit.org/show_bug.cgi?id=76296
+
+        Reviewed by Noam Rosenthal.
+
+        Some messages can be sent from the web view to the LayerTreeHost before
+        accelerated compositing is entered on the web process and signaled back.
+        By letting the UI process decide if AC has to be forced, we can create
+        the LayerTreeHostProxy earlier to send messages to the web process while
+        AC is being entered there.
+
+        This patch also fixes the flow of DidRenderFrame and RenderNextFrame messages
+        by setting the m_waitingForUIProcess flag properly and only send the
+        RenderNextFrame once the painting thread on the UI process is ready to paint.
+
+        This fixes the first visible content rect message not being received when
+        loading pages from the disk.
+
+        * Shared/WebPreferencesStore.h:
+        * UIProcess/API/qt/qquickwebview.cpp:
+        (QQuickWebViewPrivate::initialize):
+        * UIProcess/DrawingAreaProxyImpl.cpp:
+        (WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl):
+        * UIProcess/qt/LayerTreeHostProxyQt.cpp:
+        (WebKit::LayerTreeHostProxy::flushLayerChanges):
+        (WebKit::LayerTreeHostProxy::didRenderFrame):
+        * WebProcess/WebPage/DrawingAreaImpl.cpp:
+        (WebKit::DrawingAreaImpl::DrawingAreaImpl):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::updatePreferences):
+        * WebProcess/WebPage/qt/LayerTreeHostQt.cpp:
+        (WebKit::LayerTreeHostQt::performScheduledLayerFlush):
+        * WebProcess/WebPage/qt/WebPageQt.cpp:
+        (WebKit::WebPage::platformInitialize):
+
 2012-01-20  Sheriff Bot  <[email protected]>
 
         Unreviewed, rolling out r105497.

Modified: trunk/Source/WebKit2/Shared/WebPreferencesStore.h (105516 => 105517)


--- trunk/Source/WebKit2/Shared/WebPreferencesStore.h	2012-01-20 15:56:38 UTC (rev 105516)
+++ trunk/Source/WebKit2/Shared/WebPreferencesStore.h	2012-01-20 16:24:29 UTC (rev 105517)
@@ -66,6 +66,7 @@
     macro(HyperlinkAuditingEnabled, hyperlinkAuditingEnabled, Bool, bool, true) \
     macro(NeedsSiteSpecificQuirks, needsSiteSpecificQuirks, Bool, bool, false) \
     macro(AcceleratedCompositingEnabled, acceleratedCompositingEnabled, Bool, bool, true) \
+    macro(ForceCompositingMode, forceCompositingMode, Bool, bool, false) \
     macro(AcceleratedDrawingEnabled, acceleratedDrawingEnabled, Bool, bool, false) \
     macro(CanvasUsesAcceleratedDrawing, canvasUsesAcceleratedDrawing, Bool, bool, true) \
     macro(CompositingBordersVisible, compositingBordersVisible, Bool, bool, false) \

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


--- trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp	2012-01-20 15:56:38 UTC (rev 105516)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp	2012-01-20 16:24:29 UTC (rev 105517)
@@ -105,6 +105,7 @@
     // Any page setting should preferrable be set before creating the page.
     setUseTraditionalDesktopBehaviour(false);
     webPageProxy->pageGroup()->preferences()->setAcceleratedCompositingEnabled(true);
+    webPageProxy->pageGroup()->preferences()->setForceCompositingMode(true);
 
     pageClient.initialize(q_ptr, pageViewPrivate->eventHandler.data(), &undoController);
     webPageProxy->initializeWebPage();

Modified: trunk/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp (105516 => 105517)


--- trunk/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp	2012-01-20 15:56:38 UTC (rev 105516)
+++ trunk/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp	2012-01-20 16:24:29 UTC (rev 105517)
@@ -30,7 +30,9 @@
 #include "DrawingAreaProxyMessages.h"
 #include "LayerTreeContext.h"
 #include "UpdateInfo.h"
+#include "WebPageGroup.h"
 #include "WebPageProxy.h"
+#include "WebPreferences.h"
 #include "WebProcessProxy.h"
 #include <WebCore/Region.h>
 
@@ -56,6 +58,11 @@
     , m_isBackingStoreDiscardable(true)
     , m_discardBackingStoreTimer(RunLoop::current(), this, &DrawingAreaProxyImpl::discardBackingStore)
 {
+#if USE(TEXTURE_MAPPER)
+    // Construct the proxy early to allow messages to be sent to the web process while AC is entered there.
+    if (webPageProxy->pageGroup()->preferences()->forceCompositingMode())
+        m_layerTreeHostProxy = adoptPtr(new LayerTreeHostProxy(this));
+#endif
 }
 
 DrawingAreaProxyImpl::~DrawingAreaProxyImpl()

Modified: trunk/Source/WebKit2/UIProcess/qt/LayerTreeHostProxyQt.cpp (105516 => 105517)


--- trunk/Source/WebKit2/UIProcess/qt/LayerTreeHostProxyQt.cpp	2012-01-20 15:56:38 UTC (rev 105516)
+++ trunk/Source/WebKit2/UIProcess/qt/LayerTreeHostProxyQt.cpp	2012-01-20 16:24:29 UTC (rev 105517)
@@ -431,6 +431,8 @@
 void LayerTreeHostProxy::flushLayerChanges()
 {
     m_rootLayer->syncCompositingState(FloatRect());
+    // The pending tiles state is on its way for the screen, tell the web process to render the next one.
+    m_drawingAreaProxy->page()->process()->send(Messages::LayerTreeHost::RenderNextFrame(), m_drawingAreaProxy->page()->pageID());
 }
 
 void LayerTreeHostProxy::ensureRootLayer()
@@ -571,7 +573,6 @@
 
 void LayerTreeHostProxy::didRenderFrame()
 {
-    m_drawingAreaProxy->page()->process()->send(Messages::LayerTreeHost::RenderNextFrame(), m_drawingAreaProxy->page()->pageID());
     pushUpdateToQueue(FlushLayerChangesMessage::create());
     updateViewport();
 }

Modified: trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp (105516 => 105517)


--- trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp	2012-01-20 15:56:38 UTC (rev 105516)
+++ trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp	2012-01-20 16:24:29 UTC (rev 105517)
@@ -68,7 +68,7 @@
     , m_displayTimer(WebProcess::shared().runLoop(), this, &DrawingAreaImpl::displayTimerFired)
     , m_exitCompositingTimer(WebProcess::shared().runLoop(), this, &DrawingAreaImpl::exitAcceleratedCompositingMode)
 {
-    if (webPage->corePage()->settings()->acceleratedDrawingEnabled())
+    if (webPage->corePage()->settings()->acceleratedDrawingEnabled() || webPage->corePage()->settings()->forceCompositingMode())
         m_alwaysUseCompositing = true;
         
     if (m_alwaysUseCompositing)

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (105516 => 105517)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2012-01-20 15:56:38 UTC (rev 105516)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2012-01-20 16:24:29 UTC (rev 105517)
@@ -1840,6 +1840,7 @@
     settings->setShowsToolTipOverTruncatedText(store.getBoolValueForKey(WebPreferencesKey::showsToolTipOverTruncatedTextKey()));
 
     settings->setAcceleratedCompositingEnabled(store.getBoolValueForKey(WebPreferencesKey::acceleratedCompositingEnabledKey()) && LayerTreeHost::supportsAcceleratedCompositing());
+    settings->setForceCompositingMode(store.getBoolValueForKey(WebPreferencesKey::forceCompositingModeKey()) && LayerTreeHost::supportsAcceleratedCompositing());
     settings->setAcceleratedDrawingEnabled(store.getBoolValueForKey(WebPreferencesKey::acceleratedDrawingEnabledKey()) && LayerTreeHost::supportsAcceleratedCompositing());
     settings->setCanvasUsesAcceleratedDrawing(store.getBoolValueForKey(WebPreferencesKey::canvasUsesAcceleratedDrawingKey()) && LayerTreeHost::supportsAcceleratedCompositing());
     settings->setShowDebugBorders(store.getBoolValueForKey(WebPreferencesKey::compositingBordersVisibleKey()));

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


--- trunk/Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp	2012-01-20 15:56:38 UTC (rev 105516)
+++ trunk/Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp	2012-01-20 16:24:29 UTC (rev 105517)
@@ -240,16 +240,16 @@
 
 void LayerTreeHostQt::performScheduledLayerFlush()
 {
+#if USE(TILED_BACKING_STORE)
+    if (m_isSuspended || m_waitingForUIProcess)
+        return;
+#endif
+
     m_webPage->layoutIfNeeded();
 
     if (!m_isValid)
         return;
 
-#if USE(TILED_BACKING_STORE)
-    if (m_isSuspended || m_waitingForUIProcess)
-        return;
-#endif
-
     m_shouldSyncFrame = false;
     flushPendingLayerChanges();
     if (!m_shouldSyncFrame)
@@ -261,6 +261,7 @@
     }
 
     m_webPage->send(Messages::LayerTreeHostProxy::DidRenderFrame());
+    m_waitingForUIProcess = true;
 
     if (!m_notifyAfterScheduledLayerFlush)
         return;

Modified: trunk/Source/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp (105516 => 105517)


--- trunk/Source/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp	2012-01-20 15:56:38 UTC (rev 105516)
+++ trunk/Source/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp	2012-01-20 16:24:29 UTC (rev 105517)
@@ -90,10 +90,6 @@
     
 void WebPage::platformInitialize()
 {
-    Settings* settings = m_page->settings();
-
-    // If accelerated compositing is enabled, we want to be in force-compositing mode, so that we don't switch between composited/non-composited state.
-    settings->setForceCompositingMode(true);
 }
 
 void WebPage::platformPreferencesDidChange(const WebPreferencesStore&)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to