Title: [127081] trunk/Source
Revision
127081
Author
[email protected]
Date
2012-08-29 19:02:38 -0700 (Wed, 29 Aug 2012)

Log Message

[chromium] CCLayerTreeHost::finishCommitOnImplThread wrong setter order
https://bugs.webkit.org/show_bug.cgi?id=94828

Patch by Alex Sakhartchouk <[email protected]> on 2012-08-29
Reviewed by Adrienne Walker.

Source/WebCore:

setDeviceScaleFactor affects maxScrollPosition, making sure it's properly updated.
This also removes setter order dependency.

* platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
(WebCore::CCLayerTreeHostImpl::setDeviceScaleFactor):

Source/WebKit/chromium:

Testing that setDeviceScaleFactor properly changes maxScrollPosition

* tests/CCLayerTreeHostImplTest.cpp:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (127080 => 127081)


--- trunk/Source/WebCore/ChangeLog	2012-08-30 01:59:27 UTC (rev 127080)
+++ trunk/Source/WebCore/ChangeLog	2012-08-30 02:02:38 UTC (rev 127081)
@@ -1,3 +1,16 @@
+2012-08-29  Alex Sakhartchouk  <[email protected]>
+
+        [chromium] CCLayerTreeHost::finishCommitOnImplThread wrong setter order
+        https://bugs.webkit.org/show_bug.cgi?id=94828
+
+        Reviewed by Adrienne Walker.
+
+        setDeviceScaleFactor affects maxScrollPosition, making sure it's properly updated.
+        This also removes setter order dependency.
+
+        * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
+        (WebCore::CCLayerTreeHostImpl::setDeviceScaleFactor):
+
 2012-08-29  James Robinson  <[email protected]>
 
         Unreviewed, rolling out r126956.

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp (127080 => 127081)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp	2012-08-30 01:59:27 UTC (rev 127080)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp	2012-08-30 02:02:38 UTC (rev 127081)
@@ -769,6 +769,8 @@
     if (deviceScaleFactor == m_deviceScaleFactor)
         return;
     m_deviceScaleFactor = deviceScaleFactor;
+
+    updateMaxScrollPosition();
 }
 
 

Modified: trunk/Source/WebKit/chromium/ChangeLog (127080 => 127081)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-08-30 01:59:27 UTC (rev 127080)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-08-30 02:02:38 UTC (rev 127081)
@@ -1,3 +1,14 @@
+2012-08-29  Alex Sakhartchouk  <[email protected]>
+
+        [chromium] CCLayerTreeHost::finishCommitOnImplThread wrong setter order
+        https://bugs.webkit.org/show_bug.cgi?id=94828
+
+        Reviewed by Adrienne Walker.
+
+        Testing that setDeviceScaleFactor properly changes maxScrollPosition
+
+        * tests/CCLayerTreeHostImplTest.cpp:
+
 2012-08-29  James Robinson  <[email protected]>
 
         Unreviewed, rolling out r126956.

Modified: trunk/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp (127080 => 127081)


--- trunk/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp	2012-08-30 01:59:27 UTC (rev 127080)
+++ trunk/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp	2012-08-30 02:02:38 UTC (rev 127081)
@@ -400,6 +400,24 @@
     EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(10, 10), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollOnMainThread);
 }
 
+TEST_F(CCLayerTreeHostImplTest, maxScrollPositionChangedByDeviceScaleFactor)
+{
+    setupScrollAndContentsLayers(IntSize(100, 100));
+
+    float deviceScaleFactor = 2;
+    IntSize layoutViewport(25, 25);
+    IntSize deviceViewport(layoutViewport);
+    deviceViewport.scale(deviceScaleFactor);
+    m_hostImpl->setViewportSize(layoutViewport, deviceViewport);
+    m_hostImpl->setDeviceScaleFactor(deviceScaleFactor);
+    EXPECT_EQ(m_hostImpl->rootLayer()->maxScrollPosition(), IntSize(25, 25));
+
+    deviceScaleFactor = 1;
+    m_hostImpl->setViewportSize(layoutViewport, layoutViewport);
+    m_hostImpl->setDeviceScaleFactor(deviceScaleFactor);
+    EXPECT_EQ(m_hostImpl->rootLayer()->maxScrollPosition(), IntSize(75, 75));
+}
+
 TEST_F(CCLayerTreeHostImplTest, pinchGesture)
 {
     setupScrollAndContentsLayers(IntSize(100, 100));
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to