OLD | NEW |
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 Loading... |
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 GraphicsLayer* layer = m_page->deprecatedLocalMainFrame()->view()->layerForS
crolling(); | 688 if (WebLayer* scrollLayer = toWebLayer(m_page->deprecatedLocalMainFrame()->v
iew()->layerForScrolling())) { |
689 if (WebLayer* scrollLayer = toWebLayer(layer)) { | |
690 m_lastMainThreadScrollingReasons = mainThreadScrollingReasons; | 689 m_lastMainThreadScrollingReasons = mainThreadScrollingReasons; |
691 if (mainThreadScrollingReasons) { | 690 if (mainThreadScrollingReasons) { |
692 if (ScrollAnimatorBase* scrollAnimator = layer->scrollableArea()->ex
istingScrollAnimator()) | |
693 scrollAnimator->takeoverCompositorAnimation(); | |
694 scrollLayer->addMainThreadScrollingReasons(mainThreadScrollingReason
s); | 691 scrollLayer->addMainThreadScrollingReasons(mainThreadScrollingReason
s); |
695 } else { | 692 } else { |
696 // Clear all main thread scrolling reasons except the one that's set | 693 // Clear all main thread scrolling reasons except the one that's set |
697 // if there is a running scroll animation. | 694 // if there is a running scroll animation. |
698 uint32_t mainThreadScrollingReasonsToClear = ~0u; | 695 uint32_t mainThreadScrollingReasonsToClear = ~0u; |
699 mainThreadScrollingReasonsToClear &= ~MainThreadScrollingReason::kAn
imatingScrollOnMainThread; | 696 mainThreadScrollingReasonsToClear &= ~MainThreadScrollingReason::kAn
imatingScrollOnMainThread; |
700 scrollLayer->clearMainThreadScrollingReasons(mainThreadScrollingReas
onsToClear); | 697 scrollLayer->clearMainThreadScrollingReasons(mainThreadScrollingReas
onsToClear); |
701 } | 698 } |
702 } | 699 } |
703 } | 700 } |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1064 bool frameIsScrollable = frameView && frameView->isScrollable(); | 1061 bool frameIsScrollable = frameView && frameView->isScrollable(); |
1065 if (frameIsScrollable != m_wasFrameScrollable) | 1062 if (frameIsScrollable != m_wasFrameScrollable) |
1066 return true; | 1063 return true; |
1067 | 1064 |
1068 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll
ing()) : nullptr) | 1065 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll
ing()) : nullptr) |
1069 return WebSize(frameView->contentsSize()) != scrollLayer->bounds(); | 1066 return WebSize(frameView->contentsSize()) != scrollLayer->bounds(); |
1070 return false; | 1067 return false; |
1071 } | 1068 } |
1072 | 1069 |
1073 } // namespace blink | 1070 } // namespace blink |
OLD | NEW |