| 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 "CCAnimationEvents.h" | 8 #include "CCAnimationEvents.h" |
| 9 #include "CCCompletionEvent.h" | 9 #include "CCCompletionEvent.h" |
| 10 #include "CCLayerTreeHostImpl.h" | 10 #include "CCLayerTreeHostImpl.h" |
| 11 #include "CCProxy.h" | 11 #include "CCProxy.h" |
| 12 #include "CCScheduler.h" | 12 #include "CCScheduler.h" |
| 13 #include "CCTextureUpdateController.h" | 13 #include "CCTextureUpdateController.h" |
| 14 #include <base/time.h> |
| 14 #include <wtf/OwnPtr.h> | 15 #include <wtf/OwnPtr.h> |
| 15 | 16 |
| 16 namespace cc { | 17 namespace cc { |
| 17 | 18 |
| 18 class CCInputHandler; | 19 class CCInputHandler; |
| 19 class CCLayerTreeHost; | 20 class CCLayerTreeHost; |
| 20 class CCScheduler; | 21 class CCScheduler; |
| 21 class CCScopedThreadProxy; | 22 class CCScopedThreadProxy; |
| 22 class CCTextureUpdateQueue; | 23 class CCTextureUpdateQueue; |
| 23 class CCThread; | 24 class CCThread; |
| 24 class CCThreadProxyContextRecreationTimer; | 25 class CCThreadProxyContextRecreationTimer; |
| 25 | 26 |
| 26 class CCThreadProxy : public CCProxy, CCLayerTreeHostImplClient, CCSchedulerClie
nt, CCTextureUpdateControllerClient { | 27 class CCThreadProxy : public CCProxy, CCLayerTreeHostImplClient, CCSchedulerClie
nt, CCTextureUpdateControllerClient { |
| 27 public: | 28 public: |
| 28 static PassOwnPtr<CCProxy> create(CCLayerTreeHost*); | 29 static PassOwnPtr<CCProxy> create(CCLayerTreeHost*); |
| 29 | 30 |
| 30 virtual ~CCThreadProxy(); | 31 virtual ~CCThreadProxy(); |
| 31 | 32 |
| 32 // CCProxy implementation | 33 // CCProxy implementation |
| 33 virtual bool compositeAndReadback(void *pixels, const IntRect&) OVERRIDE; | 34 virtual bool compositeAndReadback(void *pixels, const IntRect&) OVERRIDE; |
| 34 virtual void startPageScaleAnimation(const IntSize& targetPosition, bool use
Anchor, float scale, double duration) OVERRIDE; | 35 virtual void startPageScaleAnimation(const IntSize& targetPosition, bool use
Anchor, float scale, double duration) OVERRIDE; |
| 35 virtual void finishAllRendering() OVERRIDE; | 36 virtual void finishAllRendering() OVERRIDE; |
| 36 virtual bool isStarted() const OVERRIDE; | 37 virtual bool isStarted() const OVERRIDE; |
| 37 virtual bool initializeContext() OVERRIDE; | 38 virtual bool initializeContext() OVERRIDE; |
| 38 virtual void setSurfaceReady() OVERRIDE; | 39 virtual void setSurfaceReady() OVERRIDE; |
| 39 virtual void setVisible(bool) OVERRIDE; | 40 virtual void setVisible(bool) OVERRIDE; |
| 40 virtual bool initializeRenderer() OVERRIDE; | 41 virtual bool initializeRenderer() OVERRIDE; |
| 41 virtual bool recreateContext() OVERRIDE; | 42 virtual bool recreateContext() OVERRIDE; |
| 42 virtual void implSideRenderingStats(CCRenderingStats&) OVERRIDE; | 43 virtual void renderingStats(CCRenderingStats*) OVERRIDE; |
| 43 virtual const RendererCapabilities& rendererCapabilities() const OVERRIDE; | 44 virtual const RendererCapabilities& rendererCapabilities() const OVERRIDE; |
| 44 virtual void loseContext() OVERRIDE; | 45 virtual void loseContext() OVERRIDE; |
| 45 virtual void setNeedsAnimate() OVERRIDE; | 46 virtual void setNeedsAnimate() OVERRIDE; |
| 46 virtual void setNeedsCommit() OVERRIDE; | 47 virtual void setNeedsCommit() OVERRIDE; |
| 47 virtual void setNeedsRedraw() OVERRIDE; | 48 virtual void setNeedsRedraw() OVERRIDE; |
| 48 virtual bool commitRequested() const OVERRIDE; | 49 virtual bool commitRequested() const OVERRIDE; |
| 49 virtual void didAddAnimation() OVERRIDE { } | 50 virtual void didAddAnimation() OVERRIDE { } |
| 50 virtual void start() OVERRIDE; | 51 virtual void start() OVERRIDE; |
| 51 virtual void stop() OVERRIDE; | 52 virtual void stop() OVERRIDE; |
| 52 virtual size_t maxPartialTextureUpdates() const OVERRIDE; | 53 virtual size_t maxPartialTextureUpdates() const OVERRIDE; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 void finishAllRenderingOnImplThread(CCCompletionEvent*); | 115 void finishAllRenderingOnImplThread(CCCompletionEvent*); |
| 115 void initializeImplOnImplThread(CCCompletionEvent*, PassOwnPtr<CCInputHandle
r>); | 116 void initializeImplOnImplThread(CCCompletionEvent*, PassOwnPtr<CCInputHandle
r>); |
| 116 void setSurfaceReadyOnImplThread(); | 117 void setSurfaceReadyOnImplThread(); |
| 117 void setVisibleOnImplThread(CCCompletionEvent*, bool); | 118 void setVisibleOnImplThread(CCCompletionEvent*, bool); |
| 118 void initializeContextOnImplThread(CCGraphicsContext*); | 119 void initializeContextOnImplThread(CCGraphicsContext*); |
| 119 void initializeRendererOnImplThread(CCCompletionEvent*, bool* initializeSucc
eeded, RendererCapabilities*); | 120 void initializeRendererOnImplThread(CCCompletionEvent*, bool* initializeSucc
eeded, RendererCapabilities*); |
| 120 void layerTreeHostClosedOnImplThread(CCCompletionEvent*); | 121 void layerTreeHostClosedOnImplThread(CCCompletionEvent*); |
| 121 void setFullRootLayerDamageOnImplThread(); | 122 void setFullRootLayerDamageOnImplThread(); |
| 122 void acquireLayerTexturesForMainThreadOnImplThread(CCCompletionEvent*); | 123 void acquireLayerTexturesForMainThreadOnImplThread(CCCompletionEvent*); |
| 123 void recreateContextOnImplThread(CCCompletionEvent*, CCGraphicsContext*, boo
l* recreateSucceeded, RendererCapabilities*); | 124 void recreateContextOnImplThread(CCCompletionEvent*, CCGraphicsContext*, boo
l* recreateSucceeded, RendererCapabilities*); |
| 124 void implSideRenderingStatsOnImplThread(CCCompletionEvent*, CCRenderingStats
*); | 125 void renderingStatsOnImplThread(CCCompletionEvent*, CCRenderingStats*); |
| 125 CCScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapInternal(bool f
orcedDraw); | 126 CCScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapInternal(bool f
orcedDraw); |
| 126 void forceSerializeOnSwapBuffersOnImplThread(CCCompletionEvent*); | 127 void forceSerializeOnSwapBuffersOnImplThread(CCCompletionEvent*); |
| 127 void setNeedsForcedCommitOnImplThread(); | 128 void setNeedsForcedCommitOnImplThread(); |
| 128 | 129 |
| 129 // Accessed on main thread only. | 130 // Accessed on main thread only. |
| 130 bool m_animateRequested; // Set only when setNeedsAnimate is called. | 131 bool m_animateRequested; // Set only when setNeedsAnimate is called. |
| 131 bool m_commitRequested; // Set only when setNeedsCommit is called. | 132 bool m_commitRequested; // Set only when setNeedsCommit is called. |
| 132 bool m_commitRequestSentToImplThread; // Set by setNeedsCommit and setNeedsA
nimate. | 133 bool m_commitRequestSentToImplThread; // Set by setNeedsCommit and setNeedsA
nimate. |
| 133 bool m_forcedCommitRequested; | 134 bool m_forcedCommitRequested; |
| 134 OwnPtr<CCThreadProxyContextRecreationTimer> m_contextRecreationTimer; | 135 OwnPtr<CCThreadProxyContextRecreationTimer> m_contextRecreationTimer; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 OwnPtr<CCTextureUpdateController> m_currentTextureUpdateControllerOnImplThre
ad; | 167 OwnPtr<CCTextureUpdateController> m_currentTextureUpdateControllerOnImplThre
ad; |
| 167 | 168 |
| 168 // Set when we need to reset the contentsTexturesPurged flag after the | 169 // Set when we need to reset the contentsTexturesPurged flag after the |
| 169 // commit. | 170 // commit. |
| 170 bool m_resetContentsTexturesPurgedAfterCommitOnImplThread; | 171 bool m_resetContentsTexturesPurgedAfterCommitOnImplThread; |
| 171 | 172 |
| 172 // Set when the next draw should post didCommitAndDrawFrame to the main thre
ad. | 173 // Set when the next draw should post didCommitAndDrawFrame to the main thre
ad. |
| 173 bool m_nextFrameIsNewlyCommittedFrameOnImplThread; | 174 bool m_nextFrameIsNewlyCommittedFrameOnImplThread; |
| 174 | 175 |
| 175 bool m_renderVSyncEnabled; | 176 bool m_renderVSyncEnabled; |
| 177 |
| 178 base::TimeDelta m_totalCommitTime; |
| 179 size_t m_totalCommitCount; |
| 176 }; | 180 }; |
| 177 | 181 |
| 178 } | 182 } |
| 179 | 183 |
| 180 #endif | 184 #endif |
| OLD | NEW |