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 "cc/layer_tree_host_impl.h" | 5 #include "cc/layer_tree_host_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 return make_scoped_ptr(new LayerTreeHostImplTimeSourceAdapter(layerTreeH
ostImpl, timeSource)); | 64 return make_scoped_ptr(new LayerTreeHostImplTimeSourceAdapter(layerTreeH
ostImpl, timeSource)); |
65 } | 65 } |
66 virtual ~LayerTreeHostImplTimeSourceAdapter() | 66 virtual ~LayerTreeHostImplTimeSourceAdapter() |
67 { | 67 { |
68 m_timeSource->setClient(0); | 68 m_timeSource->setClient(0); |
69 m_timeSource->setActive(false); | 69 m_timeSource->setActive(false); |
70 } | 70 } |
71 | 71 |
72 virtual void onTimerTick() OVERRIDE | 72 virtual void onTimerTick() OVERRIDE |
73 { | 73 { |
74 DebugScopedSetImplThread setImplThread(m_layerTreeHostImpl->proxy()); | |
75 m_layerTreeHostImpl->animate(base::TimeTicks::Now(), base::Time::Now()); | 74 m_layerTreeHostImpl->animate(base::TimeTicks::Now(), base::Time::Now()); |
76 } | 75 } |
77 | 76 |
78 void setActive(bool active) | 77 void setActive(bool active) |
79 { | 78 { |
80 if (active != m_timeSource->active()) | 79 if (active != m_timeSource->active()) |
81 m_timeSource->setActive(active); | 80 m_timeSource->setActive(active); |
82 } | 81 } |
83 | 82 |
84 private: | 83 private: |
(...skipping 1547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1632 } | 1631 } |
1633 | 1632 |
1634 skia::RefPtr<SkPicture> LayerTreeHostImpl::capturePicture() | 1633 skia::RefPtr<SkPicture> LayerTreeHostImpl::capturePicture() |
1635 { | 1634 { |
1636 LayerTreeImpl* tree = pendingTree() ? pendingTree() : activeTree(); | 1635 LayerTreeImpl* tree = pendingTree() ? pendingTree() : activeTree(); |
1637 LayerImpl* layer = getNonCompositedContentLayerRecursive(tree->RootLayer()); | 1636 LayerImpl* layer = getNonCompositedContentLayerRecursive(tree->RootLayer()); |
1638 return layer ? layer->getPicture() : skia::RefPtr<SkPicture>(); | 1637 return layer ? layer->getPicture() : skia::RefPtr<SkPicture>(); |
1639 } | 1638 } |
1640 | 1639 |
1641 } // namespace cc | 1640 } // namespace cc |
OLD | NEW |