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

Side by Side Diff: third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp

Issue 1782563002: Takeover MT initiated animations from the compositor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2661
Patch Set: Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/scroll/ProgrammaticScrollAnimator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 678
679 void ScrollingCoordinator::willDestroyLayer(PaintLayer* layer) 679 void ScrollingCoordinator::willDestroyLayer(PaintLayer* layer)
680 { 680 {
681 m_layersWithTouchRects.remove(layer); 681 m_layersWithTouchRects.remove(layer);
682 } 682 }
683 683
684 void ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThread(MainTh readScrollingReasons mainThreadScrollingReasons) 684 void ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThread(MainTh readScrollingReasons mainThreadScrollingReasons)
685 { 685 {
686 if (!m_page->mainFrame()->isLocalFrame() || !m_page->deprecatedLocalMainFram e()->view()) 686 if (!m_page->mainFrame()->isLocalFrame() || !m_page->deprecatedLocalMainFram e()->view())
687 return; 687 return;
688 if (WebLayer* scrollLayer = toWebLayer(m_page->deprecatedLocalMainFrame()->v iew()->layerForScrolling())) { 688 GraphicsLayer* layer = m_page->deprecatedLocalMainFrame()->view()->layerForS crolling();
689 if (WebLayer* scrollLayer = toWebLayer(layer)) {
689 m_lastMainThreadScrollingReasons = mainThreadScrollingReasons; 690 m_lastMainThreadScrollingReasons = mainThreadScrollingReasons;
690 if (mainThreadScrollingReasons) { 691 if (mainThreadScrollingReasons) {
692 if (ScrollAnimatorBase* scrollAnimator = layer->scrollableArea()->ex istingScrollAnimator())
693 scrollAnimator->takeoverCompositorAnimation();
691 scrollLayer->addMainThreadScrollingReasons(mainThreadScrollingReason s); 694 scrollLayer->addMainThreadScrollingReasons(mainThreadScrollingReason s);
692 } else { 695 } else {
693 // Clear all main thread scrolling reasons except the one that's set 696 // Clear all main thread scrolling reasons except the one that's set
694 // if there is a running scroll animation. 697 // if there is a running scroll animation.
695 uint32_t mainThreadScrollingReasonsToClear = ~0u; 698 uint32_t mainThreadScrollingReasonsToClear = ~0u;
696 mainThreadScrollingReasonsToClear &= ~MainThreadScrollingReason::kAn imatingScrollOnMainThread; 699 mainThreadScrollingReasonsToClear &= ~MainThreadScrollingReason::kAn imatingScrollOnMainThread;
697 scrollLayer->clearMainThreadScrollingReasons(mainThreadScrollingReas onsToClear); 700 scrollLayer->clearMainThreadScrollingReasons(mainThreadScrollingReas onsToClear);
698 } 701 }
699 } 702 }
700 } 703 }
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
1061 bool frameIsScrollable = frameView && frameView->isScrollable(); 1064 bool frameIsScrollable = frameView && frameView->isScrollable();
1062 if (frameIsScrollable != m_wasFrameScrollable) 1065 if (frameIsScrollable != m_wasFrameScrollable)
1063 return true; 1066 return true;
1064 1067
1065 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll ing()) : nullptr) 1068 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll ing()) : nullptr)
1066 return WebSize(frameView->contentsSize()) != scrollLayer->bounds(); 1069 return WebSize(frameView->contentsSize()) != scrollLayer->bounds();
1067 return false; 1070 return false;
1068 } 1071 }
1069 1072
1070 } // namespace blink 1073 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/scroll/ProgrammaticScrollAnimator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698