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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 | 280 |
281 gfx::Rect LayerImpl::layerRectToContentRect(const gfx::RectF& layerRect) const | 281 gfx::Rect LayerImpl::layerRectToContentRect(const gfx::RectF& layerRect) const |
282 { | 282 { |
283 gfx::RectF contentRect = gfx::ScaleRect(layerRect, contentsScaleX(), content
sScaleY()); | 283 gfx::RectF contentRect = gfx::ScaleRect(layerRect, contentsScaleX(), content
sScaleY()); |
284 // Intersect with content rect to avoid the extra pixel because for some | 284 // Intersect with content rect to avoid the extra pixel because for some |
285 // values x and y, ceil((x / y) * y) may be x + 1. | 285 // values x and y, ceil((x / y) * y) may be x + 1. |
286 contentRect.Intersect(gfx::Rect(gfx::Point(), contentBounds())); | 286 contentRect.Intersect(gfx::Rect(gfx::Point(), contentBounds())); |
287 return gfx::ToEnclosingRect(contentRect); | 287 return gfx::ToEnclosingRect(contentRect); |
288 } | 288 } |
289 | 289 |
| 290 bool LayerImpl::canClipSelf() const |
| 291 { |
| 292 return false; |
| 293 } |
| 294 |
290 std::string LayerImpl::indentString(int indent) | 295 std::string LayerImpl::indentString(int indent) |
291 { | 296 { |
292 std::string str; | 297 std::string str; |
293 for (int i = 0; i != indent; ++i) | 298 for (int i = 0; i != indent; ++i) |
294 str.append(" "); | 299 str.append(" "); |
295 return str; | 300 return str; |
296 } | 301 } |
297 | 302 |
298 void LayerImpl::dumpLayerProperties(std::string* str, int indent) const | 303 void LayerImpl::dumpLayerProperties(std::string* str, int indent) const |
299 { | 304 { |
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
847 if (m_layerTreeImpl->settings().useLinearFadeScrollbarAnimator) | 852 if (m_layerTreeImpl->settings().useLinearFadeScrollbarAnimator) |
848 m_scrollbarAnimationController = createScrollbarAnimationControllerW
ithFade(this); | 853 m_scrollbarAnimationController = createScrollbarAnimationControllerW
ithFade(this); |
849 else | 854 else |
850 m_scrollbarAnimationController = ScrollbarAnimationController::creat
e(this); | 855 m_scrollbarAnimationController = ScrollbarAnimationController::creat
e(this); |
851 } | 856 } |
852 m_scrollbarAnimationController->setVerticalScrollbarLayer(scrollbarLayer); | 857 m_scrollbarAnimationController->setVerticalScrollbarLayer(scrollbarLayer); |
853 m_scrollbarAnimationController->updateScrollOffset(this); | 858 m_scrollbarAnimationController->updateScrollOffset(this); |
854 } | 859 } |
855 | 860 |
856 } // namespace cc | 861 } // namespace cc |
OLD | NEW |