- Revision
- 176334
- Author
- [email protected]
- Date
- 2014-11-19 13:31:11 -0800 (Wed, 19 Nov 2014)
Log Message
[WK2 UI-side Compositing] Fix the position and scroll indicator of the UI-side tiled scrolling indicator
https://bugs.webkit.org/show_bug.cgi?id=138876
Reviewed by Beth Dakin.
Fix the position of the tiled scrolling indicator in MiniBrowser by taking top
content offset into account.
On Mac, pass the current scroll position back to the UI process via the RemoteLayerTreeTransaction
so that we can use it to show the correctly scroll offset in the indicator. This is temporary until
Mac does UI-side scrolling.
* Shared/mac/RemoteLayerTreeTransaction.h:
(WebKit::RemoteLayerTreeTransaction::scrollPosition):
(WebKit::RemoteLayerTreeTransaction::setScrollPosition):
* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::encode):
(WebKit::RemoteLayerTreeTransaction::decode):
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
(WebKit::RemoteLayerTreeDrawingAreaProxy::indicatorLocation):
(WebKit::RemoteLayerTreeDrawingAreaProxy::updateDebugIndicator):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::willCommitLayerTree):
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (176333 => 176334)
--- trunk/Source/WebKit2/ChangeLog 2014-11-19 21:15:00 UTC (rev 176333)
+++ trunk/Source/WebKit2/ChangeLog 2014-11-19 21:31:11 UTC (rev 176334)
@@ -1,3 +1,31 @@
+2014-11-19 Simon Fraser <[email protected]>
+
+ [WK2 UI-side Compositing] Fix the position and scroll indicator of the UI-side tiled scrolling indicator
+ https://bugs.webkit.org/show_bug.cgi?id=138876
+
+ Reviewed by Beth Dakin.
+
+ Fix the position of the tiled scrolling indicator in MiniBrowser by taking top
+ content offset into account.
+
+ On Mac, pass the current scroll position back to the UI process via the RemoteLayerTreeTransaction
+ so that we can use it to show the correctly scroll offset in the indicator. This is temporary until
+ Mac does UI-side scrolling.
+
+ * Shared/mac/RemoteLayerTreeTransaction.h:
+ (WebKit::RemoteLayerTreeTransaction::scrollPosition):
+ (WebKit::RemoteLayerTreeTransaction::setScrollPosition):
+ * Shared/mac/RemoteLayerTreeTransaction.mm:
+ (WebKit::RemoteLayerTreeTransaction::encode):
+ (WebKit::RemoteLayerTreeTransaction::decode):
+ * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
+ * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
+ (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
+ (WebKit::RemoteLayerTreeDrawingAreaProxy::indicatorLocation):
+ (WebKit::RemoteLayerTreeDrawingAreaProxy::updateDebugIndicator):
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::willCommitLayerTree):
+
2014-11-19 Michael Catanzaro <[email protected]>
[GTK] Error in documentation of webkit_print_operation_get_page_setup()
Modified: trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h (176333 => 176334)
--- trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h 2014-11-19 21:15:00 UTC (rev 176333)
+++ trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h 2014-11-19 21:31:11 UTC (rev 176334)
@@ -195,6 +195,11 @@
WebCore::Color pageExtendedBackgroundColor() const { return m_pageExtendedBackgroundColor; }
void setPageExtendedBackgroundColor(WebCore::Color color) { m_pageExtendedBackgroundColor = color; }
+#if PLATFORM(MAC)
+ WebCore::IntPoint scrollPosition() const { return m_scrollPosition; }
+ void setScrollPosition(WebCore::IntPoint p) { m_scrollPosition = p; }
+#endif
+
double pageScaleFactor() const { return m_pageScaleFactor; }
void setPageScaleFactor(double pageScaleFactor) { m_pageScaleFactor = pageScaleFactor; }
@@ -233,6 +238,9 @@
Vector<TransactionCallbackID> m_callbackIDs;
WebCore::IntSize m_contentsSize;
+#if PLATFORM(MAC)
+ WebCore::IntPoint m_scrollPosition;
+#endif
WebCore::Color m_pageExtendedBackgroundColor;
double m_pageScaleFactor;
double m_minimumScaleFactor;
Modified: trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm (176333 => 176334)
--- trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm 2014-11-19 21:15:00 UTC (rev 176333)
+++ trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm 2014-11-19 21:31:11 UTC (rev 176334)
@@ -487,6 +487,9 @@
encoder << m_layerIDsWithNewlyUnreachableBackingStore;
encoder << m_contentsSize;
+#if PLATFORM(MAC)
+ encoder << m_scrollPosition;
+#endif
encoder << m_pageExtendedBackgroundColor;
encoder << m_pageScaleFactor;
encoder << m_minimumScaleFactor;
@@ -548,6 +551,11 @@
if (!decoder.decode(result.m_contentsSize))
return false;
+
+#if PLATFORM(MAC)
+ if (!decoder.decode(result.m_scrollPosition))
+ return false;
+#endif
if (!decoder.decode(result.m_pageExtendedBackgroundColor))
return false;
Modified: trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h (176333 => 176334)
--- trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h 2014-11-19 21:15:00 UTC (rev 176333)
+++ trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h 2014-11-19 21:31:11 UTC (rev 176334)
@@ -71,7 +71,7 @@
float indicatorScale(WebCore::IntSize contentsSize) const;
virtual void updateDebugIndicator() override;
- void updateDebugIndicator(WebCore::IntSize contentsSize, bool rootLayerChanged, float scale);
+ void updateDebugIndicator(WebCore::IntSize contentsSize, bool rootLayerChanged, float scale, const WebCore::IntPoint& scrollPosition);
void updateDebugIndicatorPosition();
void initializeDebugIndicator();
Modified: trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm (176333 => 176334)
--- trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm 2014-11-19 21:15:00 UTC (rev 176333)
+++ trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm 2014-11-19 21:31:11 UTC (rev 176334)
@@ -225,7 +225,11 @@
if (m_debugIndicatorLayerTreeHost) {
float scale = indicatorScale(layerTreeTransaction.contentsSize());
bool rootLayerChanged = m_debugIndicatorLayerTreeHost->updateLayerTree(layerTreeTransaction, scale);
- updateDebugIndicator(layerTreeTransaction.contentsSize(), rootLayerChanged, scale);
+ IntPoint scrollPosition;
+#if PLATFORM(MAC)
+ scrollPosition = layerTreeTransaction.scrollPosition();
+#endif
+ updateDebugIndicator(layerTreeTransaction.contentsSize(), rootLayerChanged, scale, scrollPosition);
asLayer(m_debugIndicatorLayerTreeHost->rootLayer()).name = @"Indicator host root";
}
@@ -272,7 +276,7 @@
return tiledMapLocation;
}
- return FloatPoint(indicatorInset, indicatorInset);
+ return FloatPoint(indicatorInset, indicatorInset + m_webPageProxy.topContentInset());
}
void RemoteLayerTreeDrawingAreaProxy::updateDebugIndicatorPosition()
@@ -303,7 +307,7 @@
updateDebugIndicatorPosition();
}
-void RemoteLayerTreeDrawingAreaProxy::updateDebugIndicator(IntSize contentsSize, bool rootLayerChanged, float scale)
+void RemoteLayerTreeDrawingAreaProxy::updateDebugIndicator(IntSize contentsSize, bool rootLayerChanged, float scale, const IntPoint& scrollPosition)
{
// Make sure we're the last sublayer.
CALayer *rootLayer = asLayer(m_remoteLayerTreeHost.rootLayer());
@@ -333,7 +337,7 @@
[m_exposedRectIndicatorLayer setPosition:scaledExposedRect.location()];
[m_exposedRectIndicatorLayer setBounds:FloatRect(FloatPoint(), scaledExposedRect.size())];
} else {
- // FIXME: Get the correct scroll position.
+ [m_exposedRectIndicatorLayer setPosition:scrollPosition];
[m_exposedRectIndicatorLayer setBounds:FloatRect(FloatPoint(), viewSize)];
}
}
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (176333 => 176334)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2014-11-19 21:15:00 UTC (rev 176333)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2014-11-19 21:31:11 UTC (rev 176334)
@@ -2875,6 +2875,9 @@
layerTransaction.setMaximumScaleFactor(m_viewportConfiguration.maximumScale());
layerTransaction.setAllowsUserScaling(allowsUserScaling());
#endif
+#if PLATFORM(MAC)
+ layerTransaction.setScrollPosition(corePage()->mainFrame().view()->scrollPosition());
+#endif
}
void WebPage::didFlushLayerTreeAtTime(std::chrono::milliseconds timestamp)