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 #ifndef CCSingleThreadProxy_h | 5 #ifndef CCSingleThreadProxy_h |
6 #define CCSingleThreadProxy_h | 6 #define CCSingleThreadProxy_h |
7 | 7 |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "base/time.h" | 10 #include "base/time.h" |
11 #include "cc/animation_events.h" | 11 #include "cc/animation_events.h" |
12 #include "cc/layer_tree_host_impl.h" | 12 #include "cc/layer_tree_host_impl.h" |
13 #include "cc/proxy.h" | 13 #include "cc/proxy.h" |
14 | 14 |
15 namespace cc { | 15 namespace cc { |
16 | 16 |
17 class LayerTreeHost; | 17 class LayerTreeHost; |
| 18 class RenderingStatsSubscriber; |
18 | 19 |
19 class SingleThreadProxy : public Proxy, LayerTreeHostImplClient { | 20 class SingleThreadProxy : public Proxy, LayerTreeHostImplClient { |
20 public: | 21 public: |
21 static scoped_ptr<Proxy> create(LayerTreeHost*); | 22 static scoped_ptr<Proxy> create(LayerTreeHost*); |
22 virtual ~SingleThreadProxy(); | 23 virtual ~SingleThreadProxy(); |
23 | 24 |
24 // Proxy implementation | 25 // Proxy implementation |
25 virtual bool compositeAndReadback(void *pixels, const IntRect&) OVERRIDE; | 26 virtual bool compositeAndReadback(void *pixels, const IntRect&) OVERRIDE; |
26 virtual void startPageScaleAnimation(const IntSize& targetPosition, bool use
Anchor, float scale, base::TimeDelta duration) OVERRIDE; | 27 virtual void startPageScaleAnimation(const IntSize& targetPosition, bool use
Anchor, float scale, base::TimeDelta duration) OVERRIDE; |
27 virtual void finishAllRendering() OVERRIDE; | 28 virtual void finishAllRendering() OVERRIDE; |
28 virtual bool isStarted() const OVERRIDE; | 29 virtual bool isStarted() const OVERRIDE; |
29 virtual bool initializeContext() OVERRIDE; | 30 virtual bool initializeContext() OVERRIDE; |
30 virtual void setSurfaceReady() OVERRIDE; | 31 virtual void setSurfaceReady() OVERRIDE; |
31 virtual void setVisible(bool) OVERRIDE; | 32 virtual void setVisible(bool) OVERRIDE; |
32 virtual bool initializeRenderer() OVERRIDE; | 33 virtual bool initializeRenderer() OVERRIDE; |
33 virtual bool recreateContext() OVERRIDE; | 34 virtual bool recreateContext() OVERRIDE; |
34 virtual void renderingStats(RenderingStats*) OVERRIDE; | 35 virtual void renderingStats(RenderingStats*) OVERRIDE; |
| 36 virtual void startRecordingRenderingStats() OVERRIDE; |
| 37 virtual void stopRecordingRenderingStats(RenderingStats*) OVERRIDE; |
35 virtual const RendererCapabilities& rendererCapabilities() const OVERRIDE; | 38 virtual const RendererCapabilities& rendererCapabilities() const OVERRIDE; |
36 virtual void loseContext() OVERRIDE; | 39 virtual void loseContext() OVERRIDE; |
37 virtual void setNeedsAnimate() OVERRIDE; | 40 virtual void setNeedsAnimate() OVERRIDE; |
38 virtual void setNeedsCommit() OVERRIDE; | 41 virtual void setNeedsCommit() OVERRIDE; |
39 virtual void setNeedsRedraw() OVERRIDE; | 42 virtual void setNeedsRedraw() OVERRIDE; |
40 virtual void setDeferCommits(bool) OVERRIDE; | 43 virtual void setDeferCommits(bool) OVERRIDE; |
41 virtual bool commitRequested() const OVERRIDE; | 44 virtual bool commitRequested() const OVERRIDE; |
42 virtual void didAddAnimation() OVERRIDE; | 45 virtual void didAddAnimation() OVERRIDE; |
43 virtual void start() OVERRIDE; | 46 virtual void start() OVERRIDE; |
44 virtual void stop() OVERRIDE; | 47 virtual void stop() OVERRIDE; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 | 81 |
79 // Used on the Thread, but checked on main thread during initialization/shut
down. | 82 // Used on the Thread, but checked on main thread during initialization/shut
down. |
80 scoped_ptr<LayerTreeHostImpl> m_layerTreeHostImpl; | 83 scoped_ptr<LayerTreeHostImpl> m_layerTreeHostImpl; |
81 bool m_rendererInitialized; | 84 bool m_rendererInitialized; |
82 RendererCapabilities m_RendererCapabilitiesForMainThread; | 85 RendererCapabilities m_RendererCapabilitiesForMainThread; |
83 | 86 |
84 bool m_nextFrameIsNewlyCommittedFrame; | 87 bool m_nextFrameIsNewlyCommittedFrame; |
85 | 88 |
86 base::TimeDelta m_totalCommitTime; | 89 base::TimeDelta m_totalCommitTime; |
87 size_t m_totalCommitCount; | 90 size_t m_totalCommitCount; |
| 91 scoped_ptr<RenderingStatsSubscriber> m_renderingStatsSubscriber; |
88 }; | 92 }; |
89 | 93 |
90 // For use in the single-threaded case. In debug builds, it pretends that the | 94 // For use in the single-threaded case. In debug builds, it pretends that the |
91 // code is running on the impl thread to satisfy assertion checks. | 95 // code is running on the impl thread to satisfy assertion checks. |
92 class DebugScopedSetImplThread { | 96 class DebugScopedSetImplThread { |
93 public: | 97 public: |
94 DebugScopedSetImplThread() | 98 DebugScopedSetImplThread() |
95 { | 99 { |
96 #ifndef NDEBUG | 100 #ifndef NDEBUG |
97 Proxy::setCurrentThreadIsImplThread(true); | 101 Proxy::setCurrentThreadIsImplThread(true); |
(...skipping 30 matching lines...) Expand all Loading... |
128 // satisfy assertion checks | 132 // satisfy assertion checks |
129 class DebugScopedSetImplThreadAndMainThreadBlocked { | 133 class DebugScopedSetImplThreadAndMainThreadBlocked { |
130 private: | 134 private: |
131 DebugScopedSetImplThread m_implThread; | 135 DebugScopedSetImplThread m_implThread; |
132 DebugScopedSetMainThreadBlocked m_mainThreadBlocked; | 136 DebugScopedSetMainThreadBlocked m_mainThreadBlocked; |
133 }; | 137 }; |
134 | 138 |
135 } // namespace cc | 139 } // namespace cc |
136 | 140 |
137 #endif | 141 #endif |
OLD | NEW |