Title: [144585] trunk/Source/WebKit2
Revision
144585
Author
[email protected]
Date
2013-03-03 15:54:12 -0800 (Sun, 03 Mar 2013)

Log Message

[EFL][QT][WK2] Turn on ApplyDeviceScaleFactorInCompositor always.
https://bugs.webkit.org/show_bug.cgi?id=110298

Patch by Huang Dongsung <[email protected]> on 2013-03-03
Reviewed by Kenneth Rohde Christiansen.

Currently, EFL and Qt turn on ApplyDeviceScaleFactorInCompositor when using
fixed layout, but ApplyDeviceScaleFactorInCompositor is not related to fixed
layout. It is confusing that a platform WebView deals with device view size or
DIP view size case by case. So this patch always turns on
ApplyDeviceScaleFactorInCompositor.

In addition, move the code that turns on ScrollingCoordinatorEnabled to
CoordinatedLayerTreeHost.

* UIProcess/API/efl/EwkView.cpp:
(EwkView::setDeviceScaleFactor):
    We should make WebPage know new DIP size.
(EwkView::setSize):
    When we set ApplyDeviceScaleFactorInCompositor to true, make WebPage
    know the DIP size as a view size.
* UIProcess/efl/WebView.cpp:
(WebKit::WebView::updateViewportSize):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
(WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::DrawingAreaImpl):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setUseFixedLayout):
    WebPage sends the DIP size to Web Process even when we don't use fixed layout.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (144584 => 144585)


--- trunk/Source/WebKit2/ChangeLog	2013-03-03 23:52:42 UTC (rev 144584)
+++ trunk/Source/WebKit2/ChangeLog	2013-03-03 23:54:12 UTC (rev 144585)
@@ -1,3 +1,35 @@
+2013-03-03  Huang Dongsung  <[email protected]>
+
+        [EFL][QT][WK2] Turn on ApplyDeviceScaleFactorInCompositor always.
+        https://bugs.webkit.org/show_bug.cgi?id=110298
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Currently, EFL and Qt turn on ApplyDeviceScaleFactorInCompositor when using
+        fixed layout, but ApplyDeviceScaleFactorInCompositor is not related to fixed
+        layout. It is confusing that a platform WebView deals with device view size or
+        DIP view size case by case. So this patch always turns on
+        ApplyDeviceScaleFactorInCompositor.
+
+        In addition, move the code that turns on ScrollingCoordinatorEnabled to
+        CoordinatedLayerTreeHost.
+
+        * UIProcess/API/efl/EwkView.cpp:
+        (EwkView::setDeviceScaleFactor):
+            We should make WebPage know new DIP size.
+        (EwkView::setSize):
+            When we set ApplyDeviceScaleFactorInCompositor to true, make WebPage
+            know the DIP size as a view size.
+        * UIProcess/efl/WebView.cpp:
+        (WebKit::WebView::updateViewportSize):
+        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
+        (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
+        * WebProcess/WebPage/DrawingAreaImpl.cpp:
+        (WebKit::DrawingAreaImpl::DrawingAreaImpl):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::setUseFixedLayout):
+            WebPage sends the DIP size to Web Process even when we don't use fixed layout.
+
 2013-03-03  Sam Weinig  <[email protected]>
 
         Shared Web Workers have an incorrect visible process name

Modified: trunk/Source/WebKit2/UIProcess/API/efl/EwkView.cpp (144584 => 144585)


--- trunk/Source/WebKit2/UIProcess/API/efl/EwkView.cpp	2013-03-03 23:52:42 UTC (rev 144584)
+++ trunk/Source/WebKit2/UIProcess/API/efl/EwkView.cpp	2013-03-03 23:54:12 UTC (rev 144585)
@@ -453,6 +453,9 @@
 void EwkView::setDeviceScaleFactor(float scale)
 {
     page()->setIntrinsicDeviceScaleFactor(scale);
+
+    // Update internal viewport size after device-scale change.
+    setSize(m_size);
 }
 
 float EwkView::deviceScaleFactor() const
@@ -468,7 +471,10 @@
     if (!drawingArea)
         return;
 
-    drawingArea->setSize(m_size, IntSize());
+    FloatSize dipSize(m_size);
+    // Web Process expects sizes in UI units, and not raw device units.
+    dipSize.scale(1 / deviceScaleFactor());
+    drawingArea->setSize(roundedIntSize(dipSize), IntSize());
     webView()->updateViewportSize();
 }
 

Modified: trunk/Source/WebKit2/UIProcess/efl/WebView.cpp (144584 => 144585)


--- trunk/Source/WebKit2/UIProcess/efl/WebView.cpp	2013-03-03 23:52:42 UTC (rev 144584)
+++ trunk/Source/WebKit2/UIProcess/efl/WebView.cpp	2013-03-03 23:54:12 UTC (rev 144585)
@@ -196,14 +196,14 @@
 
 void WebView::updateViewportSize()
 {
+    FloatSize size = m_ewkView->size();
+    // The viewport controller expects sizes in UI units, and not raw device units.
+    size.scale(1 / m_page->deviceScaleFactor());
     if (m_page->useFixedLayout()) {
-        FloatSize size = m_ewkView->size();
-        // The viewport controller expects sizes in UI units, and not raw device units.
-        size.scale(1 / m_page->deviceScaleFactor());
         m_ewkView->pageViewportController()->didChangeViewportSize(size);
         return;
     }
-    m_page->drawingArea()->setVisibleContentsRect(IntRect(roundedIntPoint(m_ewkView->pagePosition()), m_ewkView->size()), FloatPoint());
+    m_page->drawingArea()->setVisibleContentsRect(FloatRect(m_ewkView->pagePosition(), size), FloatPoint());
 }
 
 void WebView::didChangeContentsSize(const WebCore::IntSize& size)

Modified: trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp (144584 => 144585)


--- trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp	2013-03-03 23:52:42 UTC (rev 144584)
+++ trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp	2013-03-03 23:54:12 UTC (rev 144585)
@@ -93,6 +93,9 @@
     , m_forceRepaintAsyncCallbackID(0)
     , m_animationsLocked(false)
 {
+    m_webPage->corePage()->settings()->setScrollingCoordinatorEnabled(true);
+    m_webPage->corePage()->settings()->setApplyDeviceScaleFactorInCompositor(true);
+
     // Create a root layer.
     m_rootLayer = GraphicsLayer::create(this, this);
     CoordinatedGraphicsLayer* coordinatedRootLayer = toCoordinatedGraphicsLayer(m_rootLayer.get());

Modified: trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp (144584 => 144585)


--- trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp	2013-03-03 23:52:42 UTC (rev 144584)
+++ trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp	2013-03-03 23:54:12 UTC (rev 144585)
@@ -73,7 +73,6 @@
 
 #if USE(COORDINATED_GRAPHICS)
     m_alwaysUseCompositing = true;
-    webPage->corePage()->settings()->setScrollingCoordinatorEnabled(true);
 #endif
 
     if (m_alwaysUseCompositing)

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (144584 => 144585)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2013-03-03 23:52:42 UTC (rev 144584)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2013-03-03 23:54:12 UTC (rev 144585)
@@ -1236,7 +1236,6 @@
 #if USE(COORDINATED_GRAPHICS)
     m_page->settings()->setAcceleratedCompositingForFixedPositionEnabled(fixed);
     m_page->settings()->setFixedPositionCreatesStackingContext(fixed);
-    m_page->settings()->setApplyDeviceScaleFactorInCompositor(fixed);
     m_page->settings()->setApplyPageScaleFactorInCompositor(fixed);
 #endif
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to