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 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
694 void LayerImpl::setContentsScale(float contentsScaleX, float contentsScaleY) | 694 void LayerImpl::setContentsScale(float contentsScaleX, float contentsScaleY) |
695 { | 695 { |
696 if (this->contentsScaleX() == contentsScaleX && this->contentsScaleY() == co
ntentsScaleY) | 696 if (this->contentsScaleX() == contentsScaleX && this->contentsScaleY() == co
ntentsScaleY) |
697 return; | 697 return; |
698 | 698 |
699 m_drawProperties.contents_scale_x = contentsScaleX; | 699 m_drawProperties.contents_scale_x = contentsScaleX; |
700 m_drawProperties.contents_scale_y = contentsScaleY; | 700 m_drawProperties.contents_scale_y = contentsScaleY; |
701 noteLayerPropertyChanged(); | 701 noteLayerPropertyChanged(); |
702 } | 702 } |
703 | 703 |
| 704 void LayerImpl::calculateContentsScale( |
| 705 float idealContentsScale, |
| 706 float* contentsScaleX, |
| 707 float* contentsScaleY, |
| 708 gfx::Size* contentBounds) |
| 709 { |
| 710 // Base LayerImpl has all of its content scales and content bounds pushed |
| 711 // from its Layer during commit and just reuses those values as-is. |
| 712 *contentsScaleX = this->contentsScaleX(); |
| 713 *contentsScaleY = this->contentsScaleY(); |
| 714 *contentBounds = this->contentBounds(); |
| 715 } |
| 716 |
704 void LayerImpl::setScrollOffset(gfx::Vector2d scrollOffset) | 717 void LayerImpl::setScrollOffset(gfx::Vector2d scrollOffset) |
705 { | 718 { |
706 if (m_scrollOffset == scrollOffset) | 719 if (m_scrollOffset == scrollOffset) |
707 return; | 720 return; |
708 | 721 |
709 m_scrollOffset = scrollOffset; | 722 m_scrollOffset = scrollOffset; |
710 noteLayerPropertyChangedForSubtree(); | 723 noteLayerPropertyChangedForSubtree(); |
711 } | 724 } |
712 | 725 |
713 void LayerImpl::setScrollDelta(const gfx::Vector2dF& scrollDelta) | 726 void LayerImpl::setScrollDelta(const gfx::Vector2dF& scrollDelta) |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
822 if (m_layerTreeImpl->settings().useLinearFadeScrollbarAnimator) | 835 if (m_layerTreeImpl->settings().useLinearFadeScrollbarAnimator) |
823 m_scrollbarAnimationController = createScrollbarAnimationControllerW
ithFade(this); | 836 m_scrollbarAnimationController = createScrollbarAnimationControllerW
ithFade(this); |
824 else | 837 else |
825 m_scrollbarAnimationController = ScrollbarAnimationController::creat
e(this); | 838 m_scrollbarAnimationController = ScrollbarAnimationController::creat
e(this); |
826 } | 839 } |
827 m_scrollbarAnimationController->setVerticalScrollbarLayer(scrollbarLayer); | 840 m_scrollbarAnimationController->setVerticalScrollbarLayer(scrollbarLayer); |
828 m_scrollbarAnimationController->updateScrollOffset(this); | 841 m_scrollbarAnimationController->updateScrollOffset(this); |
829 } | 842 } |
830 | 843 |
831 } // namespace cc | 844 } // namespace cc |
OLD | NEW |