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

Side by Side Diff: cc/scrollbar_animation_controller.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: nit Created 8 years 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/resource_update_controller.cc ('k') | cc/scrollbar_layer.h » ('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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/scrollbar_animation_controller.h" 5 #include "cc/scrollbar_animation_controller.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/time.h" 8 #include "base/time.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "cc/scrollbar_layer_impl.h" 10 #include "cc/scrollbar_layer_impl.h"
11 11
12 #if defined(OS_ANDROID)
13 #include "cc/scrollbar_animation_controller_linear_fade.h"
14 #endif
15
16 namespace cc { 12 namespace cc {
17 13
18 #if defined(OS_ANDROID)
19 scoped_ptr<ScrollbarAnimationController> ScrollbarAnimationController::create(La yerImpl* scrollLayer)
20 {
21 static const double fadeoutDelay = 0.3;
22 static const double fadeoutLength = 0.3;
23 return ScrollbarAnimationControllerLinearFade::create(scrollLayer, fadeoutDe lay, fadeoutLength).PassAs<ScrollbarAnimationController>();
24 }
25 #else
26 scoped_ptr<ScrollbarAnimationController> ScrollbarAnimationController::create(La yerImpl* scrollLayer) 14 scoped_ptr<ScrollbarAnimationController> ScrollbarAnimationController::create(La yerImpl* scrollLayer)
27 { 15 {
28 return make_scoped_ptr(new ScrollbarAnimationController(scrollLayer)); 16 return make_scoped_ptr(new ScrollbarAnimationController(scrollLayer));
29 } 17 }
30 #endif
31 18
32 ScrollbarAnimationController::ScrollbarAnimationController(LayerImpl* scrollLaye r) 19 ScrollbarAnimationController::ScrollbarAnimationController(LayerImpl* scrollLaye r)
33 : m_horizontalScrollbarLayer(0) 20 : m_horizontalScrollbarLayer(0)
34 , m_verticalScrollbarLayer(0) 21 , m_verticalScrollbarLayer(0)
35 { 22 {
36 ScrollbarAnimationController::updateScrollOffsetAtTime(scrollLayer, 0); 23 ScrollbarAnimationController::updateScrollOffsetAtTime(scrollLayer, 0);
37 } 24 }
38 25
39 ScrollbarAnimationController::~ScrollbarAnimationController() 26 ScrollbarAnimationController::~ScrollbarAnimationController()
40 { 27 {
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 } 81 }
95 82
96 if (m_verticalScrollbarLayer) { 83 if (m_verticalScrollbarLayer) {
97 m_verticalScrollbarLayer->setCurrentPos(m_currentOffset.y()); 84 m_verticalScrollbarLayer->setCurrentPos(m_currentOffset.y());
98 m_verticalScrollbarLayer->setTotalSize(m_totalSize.height()); 85 m_verticalScrollbarLayer->setTotalSize(m_totalSize.height());
99 m_verticalScrollbarLayer->setMaximum(m_maximum.y()); 86 m_verticalScrollbarLayer->setMaximum(m_maximum.y());
100 } 87 }
101 } 88 }
102 89
103 } // namespace cc 90 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resource_update_controller.cc ('k') | cc/scrollbar_layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698