| 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" |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 | 273 |
| 274 gfx::Rect LayerImpl::layerRectToContentRect(const gfx::RectF& layerRect) const | 274 gfx::Rect LayerImpl::layerRectToContentRect(const gfx::RectF& layerRect) const |
| 275 { | 275 { |
| 276 gfx::RectF contentRect = gfx::ScaleRect(layerRect, contentsScaleX(), content
sScaleY()); | 276 gfx::RectF contentRect = gfx::ScaleRect(layerRect, contentsScaleX(), content
sScaleY()); |
| 277 // Intersect with content rect to avoid the extra pixel because for some | 277 // 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. | 278 // values x and y, ceil((x / y) * y) may be x + 1. |
| 279 contentRect.Intersect(gfx::Rect(gfx::Point(), contentBounds())); | 279 contentRect.Intersect(gfx::Rect(gfx::Point(), contentBounds())); |
| 280 return gfx::ToEnclosingRect(contentRect); | 280 return gfx::ToEnclosingRect(contentRect); |
| 281 } | 281 } |
| 282 | 282 |
| 283 skia::RefPtr<SkPicture> LayerImpl::getPicture() |
| 284 { |
| 285 return skia::RefPtr<SkPicture>(); |
| 286 } |
| 287 |
| 283 std::string LayerImpl::indentString(int indent) | 288 std::string LayerImpl::indentString(int indent) |
| 284 { | 289 { |
| 285 std::string str; | 290 std::string str; |
| 286 for (int i = 0; i != indent; ++i) | 291 for (int i = 0; i != indent; ++i) |
| 287 str.append(" "); | 292 str.append(" "); |
| 288 return str; | 293 return str; |
| 289 } | 294 } |
| 290 | 295 |
| 291 void LayerImpl::dumpLayerProperties(std::string* str, int indent) const | 296 void LayerImpl::dumpLayerProperties(std::string* str, int indent) const |
| 292 { | 297 { |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 822 if (m_layerTreeImpl->settings().useLinearFadeScrollbarAnimator) | 827 if (m_layerTreeImpl->settings().useLinearFadeScrollbarAnimator) |
| 823 m_scrollbarAnimationController = createScrollbarAnimationControllerW
ithFade(this); | 828 m_scrollbarAnimationController = createScrollbarAnimationControllerW
ithFade(this); |
| 824 else | 829 else |
| 825 m_scrollbarAnimationController = ScrollbarAnimationController::creat
e(this); | 830 m_scrollbarAnimationController = ScrollbarAnimationController::creat
e(this); |
| 826 } | 831 } |
| 827 m_scrollbarAnimationController->setVerticalScrollbarLayer(scrollbarLayer); | 832 m_scrollbarAnimationController->setVerticalScrollbarLayer(scrollbarLayer); |
| 828 m_scrollbarAnimationController->updateScrollOffset(this); | 833 m_scrollbarAnimationController->updateScrollOffset(this); |
| 829 } | 834 } |
| 830 | 835 |
| 831 } // namespace cc | 836 } // namespace cc |
| OLD | NEW |