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 WebKit { |
| 19 class WebGraphicsContext3D; |
| 20 } |
| 21 |
18 namespace cc { | 22 namespace cc { |
19 | 23 |
20 class InputHandler; | 24 class InputHandler; |
21 class LayerTreeHost; | 25 class LayerTreeHost; |
22 class ResourceUpdateQueue; | 26 class ResourceUpdateQueue; |
23 class Scheduler; | 27 class Scheduler; |
24 class ScopedThreadProxy; | 28 class ScopedThreadProxy; |
25 class Thread; | 29 class Thread; |
26 | 30 |
27 class ThreadProxy : public Proxy, LayerTreeHostImplClient, SchedulerClient, Reso
urceUpdateControllerClient { | 31 class ThreadProxy : public Proxy, LayerTreeHostImplClient, SchedulerClient, Reso
urceUpdateControllerClient { |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 CompletionEvent completion; | 118 CompletionEvent completion; |
115 bool success; | 119 bool success; |
116 void* pixels; | 120 void* pixels; |
117 gfx::Rect rect; | 121 gfx::Rect rect; |
118 }; | 122 }; |
119 struct CommitPendingRequest { | 123 struct CommitPendingRequest { |
120 CompletionEvent completion; | 124 CompletionEvent completion; |
121 bool commitPending; | 125 bool commitPending; |
122 }; | 126 }; |
123 void forceBeginFrameOnImplThread(CompletionEvent*); | 127 void forceBeginFrameOnImplThread(CompletionEvent*); |
124 void beginFrameCompleteOnImplThread(CompletionEvent*, ResourceUpdateQueue*); | 128 void beginFrameCompleteOnImplThread(CompletionEvent*, ResourceUpdateQueue*,
WebKit::WebGraphicsContext3D* offscreenContext3d, GrContext* offscreenGrContext)
; |
125 void beginFrameAbortedOnImplThread(); | 129 void beginFrameAbortedOnImplThread(); |
126 void requestReadbackOnImplThread(ReadbackRequest*); | 130 void requestReadbackOnImplThread(ReadbackRequest*); |
127 void requestStartPageScaleAnimationOnImplThread(gfx::Vector2d targetOffset,
bool useAnchor, float scale, base::TimeDelta duration); | 131 void requestStartPageScaleAnimationOnImplThread(gfx::Vector2d targetOffset,
bool useAnchor, float scale, base::TimeDelta duration); |
128 void finishAllRenderingOnImplThread(CompletionEvent*); | 132 void finishAllRenderingOnImplThread(CompletionEvent*); |
129 void initializeImplOnImplThread(CompletionEvent*, InputHandler*); | 133 void initializeImplOnImplThread(CompletionEvent*, InputHandler*); |
130 void setSurfaceReadyOnImplThread(); | 134 void setSurfaceReadyOnImplThread(); |
131 void setVisibleOnImplThread(CompletionEvent*, bool); | 135 void setVisibleOnImplThread(CompletionEvent*, bool); |
132 void initializeOutputSurfaceOnImplThread(scoped_ptr<OutputSurface>); | 136 void initializeOutputSurfaceOnImplThread(scoped_ptr<OutputSurface>); |
133 void initializeRendererOnImplThread(CompletionEvent*, bool* initializeSuccee
ded, RendererCapabilities*); | 137 void initializeRendererOnImplThread(CompletionEvent*, bool* initializeSuccee
ded, RendererCapabilities*); |
134 void layerTreeHostClosedOnImplThread(CompletionEvent*); | 138 void layerTreeHostClosedOnImplThread(CompletionEvent*); |
135 void manageTilesOnImplThread(); | 139 void manageTilesOnImplThread(); |
136 void setFullRootLayerDamageOnImplThread(); | 140 void setFullRootLayerDamageOnImplThread(); |
137 void acquireLayerTexturesForMainThreadOnImplThread(CompletionEvent*); | 141 void acquireLayerTexturesForMainThreadOnImplThread(CompletionEvent*); |
138 void recreateOutputSurfaceOnImplThread(CompletionEvent*, scoped_ptr<OutputSu
rface>, bool* recreateSucceeded, RendererCapabilities*); | 142 void recreateOutputSurfaceOnImplThread(CompletionEvent*, scoped_ptr<OutputSu
rface>, WebKit::WebGraphicsContext3D* offscreenContext3d, GrContext* offscreenGr
Context, bool* recreateSucceeded, RendererCapabilities*); |
139 void renderingStatsOnImplThread(CompletionEvent*, RenderingStats*); | 143 void renderingStatsOnImplThread(CompletionEvent*, RenderingStats*); |
140 ScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapInternal(bool for
cedDraw); | 144 ScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapInternal(bool for
cedDraw); |
141 void forceSerializeOnSwapBuffersOnImplThread(CompletionEvent*); | 145 void forceSerializeOnSwapBuffersOnImplThread(CompletionEvent*); |
142 void setNeedsForcedCommitOnImplThread(); | 146 void setNeedsForcedCommitOnImplThread(); |
143 void checkOutputSurfaceStatusOnImplThread(); | 147 void checkOutputSurfaceStatusOnImplThread(); |
144 void commitPendingOnImplThreadForTesting(CommitPendingRequest* request); | 148 void commitPendingOnImplThreadForTesting(CommitPendingRequest* request); |
145 void capturePictureOnImplThread(CompletionEvent*, skia::RefPtr<SkPicture>*); | 149 void capturePictureOnImplThread(CompletionEvent*, skia::RefPtr<SkPicture>*); |
146 void renewTreePriorityOnImplThread(); | 150 void renewTreePriorityOnImplThread(); |
147 void didSwapUseIncompleteTileOnImplThread(); | 151 void didSwapUseIncompleteTileOnImplThread(); |
148 | 152 |
149 // Accessed on main thread only. | 153 // Accessed on main thread only. |
150 bool m_animateRequested; // Set only when setNeedsAnimate is called. | 154 bool m_animateRequested; // Set only when setNeedsAnimate is called. |
151 bool m_commitRequested; // Set only when setNeedsCommit is called. | 155 bool m_commitRequested; // Set only when setNeedsCommit is called. |
152 bool m_commitRequestSentToImplThread; // Set by setNeedsCommit and setNeedsA
nimate. | 156 bool m_commitRequestSentToImplThread; // Set by setNeedsCommit and setNeedsA
nimate. |
153 base::CancelableClosure m_outputSurfaceRecreationCallback; | 157 base::CancelableClosure m_outputSurfaceRecreationCallback; |
154 LayerTreeHost* m_layerTreeHost; | 158 LayerTreeHost* m_layerTreeHost; |
155 bool m_rendererInitialized; | 159 bool m_rendererInitialized; |
156 RendererCapabilities m_RendererCapabilitiesMainThreadCopy; | 160 RendererCapabilities m_RendererCapabilitiesMainThreadCopy; |
157 bool m_started; | 161 bool m_started; |
158 bool m_texturesAcquired; | 162 bool m_texturesAcquired; |
159 bool m_inCompositeAndReadback; | 163 bool m_inCompositeAndReadback; |
160 bool m_manageTilesPending; | 164 bool m_manageTilesPending; |
| 165 |
161 // Weak pointer to use when posting tasks to the impl thread. | 166 // Weak pointer to use when posting tasks to the impl thread. |
162 base::WeakPtr<ThreadProxy> m_implThreadWeakPtr; | 167 base::WeakPtr<ThreadProxy> m_implThreadWeakPtr; |
163 | 168 |
164 base::WeakPtrFactory<ThreadProxy> m_weakFactoryOnImplThread; | 169 base::WeakPtrFactory<ThreadProxy> m_weakFactoryOnImplThread; |
165 | 170 |
166 base::WeakPtr<ThreadProxy> m_mainThreadWeakPtr; | 171 base::WeakPtr<ThreadProxy> m_mainThreadWeakPtr; |
167 base::WeakPtrFactory<ThreadProxy> m_weakFactory; | 172 base::WeakPtrFactory<ThreadProxy> m_weakFactory; |
168 | 173 |
169 scoped_ptr<LayerTreeHostImpl> m_layerTreeHostImpl; | 174 scoped_ptr<LayerTreeHostImpl> m_layerTreeHostImpl; |
170 | 175 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 bool m_deferCommits; | 211 bool m_deferCommits; |
207 scoped_ptr<BeginFrameAndCommitState> m_pendingDeferredCommit; | 212 scoped_ptr<BeginFrameAndCommitState> m_pendingDeferredCommit; |
208 | 213 |
209 base::TimeTicks m_smoothnessTakesPriorityExpirationTime; | 214 base::TimeTicks m_smoothnessTakesPriorityExpirationTime; |
210 bool m_renewTreePriorityOnImplThreadPending; | 215 bool m_renewTreePriorityOnImplThreadPending; |
211 }; | 216 }; |
212 | 217 |
213 } // namespace cc | 218 } // namespace cc |
214 | 219 |
215 #endif // CC_THREAD_PROXY_H_ | 220 #endif // CC_THREAD_PROXY_H_ |
OLD | NEW |