Index: cc/trees/layer_tree_impl.cc |
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc |
index 4604043663920750438b5de260b0d8a0249d36b2..ad4060f04c8158b2fbd90abd783fb0682017e27b 100644 |
--- a/cc/trees/layer_tree_impl.cc |
+++ b/cc/trees/layer_tree_impl.cc |
@@ -7,6 +7,8 @@ |
#include "base/debug/trace_event.h" |
#include "cc/animation/keyframed_animation_curve.h" |
#include "cc/animation/scrollbar_animation_controller.h" |
+#include "cc/base/math_util.h" |
+#include "cc/base/util.h" |
#include "cc/debug/traced_value.h" |
#include "cc/layers/heads_up_display_layer_impl.h" |
#include "cc/layers/layer.h" |
@@ -238,6 +240,15 @@ gfx::SizeF LayerTreeImpl::ScrollableViewportSize() const { |
1.0f / total_page_scale_factor()); |
} |
+gfx::Rect LayerTreeImpl::RootScrollLayerDeviceViewportBounds() const { |
+ if (!root_scroll_layer_ || root_scroll_layer_->children().empty()) |
+ return gfx::Rect(); |
+ LayerImpl* layer = root_scroll_layer_->children()[0]; |
+ return MathUtil::MapClippedRect( |
+ layer->screen_space_transform(), |
+ gfx::Rect(layer->content_bounds())); |
+} |
+ |
void LayerTreeImpl::UpdateMaxScrollOffset() { |
LayerImpl* root_scroll = RootScrollLayer(); |
if (!root_scroll || !root_scroll->children().size()) |