[Threaded Compositor] Update also the contents size when creating the threaded compositor
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Jan 2017 09:19:48 +0000 (09:19 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Jan 2017 09:19:48 +0000 (09:19 +0000)
https://bugs.webkit.org/show_bug.cgi?id=167452

Reviewed by Žan Doberšek.

In r210954 we ensured that the threaded compositor and the viewport controller were created with the initial web
page size. If we don't update the contents size, the visible rectangle will be empty and tiles won't be created
until contentsSizeDidChange is called. It's even possible, when entering AC mode on demand, that we create the
layer tree host after the contents size changed, in which case nothing is rendered unless we resize the window.

* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
(WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211205 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp

index a8fd14a..f8249fb 100644 (file)
@@ -1,3 +1,18 @@
+2017-01-26  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [Threaded Compositor] Update also the contents size when creating the threaded compositor
+        https://bugs.webkit.org/show_bug.cgi?id=167452
+
+        Reviewed by Žan Doberšek.
+
+        In r210954 we ensured that the threaded compositor and the viewport controller were created with the initial web
+        page size. If we don't update the contents size, the visible rectangle will be empty and tiles won't be created
+        until contentsSizeDidChange is called. It's even possible, when entering AC mode on demand, that we create the
+        layer tree host after the contents size changed, in which case nothing is rendered unless we resize the window.
+
+        * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
+        (WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost):
+
 2017-01-26  Csaba Osztrogonác  <ossy@webkit.org>
 
         [Mac][cmake] Fix the build after r211160
index 58da8eb..c584c5d 100644 (file)
@@ -55,6 +55,12 @@ ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost(WebPage& webP
     , m_surface(AcceleratedSurface::create(webPage))
     , m_viewportController(webPage.size())
 {
+    if (FrameView* frameView = m_webPage.mainFrameView()) {
+        auto contentsSize = frameView->contentsSize();
+        if (!contentsSize.isEmpty())
+            m_viewportController.didChangeContentsSize(contentsSize);
+    }
+
     IntSize scaledSize(m_webPage.size());
     scaledSize.scale(m_webPage.deviceScaleFactor());
     float scaleFactor = m_webPage.deviceScaleFactor() * m_viewportController.pageScaleFactor();