OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/layers/scrollbar_layer.h" | 5 #include "cc/layers/scrollbar_layer.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "cc/layers/scrollbar_layer_impl.h" | 9 #include "cc/layers/scrollbar_layer_impl.h" |
10 #include "cc/resources/caching_bitmap_content_layer_updater.h" | 10 #include "cc/resources/caching_bitmap_content_layer_updater.h" |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
354 resource->Update(queue, rect, dest_offset, partial_updates_allowed, stats); | 354 resource->Update(queue, rect, dest_offset, partial_updates_allowed, stats); |
355 } | 355 } |
356 | 356 |
357 gfx::Rect ScrollbarLayer::ScrollbarLayerRectToContentRect( | 357 gfx::Rect ScrollbarLayer::ScrollbarLayerRectToContentRect( |
358 gfx::Rect layer_rect) const { | 358 gfx::Rect layer_rect) const { |
359 // Don't intersect with the bounds as in LayerRectToContentRect() because | 359 // Don't intersect with the bounds as in LayerRectToContentRect() because |
360 // layer_rect here might be in coordinates of the containing layer. | 360 // layer_rect here might be in coordinates of the containing layer. |
361 gfx::RectF content_rect = gfx::ScaleRect(layer_rect, | 361 gfx::RectF content_rect = gfx::ScaleRect(layer_rect, |
362 contents_scale_y(), | 362 contents_scale_y(), |
363 contents_scale_y()); | 363 contents_scale_y()); |
364 return gfx::ToEnclosingRect(content_rect); | 364 return gfx::ToSizedRect(content_rect); |
enne (OOO)
2013/04/19 20:38:07
Why do you want to round down the size here?
girard
2013/06/03 22:31:55
This line slipped in from another patch I was eval
| |
365 } | 365 } |
366 | 366 |
367 void ScrollbarLayer::SetTexturePriorities( | 367 void ScrollbarLayer::SetTexturePriorities( |
368 const PriorityCalculator& priority_calc) { | 368 const PriorityCalculator& priority_calc) { |
369 if (layer_tree_host()->settings().solid_color_scrollbars) | 369 if (layer_tree_host()->settings().solid_color_scrollbars) |
370 return; | 370 return; |
371 | 371 |
372 if (content_bounds().IsEmpty()) | 372 if (content_bounds().IsEmpty()) |
373 return; | 373 return; |
374 DCHECK_LE(content_bounds().width(), MaxTextureSize()); | 374 DCHECK_LE(content_bounds().width(), MaxTextureSize()); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
435 thumb_.get(), | 435 thumb_.get(), |
436 origin_thumb_rect, | 436 origin_thumb_rect, |
437 queue, | 437 queue, |
438 stats); | 438 stats); |
439 } | 439 } |
440 | 440 |
441 dirty_rect_ = gfx::RectF(); | 441 dirty_rect_ = gfx::RectF(); |
442 } | 442 } |
443 | 443 |
444 } // namespace cc | 444 } // namespace cc |
OLD | NEW |