OLD | NEW |
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 "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "cc/layer_tree_host_impl.h" | 7 #include "cc/layer_tree_host_impl.h" |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 return make_scoped_ptr(new LayerTreeHostImplTimeSourceAdapter(layerTreeH
ostImpl, timeSource)); | 162 return make_scoped_ptr(new LayerTreeHostImplTimeSourceAdapter(layerTreeH
ostImpl, timeSource)); |
163 } | 163 } |
164 virtual ~LayerTreeHostImplTimeSourceAdapter() | 164 virtual ~LayerTreeHostImplTimeSourceAdapter() |
165 { | 165 { |
166 m_timeSource->setClient(0); | 166 m_timeSource->setClient(0); |
167 m_timeSource->setActive(false); | 167 m_timeSource->setActive(false); |
168 } | 168 } |
169 | 169 |
170 virtual void onTimerTick() OVERRIDE | 170 virtual void onTimerTick() OVERRIDE |
171 { | 171 { |
172 // FIXME: We require that animate be called on the impl thread. This | |
173 // avoids asserts in single threaded mode. Ideally background ticking | |
174 // would be handled by the proxy/scheduler and this could be removed. | |
175 DebugScopedSetImplThread impl; | |
176 | |
177 m_layerTreeHostImpl->animate(base::TimeTicks::Now(), base::Time::Now()); | 172 m_layerTreeHostImpl->animate(base::TimeTicks::Now(), base::Time::Now()); |
178 } | 173 } |
179 | 174 |
180 void setActive(bool active) | 175 void setActive(bool active) |
181 { | 176 { |
182 if (active != m_timeSource->active()) | 177 if (active != m_timeSource->active()) |
183 m_timeSource->setActive(active); | 178 m_timeSource->setActive(active); |
184 } | 179 } |
185 | 180 |
186 private: | 181 private: |
(...skipping 1302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1489 ScrollbarAnimationController* scrollbarController = layer->scrollbarAnimatio
nController(); | 1484 ScrollbarAnimationController* scrollbarController = layer->scrollbarAnimatio
nController(); |
1490 double monotonicTime = (time - base::TimeTicks()).InSecondsF(); | 1485 double monotonicTime = (time - base::TimeTicks()).InSecondsF(); |
1491 if (scrollbarController && scrollbarController->animate(monotonicTime)) | 1486 if (scrollbarController && scrollbarController->animate(monotonicTime)) |
1492 m_client->setNeedsRedrawOnImplThread(); | 1487 m_client->setNeedsRedrawOnImplThread(); |
1493 | 1488 |
1494 for (size_t i = 0; i < layer->children().size(); ++i) | 1489 for (size_t i = 0; i < layer->children().size(); ++i) |
1495 animateScrollbarsRecursive(layer->children()[i], time); | 1490 animateScrollbarsRecursive(layer->children()[i], time); |
1496 } | 1491 } |
1497 | 1492 |
1498 } // namespace cc | 1493 } // namespace cc |
OLD | NEW |