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