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

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

Issue 634683003: Converted LayerImpl::bounds() to return SizeF. (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 | « cc/trees/layer_tree_host_common_unittest.cc ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
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 2639 matching lines...) Expand 10 before | Expand all | Expand 10 after
2650 2650
2651 for (LayerImpl* layer_impl = CurrentlyScrollingLayer(); 2651 for (LayerImpl* layer_impl = CurrentlyScrollingLayer();
2652 layer_impl; 2652 layer_impl;
2653 layer_impl = layer_impl->parent()) { 2653 layer_impl = layer_impl->parent()) {
2654 if (!layer_impl->scrollable()) 2654 if (!layer_impl->scrollable())
2655 continue; 2655 continue;
2656 2656
2657 if (!layer_impl->HasScrollbar(VERTICAL)) 2657 if (!layer_impl->HasScrollbar(VERTICAL))
2658 continue; 2658 continue;
2659 2659
2660 float height = layer_impl->clip_height(); 2660 float height = layer_impl->scroll_clip_layer()
2661 ? layer_impl->scroll_clip_layer()->bounds().height()
2662 : 0;
2661 2663
2662 // These magical values match WebKit and are designed to scroll nearly the 2664 // These magical values match WebKit and are designed to scroll nearly the
2663 // entire visible content height but leave a bit of overlap. 2665 // entire visible content height but leave a bit of overlap.
2664 float page = std::max(height * 0.875f, 1.f); 2666 float page = std::max(height * 0.875f, 1.f);
2665 if (direction == SCROLL_BACKWARD) 2667 if (direction == SCROLL_BACKWARD)
2666 page = -page; 2668 page = -page;
2667 2669
2668 gfx::Vector2dF delta = gfx::Vector2dF(0.f, page); 2670 gfx::Vector2dF delta = gfx::Vector2dF(0.f, page);
2669 2671
2670 gfx::Vector2dF applied_delta = ScrollLayerWithLocalDelta(layer_impl, delta); 2672 gfx::Vector2dF applied_delta = ScrollLayerWithLocalDelta(layer_impl, delta);
(...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after
3375 } 3377 }
3376 3378
3377 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { 3379 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) {
3378 std::vector<PictureLayerImpl*>::iterator it = 3380 std::vector<PictureLayerImpl*>::iterator it =
3379 std::find(picture_layers_.begin(), picture_layers_.end(), layer); 3381 std::find(picture_layers_.begin(), picture_layers_.end(), layer);
3380 DCHECK(it != picture_layers_.end()); 3382 DCHECK(it != picture_layers_.end());
3381 picture_layers_.erase(it); 3383 picture_layers_.erase(it);
3382 } 3384 }
3383 3385
3384 } // namespace cc 3386 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_common_unittest.cc ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698