Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Side by Side Diff: cc/layer_impl.cc

Issue 11777008: cc: Use maximum tiling contents scales for picture layer scale (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ok, 1.f Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/layer_impl.h ('k') | cc/layer_tree_host_common.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « cc/layer_impl.h ('k') | cc/layer_tree_host_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698