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 CC_THREAD_PROXY_H_ | 5 #ifndef CC_THREAD_PROXY_H_ |
6 #define CC_THREAD_PROXY_H_ | 6 #define CC_THREAD_PROXY_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
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/completion_event.h" | 12 #include "cc/completion_event.h" |
13 #include "cc/layer_tree_host_impl.h" | 13 #include "cc/layer_tree_host_impl.h" |
14 #include "cc/proxy.h" | 14 #include "cc/proxy.h" |
15 #include "cc/resource_update_controller.h" | 15 #include "cc/resource_update_controller.h" |
16 #include "cc/scheduler.h" | 16 #include "cc/scheduler.h" |
17 | 17 |
18 namespace cc { | 18 namespace cc { |
19 | 19 |
20 class InputHandler; | 20 class InputHandler; |
21 class LayerTreeHost; | 21 class LayerTreeHost; |
| 22 class PictureLayer; |
| 23 class PicturePileImpl; |
22 class ResourceUpdateQueue; | 24 class ResourceUpdateQueue; |
23 class Scheduler; | 25 class Scheduler; |
24 class ScopedThreadProxy; | 26 class ScopedThreadProxy; |
25 class Thread; | 27 class Thread; |
26 | 28 |
27 class ThreadProxy : public Proxy, LayerTreeHostImplClient, SchedulerClient, Reso
urceUpdateControllerClient { | 29 class ThreadProxy : public Proxy, LayerTreeHostImplClient, SchedulerClient, Reso
urceUpdateControllerClient { |
28 public: | 30 public: |
29 static scoped_ptr<Proxy> create(LayerTreeHost*, scoped_ptr<Thread> implThrea
d); | 31 static scoped_ptr<Proxy> create(LayerTreeHost*, scoped_ptr<Thread> implThrea
d); |
30 | 32 |
31 virtual ~ThreadProxy(); | 33 virtual ~ThreadProxy(); |
(...skipping 16 matching lines...) Expand all Loading... |
48 virtual void setNeedsRedraw() OVERRIDE; | 50 virtual void setNeedsRedraw() OVERRIDE; |
49 virtual void setDeferCommits(bool) OVERRIDE; | 51 virtual void setDeferCommits(bool) OVERRIDE; |
50 virtual bool commitRequested() const OVERRIDE; | 52 virtual bool commitRequested() const OVERRIDE; |
51 virtual void mainThreadHasStoppedFlinging() OVERRIDE; | 53 virtual void mainThreadHasStoppedFlinging() OVERRIDE; |
52 virtual void start() OVERRIDE; | 54 virtual void start() OVERRIDE; |
53 virtual void stop() OVERRIDE; | 55 virtual void stop() OVERRIDE; |
54 virtual size_t maxPartialTextureUpdates() const OVERRIDE; | 56 virtual size_t maxPartialTextureUpdates() const OVERRIDE; |
55 virtual void acquireLayerTextures() OVERRIDE; | 57 virtual void acquireLayerTextures() OVERRIDE; |
56 virtual void forceSerializeOnSwapBuffers() OVERRIDE; | 58 virtual void forceSerializeOnSwapBuffers() OVERRIDE; |
57 virtual bool commitPendingForTesting() OVERRIDE; | 59 virtual bool commitPendingForTesting() OVERRIDE; |
| 60 virtual scoped_refptr<PicturePileImpl> capturePicturePile(const PictureLayer
* layer) OVERRIDE; |
58 | 61 |
59 // LayerTreeHostImplClient implementation | 62 // LayerTreeHostImplClient implementation |
60 virtual void didLoseOutputSurfaceOnImplThread() OVERRIDE; | 63 virtual void didLoseOutputSurfaceOnImplThread() OVERRIDE; |
61 virtual void onSwapBuffersCompleteOnImplThread() OVERRIDE; | 64 virtual void onSwapBuffersCompleteOnImplThread() OVERRIDE; |
62 virtual void onVSyncParametersChanged(base::TimeTicks timebase, base::TimeDe
lta interval) OVERRIDE; | 65 virtual void onVSyncParametersChanged(base::TimeTicks timebase, base::TimeDe
lta interval) OVERRIDE; |
63 virtual void onCanDrawStateChanged(bool canDraw) OVERRIDE; | 66 virtual void onCanDrawStateChanged(bool canDraw) OVERRIDE; |
64 virtual void onHasPendingTreeStateChanged(bool hasPendingTree) OVERRIDE; | 67 virtual void onHasPendingTreeStateChanged(bool hasPendingTree) OVERRIDE; |
65 virtual void setNeedsRedrawOnImplThread() OVERRIDE; | 68 virtual void setNeedsRedrawOnImplThread() OVERRIDE; |
66 virtual void setNeedsCommitOnImplThread() OVERRIDE; | 69 virtual void setNeedsCommitOnImplThread() OVERRIDE; |
67 virtual void setNeedsManageTilesOnImplThread() OVERRIDE; | 70 virtual void setNeedsManageTilesOnImplThread() OVERRIDE; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 void layerTreeHostClosedOnImplThread(CompletionEvent*); | 130 void layerTreeHostClosedOnImplThread(CompletionEvent*); |
128 void manageTilesOnImplThread(); | 131 void manageTilesOnImplThread(); |
129 void setFullRootLayerDamageOnImplThread(); | 132 void setFullRootLayerDamageOnImplThread(); |
130 void acquireLayerTexturesForMainThreadOnImplThread(CompletionEvent*); | 133 void acquireLayerTexturesForMainThreadOnImplThread(CompletionEvent*); |
131 void recreateOutputSurfaceOnImplThread(CompletionEvent*, scoped_ptr<OutputSu
rface>, bool* recreateSucceeded, RendererCapabilities*); | 134 void recreateOutputSurfaceOnImplThread(CompletionEvent*, scoped_ptr<OutputSu
rface>, bool* recreateSucceeded, RendererCapabilities*); |
132 void renderingStatsOnImplThread(CompletionEvent*, RenderingStats*); | 135 void renderingStatsOnImplThread(CompletionEvent*, RenderingStats*); |
133 ScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapInternal(bool for
cedDraw); | 136 ScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapInternal(bool for
cedDraw); |
134 void forceSerializeOnSwapBuffersOnImplThread(CompletionEvent*); | 137 void forceSerializeOnSwapBuffersOnImplThread(CompletionEvent*); |
135 void setNeedsForcedCommitOnImplThread(); | 138 void setNeedsForcedCommitOnImplThread(); |
136 void commitPendingOnImplThreadForTesting(CommitPendingRequest* request); | 139 void commitPendingOnImplThreadForTesting(CommitPendingRequest* request); |
| 140 void capturePicturePileOnImplThread(int id, CompletionEvent*, scoped_refptr<
PicturePileImpl>*); |
137 | 141 |
138 // Accessed on main thread only. | 142 // Accessed on main thread only. |
139 bool m_animateRequested; // Set only when setNeedsAnimate is called. | 143 bool m_animateRequested; // Set only when setNeedsAnimate is called. |
140 bool m_commitRequested; // Set only when setNeedsCommit is called. | 144 bool m_commitRequested; // Set only when setNeedsCommit is called. |
141 bool m_commitRequestSentToImplThread; // Set by setNeedsCommit and setNeedsA
nimate. | 145 bool m_commitRequestSentToImplThread; // Set by setNeedsCommit and setNeedsA
nimate. |
142 base::CancelableClosure m_outputSurfaceRecreationCallback; | 146 base::CancelableClosure m_outputSurfaceRecreationCallback; |
143 LayerTreeHost* m_layerTreeHost; | 147 LayerTreeHost* m_layerTreeHost; |
144 bool m_rendererInitialized; | 148 bool m_rendererInitialized; |
145 RendererCapabilities m_RendererCapabilitiesMainThreadCopy; | 149 RendererCapabilities m_RendererCapabilitiesMainThreadCopy; |
146 bool m_started; | 150 bool m_started; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 base::TimeDelta m_totalCommitTime; | 190 base::TimeDelta m_totalCommitTime; |
187 size_t m_totalCommitCount; | 191 size_t m_totalCommitCount; |
188 | 192 |
189 bool m_deferCommits; | 193 bool m_deferCommits; |
190 scoped_ptr<BeginFrameAndCommitState> m_pendingDeferredCommit; | 194 scoped_ptr<BeginFrameAndCommitState> m_pendingDeferredCommit; |
191 }; | 195 }; |
192 | 196 |
193 } // namespace cc | 197 } // namespace cc |
194 | 198 |
195 #endif // CC_THREAD_PROXY_H_ | 199 #endif // CC_THREAD_PROXY_H_ |
OLD | NEW |