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

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

Issue 14367021: Rename ClampToMin and ClampToMax (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 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 unified diff | Download patch | Annotate | Revision Log
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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 208
209 void LayerTreeImpl::UpdateMaxScrollOffset() { 209 void LayerTreeImpl::UpdateMaxScrollOffset() {
210 if (!root_scroll_layer_ || !root_scroll_layer_->children().size()) 210 if (!root_scroll_layer_ || !root_scroll_layer_->children().size())
211 return; 211 return;
212 212
213 gfx::Vector2dF max_scroll = gfx::Rect(ScrollableSize()).bottom_right() - 213 gfx::Vector2dF max_scroll = gfx::Rect(ScrollableSize()).bottom_right() -
214 gfx::RectF(ScrollableViewportSize()).bottom_right(); 214 gfx::RectF(ScrollableViewportSize()).bottom_right();
215 215
216 // The viewport may be larger than the contents in some cases, such as 216 // The viewport may be larger than the contents in some cases, such as
217 // having a vertical scrollbar but no horizontal overflow. 217 // having a vertical scrollbar but no horizontal overflow.
218 max_scroll.ClampToMin(gfx::Vector2dF()); 218 max_scroll.ClampToLowerBound(gfx::Vector2dF());
219 219
220 root_scroll_layer_->SetMaxScrollOffset(gfx::ToFlooredVector2d(max_scroll)); 220 root_scroll_layer_->SetMaxScrollOffset(gfx::ToFlooredVector2d(max_scroll));
221 } 221 }
222 222
223 gfx::Transform LayerTreeImpl::ImplTransform() const { 223 gfx::Transform LayerTreeImpl::ImplTransform() const {
224 gfx::Transform transform; 224 gfx::Transform transform;
225 transform.Scale(total_page_scale_factor(), total_page_scale_factor()); 225 transform.Scale(total_page_scale_factor(), total_page_scale_factor());
226 return transform; 226 return transform;
227 } 227 }
228 228
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 gfx::Vector2dF original_viewport_size = 678 gfx::Vector2dF original_viewport_size =
679 gfx::RectF(root_clip->bounds()).bottom_right() - 679 gfx::RectF(root_clip->bounds()).bottom_right() -
680 gfx::PointF(); 680 gfx::PointF();
681 original_viewport_size.Scale(1 / page_scale_factor()); 681 original_viewport_size.Scale(1 / page_scale_factor());
682 682
683 root_scroll->SetFixedContainerSizeDelta( 683 root_scroll->SetFixedContainerSizeDelta(
684 scrollable_viewport_size - original_viewport_size); 684 scrollable_viewport_size - original_viewport_size);
685 } 685 }
686 686
687 } // namespace cc 687 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698