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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/CompositorMutableState.cpp

Issue 2339583002: cc: Move OnScrollOffsetAnimated to scroll tree (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « cc/trees/property_tree.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "platform/graphics/CompositorMutableState.h" 5 #include "platform/graphics/CompositorMutableState.h"
6 6
7 #include "cc/layers/layer_impl.h" 7 #include "cc/layers/layer_impl.h"
8 #include "cc/trees/layer_tree_impl.h" 8 #include "cc/trees/layer_tree_impl.h"
9 #include "platform/graphics/CompositorMutation.h" 9 #include "platform/graphics/CompositorMutation.h"
10 10
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 return m_scrollLayer ? m_scrollLayer->CurrentScrollOffset().x() : 0.0; 49 return m_scrollLayer ? m_scrollLayer->CurrentScrollOffset().x() : 0.0;
50 } 50 }
51 51
52 void CompositorMutableState::setScrollLeft(double scrollLeft) 52 void CompositorMutableState::setScrollLeft(double scrollLeft)
53 { 53 {
54 if (!m_scrollLayer) 54 if (!m_scrollLayer)
55 return; 55 return;
56 56
57 gfx::ScrollOffset offset = m_scrollLayer->CurrentScrollOffset(); 57 gfx::ScrollOffset offset = m_scrollLayer->CurrentScrollOffset();
58 offset.set_x(scrollLeft); 58 offset.set_x(scrollLeft);
59 m_scrollLayer->OnScrollOffsetAnimated(offset); 59 m_scrollLayer->layer_tree_impl()->property_trees()->scroll_tree.OnScrollOffs etAnimated(m_scrollLayer->id(), m_scrollLayer->transform_tree_index(), m_scrollL ayer->scroll_tree_index(), offset, m_scrollLayer->layer_tree_impl());
60 m_mutation->setScrollLeft(scrollLeft); 60 m_mutation->setScrollLeft(scrollLeft);
61 } 61 }
62 62
63 double CompositorMutableState::scrollTop() const 63 double CompositorMutableState::scrollTop() const
64 { 64 {
65 return m_scrollLayer ? m_scrollLayer->CurrentScrollOffset().y() : 0.0; 65 return m_scrollLayer ? m_scrollLayer->CurrentScrollOffset().y() : 0.0;
66 } 66 }
67 67
68 void CompositorMutableState::setScrollTop(double scrollTop) 68 void CompositorMutableState::setScrollTop(double scrollTop)
69 { 69 {
70 if (!m_scrollLayer) 70 if (!m_scrollLayer)
71 return; 71 return;
72 gfx::ScrollOffset offset = m_scrollLayer->CurrentScrollOffset(); 72 gfx::ScrollOffset offset = m_scrollLayer->CurrentScrollOffset();
73 offset.set_y(scrollTop); 73 offset.set_y(scrollTop);
74 m_scrollLayer->OnScrollOffsetAnimated(offset); 74 m_scrollLayer->layer_tree_impl()->property_trees()->scroll_tree.OnScrollOffs etAnimated(m_scrollLayer->id(), m_scrollLayer->transform_tree_index(), m_scrollL ayer->scroll_tree_index(), offset, m_scrollLayer->layer_tree_impl());
75 m_mutation->setScrollTop(scrollTop); 75 m_mutation->setScrollTop(scrollTop);
76 } 76 }
77 77
78 } // namespace blink 78 } // namespace blink
OLDNEW
« no previous file with comments | « cc/trees/property_tree.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698