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

Side by Side Diff: cc/trees/layer_tree_host_impl.cc

Issue 676853002: Defer scroll status determination until scrolling has occurred (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | content/renderer/render_widget.cc » ('j') | content/renderer/render_widget.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 1751 matching lines...) Expand 10 before | Expand all | Expand 10 after
1762 1762
1763 LayerImpl* LayerTreeHostImpl::OuterViewportScrollLayer() const { 1763 LayerImpl* LayerTreeHostImpl::OuterViewportScrollLayer() const {
1764 return active_tree_->OuterViewportScrollLayer(); 1764 return active_tree_->OuterViewportScrollLayer();
1765 } 1765 }
1766 1766
1767 LayerImpl* LayerTreeHostImpl::CurrentlyScrollingLayer() const { 1767 LayerImpl* LayerTreeHostImpl::CurrentlyScrollingLayer() const {
1768 return active_tree_->CurrentlyScrollingLayer(); 1768 return active_tree_->CurrentlyScrollingLayer();
1769 } 1769 }
1770 1770
1771 bool LayerTreeHostImpl::IsCurrentlyScrolling() const { 1771 bool LayerTreeHostImpl::IsCurrentlyScrolling() const {
1772 return CurrentlyScrollingLayer() || 1772 return (did_lock_scrolling_layer_ && CurrentlyScrollingLayer()) ||
1773 (InnerViewportScrollLayer() && 1773 (InnerViewportScrollLayer() &&
1774 InnerViewportScrollLayer()->IsExternalFlingActive()) || 1774 InnerViewportScrollLayer()->IsExternalFlingActive()) ||
1775 (OuterViewportScrollLayer() && 1775 (OuterViewportScrollLayer() &&
1776 OuterViewportScrollLayer()->IsExternalFlingActive()); 1776 OuterViewportScrollLayer()->IsExternalFlingActive());
1777 } 1777 }
1778 1778
1779 // Content layers can be either directly scrollable or contained in an outer 1779 // Content layers can be either directly scrollable or contained in an outer
1780 // scrolling layer which applies the scroll transform. Given a content layer, 1780 // scrolling layer which applies the scroll transform. Given a content layer,
1781 // this function returns the associated scroll layer if any. 1781 // this function returns the associated scroll layer if any.
1782 static LayerImpl* FindScrollLayerForContentLayer(LayerImpl* layer_impl) { 1782 static LayerImpl* FindScrollLayerForContentLayer(LayerImpl* layer_impl) {
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
2401 2401
2402 if (scroll_on_main_thread) { 2402 if (scroll_on_main_thread) {
2403 UMA_HISTOGRAM_BOOLEAN("TryScroll.SlowScroll", true); 2403 UMA_HISTOGRAM_BOOLEAN("TryScroll.SlowScroll", true);
2404 return ScrollOnMainThread; 2404 return ScrollOnMainThread;
2405 } 2405 }
2406 2406
2407 if (scrolling_layer_impl) { 2407 if (scrolling_layer_impl) {
2408 active_tree_->SetCurrentlyScrollingLayer(scrolling_layer_impl); 2408 active_tree_->SetCurrentlyScrollingLayer(scrolling_layer_impl);
2409 should_bubble_scrolls_ = (type != NonBubblingGesture); 2409 should_bubble_scrolls_ = (type != NonBubblingGesture);
2410 wheel_scrolling_ = (type == Wheel); 2410 wheel_scrolling_ = (type == Wheel);
2411 client_->RenewTreePriority();
brianderson 2014/10/23 20:55:51 Why is this removed? Is it because we'll only hav
jdduke (slow) 2014/10/23 22:12:49 Right, unless there's another side effect of this
2412 UMA_HISTOGRAM_BOOLEAN("TryScroll.SlowScroll", false); 2411 UMA_HISTOGRAM_BOOLEAN("TryScroll.SlowScroll", false);
2413 return ScrollStarted; 2412 return ScrollStarted;
2414 } 2413 }
2415 return ScrollIgnored; 2414 return ScrollIgnored;
2416 } 2415 }
2417 2416
2418 InputHandler::ScrollStatus LayerTreeHostImpl::ScrollAnimated( 2417 InputHandler::ScrollStatus LayerTreeHostImpl::ScrollAnimated(
2419 const gfx::Point& viewport_point, 2418 const gfx::Point& viewport_point,
2420 const gfx::Vector2dF& scroll_delta) { 2419 const gfx::Vector2dF& scroll_delta) {
2421 if (LayerImpl* layer_impl = CurrentlyScrollingLayer()) { 2420 if (LayerImpl* layer_impl = CurrentlyScrollingLayer()) {
(...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after
3477 } 3476 }
3478 3477
3479 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { 3478 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) {
3480 std::vector<PictureLayerImpl*>::iterator it = 3479 std::vector<PictureLayerImpl*>::iterator it =
3481 std::find(picture_layers_.begin(), picture_layers_.end(), layer); 3480 std::find(picture_layers_.begin(), picture_layers_.end(), layer);
3482 DCHECK(it != picture_layers_.end()); 3481 DCHECK(it != picture_layers_.end());
3483 picture_layers_.erase(it); 3482 picture_layers_.erase(it);
3484 } 3483 }
3485 3484
3486 } // namespace cc 3485 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | content/renderer/render_widget.cc » ('j') | content/renderer/render_widget.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698