| OLD | NEW |
| 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/layer_impl.h" | 5 #include "cc/layer_impl.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "cc/animation_registrar.h" | 10 #include "cc/animation_registrar.h" |
| 11 #include "cc/debug_border_draw_quad.h" | 11 #include "cc/debug_border_draw_quad.h" |
| 12 #include "cc/debug_colors.h" | 12 #include "cc/debug_colors.h" |
| 13 #include "cc/layer_tree_debug_state.h" | 13 #include "cc/layer_tree_debug_state.h" |
| 14 #include "cc/layer_tree_impl.h" | 14 #include "cc/layer_tree_impl.h" |
| 15 #include "cc/layer_tree_settings.h" | 15 #include "cc/layer_tree_settings.h" |
| 16 #include "cc/math_util.h" | 16 #include "cc/math_util.h" |
| 17 #include "cc/picture_pile_impl.h" |
| 17 #include "cc/proxy.h" | 18 #include "cc/proxy.h" |
| 18 #include "cc/quad_sink.h" | 19 #include "cc/quad_sink.h" |
| 19 #include "cc/scrollbar_animation_controller.h" | 20 #include "cc/scrollbar_animation_controller.h" |
| 20 #include "cc/scrollbar_animation_controller_linear_fade.h" | 21 #include "cc/scrollbar_animation_controller_linear_fade.h" |
| 21 #include "ui/gfx/point_conversions.h" | 22 #include "ui/gfx/point_conversions.h" |
| 22 #include "ui/gfx/rect_conversions.h" | 23 #include "ui/gfx/rect_conversions.h" |
| 23 | 24 |
| 24 namespace cc { | 25 namespace cc { |
| 25 | 26 |
| 26 LayerImpl::LayerImpl(LayerTreeImpl* treeImpl, int id) | 27 LayerImpl::LayerImpl(LayerTreeImpl* treeImpl, int id) |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 | 274 |
| 274 gfx::Rect LayerImpl::layerRectToContentRect(const gfx::RectF& layerRect) const | 275 gfx::Rect LayerImpl::layerRectToContentRect(const gfx::RectF& layerRect) const |
| 275 { | 276 { |
| 276 gfx::RectF contentRect = gfx::ScaleRect(layerRect, contentsScaleX(), content
sScaleY()); | 277 gfx::RectF contentRect = gfx::ScaleRect(layerRect, contentsScaleX(), content
sScaleY()); |
| 277 // Intersect with content rect to avoid the extra pixel because for some | 278 // Intersect with content rect to avoid the extra pixel because for some |
| 278 // values x and y, ceil((x / y) * y) may be x + 1. | 279 // values x and y, ceil((x / y) * y) may be x + 1. |
| 279 contentRect.Intersect(gfx::Rect(gfx::Point(), contentBounds())); | 280 contentRect.Intersect(gfx::Rect(gfx::Point(), contentBounds())); |
| 280 return gfx::ToEnclosingRect(contentRect); | 281 return gfx::ToEnclosingRect(contentRect); |
| 281 } | 282 } |
| 282 | 283 |
| 284 scoped_refptr<PicturePileImpl> LayerImpl::GetPicturePileClone() const |
| 285 { |
| 286 return scoped_refptr<PicturePileImpl>(); |
| 287 } |
| 288 |
| 283 std::string LayerImpl::indentString(int indent) | 289 std::string LayerImpl::indentString(int indent) |
| 284 { | 290 { |
| 285 std::string str; | 291 std::string str; |
| 286 for (int i = 0; i != indent; ++i) | 292 for (int i = 0; i != indent; ++i) |
| 287 str.append(" "); | 293 str.append(" "); |
| 288 return str; | 294 return str; |
| 289 } | 295 } |
| 290 | 296 |
| 291 void LayerImpl::dumpLayerProperties(std::string* str, int indent) const | 297 void LayerImpl::dumpLayerProperties(std::string* str, int indent) const |
| 292 { | 298 { |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 822 if (m_layerTreeImpl->settings().useLinearFadeScrollbarAnimator) | 828 if (m_layerTreeImpl->settings().useLinearFadeScrollbarAnimator) |
| 823 m_scrollbarAnimationController = createScrollbarAnimationControllerW
ithFade(this); | 829 m_scrollbarAnimationController = createScrollbarAnimationControllerW
ithFade(this); |
| 824 else | 830 else |
| 825 m_scrollbarAnimationController = ScrollbarAnimationController::creat
e(this); | 831 m_scrollbarAnimationController = ScrollbarAnimationController::creat
e(this); |
| 826 } | 832 } |
| 827 m_scrollbarAnimationController->setVerticalScrollbarLayer(scrollbarLayer); | 833 m_scrollbarAnimationController->setVerticalScrollbarLayer(scrollbarLayer); |
| 828 m_scrollbarAnimationController->updateScrollOffset(this); | 834 m_scrollbarAnimationController->updateScrollOffset(this); |
| 829 } | 835 } |
| 830 | 836 |
| 831 } // namespace cc | 837 } // namespace cc |
| OLD | NEW |