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

Unified Diff: cc/trees/layer_tree_impl.cc

Issue 1862623003: cc: Use scroll layer bounds as scrollable area size (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_impl.cc
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc
index 7f56ae4af5f5ce08b2a0918842f0b53d3bd99913..5525263d385696fbb63b68bc73b9100a0c80ee38 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -725,11 +725,11 @@ gfx::Rect LayerTreeImpl::RootScrollLayerDeviceViewportBounds() const {
LayerImpl* root_scroll_layer = OuterViewportScrollLayer()
? OuterViewportScrollLayer()
: InnerViewportScrollLayer();
- if (!root_scroll_layer || root_scroll_layer->children().empty())
+ if (!root_scroll_layer)
return gfx::Rect();
- LayerImpl* layer = root_scroll_layer->children()[0];
- return MathUtil::MapEnclosingClippedRect(layer->ScreenSpaceTransform(),
- gfx::Rect(layer->bounds()));
+ return MathUtil::MapEnclosingClippedRect(
+ root_scroll_layer->ScreenSpaceTransform(),
+ gfx::Rect(root_scroll_layer->bounds()));
}
void LayerTreeImpl::ApplySentScrollAndScaleDeltasFromAbortedCommit() {
@@ -988,11 +988,10 @@ gfx::SizeF LayerTreeImpl::ScrollableSize() const {
LayerImpl* root_scroll_layer = OuterViewportScrollLayer()
? OuterViewportScrollLayer()
: InnerViewportScrollLayer();
- if (!root_scroll_layer || root_scroll_layer->children().empty())
+ if (!root_scroll_layer)
return gfx::SizeF();
- gfx::SizeF content_size =
- root_scroll_layer->children()[0]->BoundsForScrolling();
+ gfx::SizeF content_size = root_scroll_layer->BoundsForScrolling();
gfx::SizeF viewport_size =
root_scroll_layer->scroll_clip_layer()->BoundsForScrolling();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698