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

Side by Side Diff: cc/scrollbar_animation_controller.cc

Issue 11367080: cc: Remove all remaining use of WebCore Rect/Point/Size types from the compositor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 1 month 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/scrollbar_animation_controller.h ('k') | cc/scrollbar_animation_controller_linear_fade.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 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 "config.h" 5 #include "config.h"
6 6
7 #include "cc/scrollbar_animation_controller.h" 7 #include "cc/scrollbar_animation_controller.h"
8 8
9 #include "cc/scrollbar_layer_impl.h" 9 #include "cc/scrollbar_layer_impl.h"
10 #include "base/time.h" 10 #include "base/time.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 if (!scrollLayer->children().size()) 70 if (!scrollLayer->children().size())
71 return gfx::Size(); 71 return gfx::Size();
72 // Copy & paste from LayerTreeHostImpl... 72 // Copy & paste from LayerTreeHostImpl...
73 // FIXME: Hardcoding the first child here is weird. Think of 73 // FIXME: Hardcoding the first child here is weird. Think of
74 // a cleaner way to get the contentBounds on the Impl side. 74 // a cleaner way to get the contentBounds on the Impl side.
75 return scrollLayer->children()[0]->bounds(); 75 return scrollLayer->children()[0]->bounds();
76 } 76 }
77 77
78 void ScrollbarAnimationController::updateScrollOffsetAtTime(LayerImpl* scrollLay er, double) 78 void ScrollbarAnimationController::updateScrollOffsetAtTime(LayerImpl* scrollLay er, double)
79 { 79 {
80 m_currentPos = scrollLayer->scrollPosition() + scrollLayer->scrollDelta(); 80 m_currentOffset = scrollLayer->scrollOffset() + scrollLayer->scrollDelta();
81 m_totalSize = getScrollLayerBounds(scrollLayer); 81 m_totalSize = getScrollLayerBounds(scrollLayer);
82 m_maximum = scrollLayer->maxScrollPosition(); 82 m_maximum = scrollLayer->maxScrollOffset();
83 83
84 if (m_horizontalScrollbarLayer) { 84 if (m_horizontalScrollbarLayer) {
85 m_horizontalScrollbarLayer->setCurrentPos(m_currentPos.x()); 85 m_horizontalScrollbarLayer->setCurrentPos(m_currentOffset.x());
86 m_horizontalScrollbarLayer->setTotalSize(m_totalSize.width()); 86 m_horizontalScrollbarLayer->setTotalSize(m_totalSize.width());
87 m_horizontalScrollbarLayer->setMaximum(m_maximum.width()); 87 m_horizontalScrollbarLayer->setMaximum(m_maximum.x());
88 } 88 }
89 89
90 if (m_verticalScrollbarLayer) { 90 if (m_verticalScrollbarLayer) {
91 m_verticalScrollbarLayer->setCurrentPos(m_currentPos.y()); 91 m_verticalScrollbarLayer->setCurrentPos(m_currentOffset.y());
92 m_verticalScrollbarLayer->setTotalSize(m_totalSize.height()); 92 m_verticalScrollbarLayer->setTotalSize(m_totalSize.height());
93 m_verticalScrollbarLayer->setMaximum(m_maximum.height()); 93 m_verticalScrollbarLayer->setMaximum(m_maximum.y());
94 } 94 }
95 } 95 }
96 96
97 } // namespace cc 97 } // namespace cc
OLDNEW
« no previous file with comments | « cc/scrollbar_animation_controller.h ('k') | cc/scrollbar_animation_controller_linear_fade.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698