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

Side by Side Diff: cc/layer_impl.cc

Issue 11464041: cc: Don't use partial updates for scrollbars when they are not allowed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix android Created 7 years, 12 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
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"
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/proxy.h" 17 #include "cc/proxy.h"
18 #include "cc/quad_sink.h" 18 #include "cc/quad_sink.h"
19 #include "cc/scrollbar_animation_controller.h" 19 #include "cc/scrollbar_animation_controller.h"
20 #include "cc/scrollbar_animation_controller_linear_fade.h"
20 #include "ui/gfx/point_conversions.h" 21 #include "ui/gfx/point_conversions.h"
21 #include "ui/gfx/rect_conversions.h" 22 #include "ui/gfx/rect_conversions.h"
22 23
23 namespace cc { 24 namespace cc {
24 25
25 LayerImpl::LayerImpl(LayerTreeImpl* treeImpl, int id) 26 LayerImpl::LayerImpl(LayerTreeImpl* treeImpl, int id)
26 : m_parent(0) 27 : m_parent(0)
27 , m_maskLayerId(-1) 28 , m_maskLayerId(-1)
28 , m_replicaLayerId(-1) 29 , m_replicaLayerId(-1)
29 , m_layerId(id) 30 , m_layerId(id)
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after
783 return m_scrollbarAnimationController ? m_scrollbarAnimationController->hori zontalScrollbarLayer() : 0; 784 return m_scrollbarAnimationController ? m_scrollbarAnimationController->hori zontalScrollbarLayer() : 0;
784 } 785 }
785 786
786 const ScrollbarLayerImpl* LayerImpl::horizontalScrollbarLayer() const 787 const ScrollbarLayerImpl* LayerImpl::horizontalScrollbarLayer() const
787 { 788 {
788 return m_scrollbarAnimationController ? m_scrollbarAnimationController->hori zontalScrollbarLayer() : 0; 789 return m_scrollbarAnimationController ? m_scrollbarAnimationController->hori zontalScrollbarLayer() : 0;
789 } 790 }
790 791
791 void LayerImpl::setHorizontalScrollbarLayer(ScrollbarLayerImpl* scrollbarLayer) 792 void LayerImpl::setHorizontalScrollbarLayer(ScrollbarLayerImpl* scrollbarLayer)
792 { 793 {
793 if (!m_scrollbarAnimationController) 794 if (!m_scrollbarAnimationController) {
794 m_scrollbarAnimationController = ScrollbarAnimationController::create(th is); 795 if (m_layerTreeImpl->settings().useLinearFadeScrollbarAnimator) {
796 static const double fadeoutDelay = 0.3;
enne (OOO) 2012/12/22 01:17:18 s/static const//
danakj 2012/12/22 01:23:26 Mhm! Done.
797 static const double fadeoutLength = 0.3;
798 m_scrollbarAnimationController = ScrollbarAnimationControllerLinearF ade::create(this, fadeoutDelay, fadeoutLength).PassAs<ScrollbarAnimationControll er>();
799 } else {
800 m_scrollbarAnimationController = ScrollbarAnimationController::creat e(this);
801 }
802 }
795 m_scrollbarAnimationController->setHorizontalScrollbarLayer(scrollbarLayer); 803 m_scrollbarAnimationController->setHorizontalScrollbarLayer(scrollbarLayer);
796 m_scrollbarAnimationController->updateScrollOffset(this); 804 m_scrollbarAnimationController->updateScrollOffset(this);
797 } 805 }
798 806
799 ScrollbarLayerImpl* LayerImpl::verticalScrollbarLayer() 807 ScrollbarLayerImpl* LayerImpl::verticalScrollbarLayer()
800 { 808 {
801 return m_scrollbarAnimationController ? m_scrollbarAnimationController->vert icalScrollbarLayer() : 0; 809 return m_scrollbarAnimationController ? m_scrollbarAnimationController->vert icalScrollbarLayer() : 0;
802 } 810 }
803 811
804 const ScrollbarLayerImpl* LayerImpl::verticalScrollbarLayer() const 812 const ScrollbarLayerImpl* LayerImpl::verticalScrollbarLayer() const
805 { 813 {
806 return m_scrollbarAnimationController ? m_scrollbarAnimationController->vert icalScrollbarLayer() : 0; 814 return m_scrollbarAnimationController ? m_scrollbarAnimationController->vert icalScrollbarLayer() : 0;
807 } 815 }
808 816
809 void LayerImpl::setVerticalScrollbarLayer(ScrollbarLayerImpl* scrollbarLayer) 817 void LayerImpl::setVerticalScrollbarLayer(ScrollbarLayerImpl* scrollbarLayer)
810 { 818 {
811 if (!m_scrollbarAnimationController) 819 if (!m_scrollbarAnimationController)
812 m_scrollbarAnimationController = ScrollbarAnimationController::create(th is); 820 m_scrollbarAnimationController = ScrollbarAnimationController::create(th is);
813 m_scrollbarAnimationController->setVerticalScrollbarLayer(scrollbarLayer); 821 m_scrollbarAnimationController->setVerticalScrollbarLayer(scrollbarLayer);
814 m_scrollbarAnimationController->updateScrollOffset(this); 822 m_scrollbarAnimationController->updateScrollOffset(this);
815 } 823 }
816 824
817 } // namespace cc 825 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698