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

Unified Diff: cc/trees/layer_tree_impl.cc

Issue 12552004: Support bottom-right anchored fixed-position elements during a pinch gesture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: forgot to save the comments. sorry. :( Created 7 years, 9 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 | « cc/trees/layer_tree_impl.h ('k') | webkit/compositor_bindings/web_layer_impl.h » ('j') | 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 bc9acf5a9e2df5015736e5859b98110e4c496ce4..fa4584c39806a23c968d9ffc226579a782cde6ed 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -259,6 +259,9 @@ struct UpdateTilePrioritiesForLayer {
};
void LayerTreeImpl::UpdateDrawProperties(UpdateDrawPropertiesReason reason) {
+ if (IsActiveTree() && RootScrollLayer() && RootClipLayer())
+ UpdateRootScrollLayerSizeDelta();
+
if (settings().solid_color_scrollbars &&
IsActiveTree() &&
RootScrollLayer()) {
@@ -666,4 +669,23 @@ bool LayerTreeImpl::HasPinchZoomScrollbars() const {
pinch_zoom_scrollbar_vertical_layer_id_ != Layer::INVALID_ID;
}
+void LayerTreeImpl::UpdateRootScrollLayerSizeDelta() {
+ LayerImpl* root_scroll = RootScrollLayer();
+ LayerImpl* root_clip = RootClipLayer();
+ DCHECK(root_scroll);
+ DCHECK(root_clip);
+ DCHECK(IsActiveTree());
+
+ gfx::Vector2dF scrollable_viewport_size =
+ gfx::RectF(ScrollableViewportSize()).bottom_right() - gfx::PointF();
+
+ gfx::Vector2dF original_viewport_size =
+ gfx::RectF(root_clip->bounds()).bottom_right() -
+ gfx::PointF();
+ original_viewport_size.Scale(1 / page_scale_factor());
+
+ root_scroll->SetFixedContainerSizeDelta(
+ scrollable_viewport_size - original_viewport_size);
+}
+
} // namespace cc
« no previous file with comments | « cc/trees/layer_tree_impl.h ('k') | webkit/compositor_bindings/web_layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698