| 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 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 664 | 664 |
| 665 void ScrollingCoordinator::willDestroyLayer(PaintLayer* layer) | 665 void ScrollingCoordinator::willDestroyLayer(PaintLayer* layer) |
| 666 { | 666 { |
| 667 m_layersWithTouchRects.remove(layer); | 667 m_layersWithTouchRects.remove(layer); |
| 668 } | 668 } |
| 669 | 669 |
| 670 void ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThread(MainTh
readScrollingReasons mainThreadScrollingReasons) | 670 void ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThread(MainTh
readScrollingReasons mainThreadScrollingReasons) |
| 671 { | 671 { |
| 672 if (!m_page->mainFrame()->isLocalFrame() || !m_page->deprecatedLocalMainFram
e()->view()) | 672 if (!m_page->mainFrame()->isLocalFrame() || !m_page->deprecatedLocalMainFram
e()->view()) |
| 673 return; | 673 return; |
| 674 if (WebLayer* scrollLayer = toWebLayer(m_page->deprecatedLocalMainFrame()->v
iew()->layerForScrolling())) { | 674 GraphicsLayer* layer = m_page->deprecatedLocalMainFrame()->view()->layerForS
crolling(); |
| 675 if (WebLayer* scrollLayer = toWebLayer(layer)) { |
| 675 m_lastMainThreadScrollingReasons = mainThreadScrollingReasons; | 676 m_lastMainThreadScrollingReasons = mainThreadScrollingReasons; |
| 676 if (mainThreadScrollingReasons) { | 677 if (mainThreadScrollingReasons) { |
| 678 if (ScrollAnimatorBase* scrollAnimator = layer->scrollableArea()->ex
istingScrollAnimator()) |
| 679 scrollAnimator->takeoverCompositorAnimation(); |
| 677 scrollLayer->addMainThreadScrollingReasons(mainThreadScrollingReason
s); | 680 scrollLayer->addMainThreadScrollingReasons(mainThreadScrollingReason
s); |
| 678 } else { | 681 } else { |
| 679 // Clear all main thread scrolling reasons except the one that's set | 682 // Clear all main thread scrolling reasons except the one that's set |
| 680 // if there is a running scroll animation. | 683 // if there is a running scroll animation. |
| 681 uint32_t mainThreadScrollingReasonsToClear = ~0u; | 684 uint32_t mainThreadScrollingReasonsToClear = ~0u; |
| 682 mainThreadScrollingReasonsToClear &= ~MainThreadScrollingReason::kAn
imatingScrollOnMainThread; | 685 mainThreadScrollingReasonsToClear &= ~MainThreadScrollingReason::kAn
imatingScrollOnMainThread; |
| 683 scrollLayer->clearMainThreadScrollingReasons(mainThreadScrollingReas
onsToClear); | 686 scrollLayer->clearMainThreadScrollingReasons(mainThreadScrollingReas
onsToClear); |
| 684 } | 687 } |
| 685 } | 688 } |
| 686 } | 689 } |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1047 bool frameIsScrollable = frameView && frameView->isScrollable(); | 1050 bool frameIsScrollable = frameView && frameView->isScrollable(); |
| 1048 if (frameIsScrollable != m_wasFrameScrollable) | 1051 if (frameIsScrollable != m_wasFrameScrollable) |
| 1049 return true; | 1052 return true; |
| 1050 | 1053 |
| 1051 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll
ing()) : nullptr) | 1054 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll
ing()) : nullptr) |
| 1052 return WebSize(frameView->contentsSize()) != scrollLayer->bounds(); | 1055 return WebSize(frameView->contentsSize()) != scrollLayer->bounds(); |
| 1053 return false; | 1056 return false; |
| 1054 } | 1057 } |
| 1055 | 1058 |
| 1056 } // namespace blink | 1059 } // namespace blink |
| OLD | NEW |