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

Side by Side 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: correct translate order. move math to a separate function. 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 unified diff | Download patch
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_impl.h" 5 #include "cc/trees/layer_tree_impl.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "cc/animation/animation.h" 8 #include "cc/animation/animation.h"
9 #include "cc/animation/animation_id_provider.h" 9 #include "cc/animation/animation_id_provider.h"
10 #include "cc/animation/keyframed_animation_curve.h" 10 #include "cc/animation/keyframed_animation_curve.h"
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 return; 209 return;
210 210
211 gfx::Vector2dF max_scroll = gfx::Rect(ScrollableSize()).bottom_right() - 211 gfx::Vector2dF max_scroll = gfx::Rect(ScrollableSize()).bottom_right() -
212 gfx::RectF(ScrollableViewportSize()).bottom_right(); 212 gfx::RectF(ScrollableViewportSize()).bottom_right();
213 213
214 // The viewport may be larger than the contents in some cases, such as 214 // The viewport may be larger than the contents in some cases, such as
215 // having a vertical scrollbar but no horizontal overflow. 215 // having a vertical scrollbar but no horizontal overflow.
216 max_scroll.ClampToMin(gfx::Vector2dF()); 216 max_scroll.ClampToMin(gfx::Vector2dF());
217 217
218 root_scroll_layer_->SetMaxScrollOffset(gfx::ToFlooredVector2d(max_scroll)); 218 root_scroll_layer_->SetMaxScrollOffset(gfx::ToFlooredVector2d(max_scroll));
219
220 gfx::Vector2dF scrollable_viewport_size =
221 gfx::RectF(ScrollableViewportSize()).bottom_right() - gfx::PointF();
222 gfx::Vector2dF original_scrollable_viewport_size =
223 gfx::RectF(layer_tree_host_impl_->VisibleViewportSize()).bottom_right() -
224 gfx::PointF();
225 original_scrollable_viewport_size.Scale(1 / page_scale_factor());
226 root_scroll_layer_->SetFixedContainerSizeDelta(
227 scrollable_viewport_size - original_scrollable_viewport_size);
219 } 228 }
220 229
221 gfx::Transform LayerTreeImpl::ImplTransform() const { 230 gfx::Transform LayerTreeImpl::ImplTransform() const {
222 gfx::Transform transform; 231 gfx::Transform transform;
223 transform.Scale(total_page_scale_factor(), total_page_scale_factor()); 232 transform.Scale(total_page_scale_factor(), total_page_scale_factor());
224 return transform; 233 return transform;
225 } 234 }
226 235
227 void LayerTreeImpl::UpdateSolidColorScrollbars() { 236 void LayerTreeImpl::UpdateSolidColorScrollbars() {
228 DCHECK(settings().solid_color_scrollbars); 237 DCHECK(settings().solid_color_scrollbars);
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 StartFadeOutAnimation(PinchZoomScrollbarVertical()); 661 StartFadeOutAnimation(PinchZoomScrollbarVertical());
653 } 662 }
654 663
655 bool LayerTreeImpl::HasPinchZoomScrollbars() const { 664 bool LayerTreeImpl::HasPinchZoomScrollbars() const {
656 return pinch_zoom_scrollbar_horizontal_layer_id_ != Layer::INVALID_ID && 665 return pinch_zoom_scrollbar_horizontal_layer_id_ != Layer::INVALID_ID &&
657 pinch_zoom_scrollbar_vertical_layer_id_ != Layer::INVALID_ID; 666 pinch_zoom_scrollbar_vertical_layer_id_ != Layer::INVALID_ID;
658 } 667 }
659 668
660 669
661 } // namespace cc 670 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698