| 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 CCThreadProxy_h | 5 #ifndef CCThreadProxy_h |
| 6 #define CCThreadProxy_h | 6 #define CCThreadProxy_h |
| 7 | 7 |
| 8 #include "base/time.h" | 8 #include "base/time.h" |
| 9 #include "cc/animation_events.h" | 9 #include "cc/animation_events.h" |
| 10 #include "cc/completion_event.h" | 10 #include "cc/completion_event.h" |
| 11 #include "cc/layer_tree_host_impl.h" | 11 #include "cc/layer_tree_host_impl.h" |
| 12 #include "cc/proxy.h" | 12 #include "cc/proxy.h" |
| 13 #include "cc/resource_update_controller.h" | 13 #include "cc/resource_update_controller.h" |
| 14 #include "cc/scheduler.h" | 14 #include "cc/scheduler.h" |
| 15 | 15 |
| 16 namespace cc { | 16 namespace cc { |
| 17 | 17 |
| 18 class InputHandler; | 18 class InputHandler; |
| 19 class LayerTreeHost; | 19 class LayerTreeHost; |
| 20 class RenderingStatsSubscriber; |
| 20 class ResourceUpdateQueue; | 21 class ResourceUpdateQueue; |
| 21 class Scheduler; | 22 class Scheduler; |
| 22 class ScopedThreadProxy; | 23 class ScopedThreadProxy; |
| 23 class Thread; | 24 class Thread; |
| 24 | 25 |
| 25 class ThreadProxy : public Proxy, LayerTreeHostImplClient, SchedulerClient, Reso
urceUpdateControllerClient { | 26 class ThreadProxy : public Proxy, LayerTreeHostImplClient, SchedulerClient, Reso
urceUpdateControllerClient { |
| 26 public: | 27 public: |
| 27 static scoped_ptr<Proxy> create(LayerTreeHost*); | 28 static scoped_ptr<Proxy> create(LayerTreeHost*); |
| 28 | 29 |
| 29 virtual ~ThreadProxy(); | 30 virtual ~ThreadProxy(); |
| 30 | 31 |
| 31 // Proxy implementation | 32 // Proxy implementation |
| 32 virtual bool compositeAndReadback(void *pixels, const IntRect&) OVERRIDE; | 33 virtual bool compositeAndReadback(void *pixels, const IntRect&) OVERRIDE; |
| 33 virtual void startPageScaleAnimation(const IntSize& targetPosition, bool use
Anchor, float scale, base::TimeDelta duration) OVERRIDE; | 34 virtual void startPageScaleAnimation(const IntSize& targetPosition, bool use
Anchor, float scale, base::TimeDelta duration) OVERRIDE; |
| 34 virtual void finishAllRendering() OVERRIDE; | 35 virtual void finishAllRendering() OVERRIDE; |
| 35 virtual bool isStarted() const OVERRIDE; | 36 virtual bool isStarted() const OVERRIDE; |
| 36 virtual bool initializeContext() OVERRIDE; | 37 virtual bool initializeContext() OVERRIDE; |
| 37 virtual void setSurfaceReady() OVERRIDE; | 38 virtual void setSurfaceReady() OVERRIDE; |
| 38 virtual void setVisible(bool) OVERRIDE; | 39 virtual void setVisible(bool) OVERRIDE; |
| 39 virtual bool initializeRenderer() OVERRIDE; | 40 virtual bool initializeRenderer() OVERRIDE; |
| 40 virtual bool recreateContext() OVERRIDE; | 41 virtual bool recreateContext() OVERRIDE; |
| 41 virtual void renderingStats(RenderingStats*) OVERRIDE; | 42 virtual void renderingStats(RenderingStats*) OVERRIDE; |
| 43 virtual void startRecordingRenderingStats() OVERRIDE; |
| 44 virtual void stopRecordingRenderingStats(RenderingStats*) OVERRIDE; |
| 42 virtual const RendererCapabilities& rendererCapabilities() const OVERRIDE; | 45 virtual const RendererCapabilities& rendererCapabilities() const OVERRIDE; |
| 43 virtual void loseContext() OVERRIDE; | 46 virtual void loseContext() OVERRIDE; |
| 44 virtual void setNeedsAnimate() OVERRIDE; | 47 virtual void setNeedsAnimate() OVERRIDE; |
| 45 virtual void setNeedsCommit() OVERRIDE; | 48 virtual void setNeedsCommit() OVERRIDE; |
| 46 virtual void setNeedsRedraw() OVERRIDE; | 49 virtual void setNeedsRedraw() OVERRIDE; |
| 47 virtual void setDeferCommits(bool) OVERRIDE; | 50 virtual void setDeferCommits(bool) OVERRIDE; |
| 48 virtual bool commitRequested() const OVERRIDE; | 51 virtual bool commitRequested() const OVERRIDE; |
| 49 virtual void didAddAnimation() OVERRIDE { } | 52 virtual void didAddAnimation() OVERRIDE { } |
| 50 virtual void start() OVERRIDE; | 53 virtual void start() OVERRIDE; |
| 51 virtual void stop() OVERRIDE; | 54 virtual void stop() OVERRIDE; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 void requestReadbackOnImplThread(ReadbackRequest*); | 116 void requestReadbackOnImplThread(ReadbackRequest*); |
| 114 void requestStartPageScaleAnimationOnImplThread(IntSize targetPosition, bool
useAnchor, float scale, base::TimeDelta duration); | 117 void requestStartPageScaleAnimationOnImplThread(IntSize targetPosition, bool
useAnchor, float scale, base::TimeDelta duration); |
| 115 void finishAllRenderingOnImplThread(CompletionEvent*); | 118 void finishAllRenderingOnImplThread(CompletionEvent*); |
| 116 void initializeImplOnImplThread(CompletionEvent*, InputHandler*); | 119 void initializeImplOnImplThread(CompletionEvent*, InputHandler*); |
| 117 void setSurfaceReadyOnImplThread(); | 120 void setSurfaceReadyOnImplThread(); |
| 118 void setVisibleOnImplThread(CompletionEvent*, bool); | 121 void setVisibleOnImplThread(CompletionEvent*, bool); |
| 119 void initializeContextOnImplThread(GraphicsContext*); | 122 void initializeContextOnImplThread(GraphicsContext*); |
| 120 void initializeRendererOnImplThread(CompletionEvent*, bool* initializeSuccee
ded, RendererCapabilities*); | 123 void initializeRendererOnImplThread(CompletionEvent*, bool* initializeSuccee
ded, RendererCapabilities*); |
| 121 void layerTreeHostClosedOnImplThread(CompletionEvent*); | 124 void layerTreeHostClosedOnImplThread(CompletionEvent*); |
| 122 void setFullRootLayerDamageOnImplThread(); | 125 void setFullRootLayerDamageOnImplThread(); |
| 126 void startRecordingRenderingStatsOnImplThread(CompletionEvent*); |
| 127 void stopRecordingRenderingStatsOnImplThread(CompletionEvent*, RenderingStat
s*); |
| 123 void acquireLayerTexturesForMainThreadOnImplThread(CompletionEvent*); | 128 void acquireLayerTexturesForMainThreadOnImplThread(CompletionEvent*); |
| 124 void recreateContextOnImplThread(CompletionEvent*, GraphicsContext*, bool* r
ecreateSucceeded, RendererCapabilities*); | 129 void recreateContextOnImplThread(CompletionEvent*, GraphicsContext*, bool* r
ecreateSucceeded, RendererCapabilities*); |
| 125 void renderingStatsOnImplThread(CompletionEvent*, RenderingStats*); | 130 void renderingStatsOnImplThread(CompletionEvent*, RenderingStats*); |
| 126 ScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapInternal(bool for
cedDraw); | 131 ScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapInternal(bool for
cedDraw); |
| 127 void forceSerializeOnSwapBuffersOnImplThread(CompletionEvent*); | 132 void forceSerializeOnSwapBuffersOnImplThread(CompletionEvent*); |
| 128 void setNeedsForcedCommitOnImplThread(); | 133 void setNeedsForcedCommitOnImplThread(); |
| 129 | 134 |
| 130 // Accessed on main thread only. | 135 // Accessed on main thread only. |
| 131 bool m_animateRequested; // Set only when setNeedsAnimate is called. | 136 bool m_animateRequested; // Set only when setNeedsAnimate is called. |
| 132 bool m_commitRequested; // Set only when setNeedsCommit is called. | 137 bool m_commitRequested; // Set only when setNeedsCommit is called. |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 // Set when the main thread is waiting on layers to be drawn. | 169 // Set when the main thread is waiting on layers to be drawn. |
| 165 CompletionEvent* m_textureAcquisitionCompletionEventOnImplThread; | 170 CompletionEvent* m_textureAcquisitionCompletionEventOnImplThread; |
| 166 | 171 |
| 167 scoped_ptr<ResourceUpdateController> m_currentResourceUpdateControllerOnImpl
Thread; | 172 scoped_ptr<ResourceUpdateController> m_currentResourceUpdateControllerOnImpl
Thread; |
| 168 | 173 |
| 169 // Set when the next draw should post didCommitAndDrawFrame to the main thre
ad. | 174 // Set when the next draw should post didCommitAndDrawFrame to the main thre
ad. |
| 170 bool m_nextFrameIsNewlyCommittedFrameOnImplThread; | 175 bool m_nextFrameIsNewlyCommittedFrameOnImplThread; |
| 171 | 176 |
| 172 bool m_renderVSyncEnabled; | 177 bool m_renderVSyncEnabled; |
| 173 | 178 |
| 179 // TODO(vollick): These should go away once we switch to the subscriber mode
l. |
| 174 base::TimeDelta m_totalCommitTime; | 180 base::TimeDelta m_totalCommitTime; |
| 175 size_t m_totalCommitCount; | 181 size_t m_totalCommitCount; |
| 182 scoped_ptr<RenderingStatsSubscriber> m_renderingStatsSubscriber; |
| 176 | 183 |
| 177 bool m_deferCommits; | 184 bool m_deferCommits; |
| 178 bool m_deferredCommitPending; | 185 bool m_deferredCommitPending; |
| 179 }; | 186 }; |
| 180 | 187 |
| 181 } // namespace cc | 188 } // namespace cc |
| 182 | 189 |
| 183 #endif | 190 #endif |
| OLD | NEW |