Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Unified Diff: third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp

Issue 1648293003: Fix smooth scroll jump when switching scroll handling between MT and CC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: finish animations on main Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
index 2ba8104216248a8ce57dea7de4b3e321142a4e0f..89377fea074f6c16699764812283af77c2985adc 100644
--- a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
+++ b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
@@ -1174,6 +1174,25 @@ void GraphicsLayer::removeLinkHighlight(LinkHighlight* linkHighlight)
updateChildList();
}
+void GraphicsLayer::setMainThreadScrollingReasons(uint32_t reasons)
+{
+ if (!reasons && m_scrollableArea) {
+ // There may be a scroll animation running on the main thread. Forward
+ // the call to the ScrollAnimator that will clear the main thread
+ // scrolling reasons after the animation is complete.
+ m_scrollableArea->clearMainThreadScrollingReasons(true);
+ return;
+ }
+ if (WebLayer* scrollLayer = platformLayer()) {
+ // The ScrollAnimator will override this main thread scrolling reason if
+ // it is added while the ScrollAnimator is scheduled to clear the main
+ // thread scrolling reason (from call above). Thus, inform it to not
+ // clear the main thread scrolling reasons.
+ m_scrollableArea->clearMainThreadScrollingReasons(false);
+ scrollLayer->addMainThreadScrollingReasons(reasons);
ajuma 2016/02/04 15:05:48 Would it simplify things if the main thread scroll
+ }
+}
+
void GraphicsLayer::setScrollableArea(ScrollableArea* scrollableArea, bool isViewport)
{
if (m_scrollableArea == scrollableArea)

Powered by Google App Engine
This is Rietveld 408576698