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

Side by Side Diff: cc/layers/scrollbar_layer.cc

Issue 14367021: Rename ClampToMin and ClampToMax (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 6 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
« no previous file with comments | « cc/layers/picture_layer_impl.cc ('k') | cc/layers/tiled_layer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 // Copyright 2012 The Chromium Authors. All rights reserved. 2 // Copyright 2012 The Chromium Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be 3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file. 4 // found in the LICENSE file.
5 5
6 #include "cc/layers/scrollbar_layer.h" 6 #include "cc/layers/scrollbar_layer.h"
7 7
8 #include "base/auto_reset.h" 8 #include "base/auto_reset.h"
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 } 251 }
252 252
253 gfx::Rect ScrollbarLayer::ScrollbarLayerRectToContentRect( 253 gfx::Rect ScrollbarLayer::ScrollbarLayerRectToContentRect(
254 gfx::Rect layer_rect) const { 254 gfx::Rect layer_rect) const {
255 // Don't intersect with the bounds as in LayerRectToContentRect() because 255 // Don't intersect with the bounds as in LayerRectToContentRect() because
256 // layer_rect here might be in coordinates of the containing layer. 256 // layer_rect here might be in coordinates of the containing layer.
257 gfx::Rect expanded_rect = gfx::ScaleToEnclosingRect( 257 gfx::Rect expanded_rect = gfx::ScaleToEnclosingRect(
258 layer_rect, contents_scale_y(), contents_scale_y()); 258 layer_rect, contents_scale_y(), contents_scale_y());
259 // We should never return a rect bigger than the content_bounds(). 259 // We should never return a rect bigger than the content_bounds().
260 gfx::Size clamped_size = expanded_rect.size(); 260 gfx::Size clamped_size = expanded_rect.size();
261 clamped_size.ClampToMax(content_bounds()); 261 clamped_size.SetToMin(content_bounds());
262 expanded_rect.set_size(clamped_size); 262 expanded_rect.set_size(clamped_size);
263 return expanded_rect; 263 return expanded_rect;
264 } 264 }
265 265
266 void ScrollbarLayer::SetTexturePriorities( 266 void ScrollbarLayer::SetTexturePriorities(
267 const PriorityCalculator& priority_calc) { 267 const PriorityCalculator& priority_calc) {
268 if (layer_tree_host()->settings().solid_color_scrollbars) 268 if (layer_tree_host()->settings().solid_color_scrollbars)
269 return; 269 return;
270 270
271 if (content_bounds().IsEmpty()) 271 if (content_bounds().IsEmpty())
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 thumb_size = gfx::Size(scrollbar_->ThumbLength(), 341 thumb_size = gfx::Size(scrollbar_->ThumbLength(),
342 scrollbar_->ThumbThickness()); 342 scrollbar_->ThumbThickness());
343 } else { 343 } else {
344 thumb_size = gfx::Size(scrollbar_->ThumbThickness(), 344 thumb_size = gfx::Size(scrollbar_->ThumbThickness(),
345 scrollbar_->ThumbLength()); 345 scrollbar_->ThumbLength());
346 } 346 }
347 return ScrollbarLayerRectToContentRect(gfx::Rect(thumb_size)); 347 return ScrollbarLayerRectToContentRect(gfx::Rect(thumb_size));
348 } 348 }
349 349
350 } // namespace cc 350 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/picture_layer_impl.cc ('k') | cc/layers/tiled_layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698