| 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 <base/time.h> |
| 15 #include <wtf/OwnPtr.h> | 15 #include <wtf/OwnPtr.h> |
| 16 | 16 |
| 17 namespace cc { | 17 namespace cc { |
| 18 | 18 |
| 19 class CCInputHandler; | 19 class CCInputHandler; |
| 20 class CCLayerTreeHost; | 20 class CCLayerTreeHost; |
| 21 class CCScheduler; | 21 class CCScheduler; |
| 22 class CCScopedThreadProxy; | 22 class CCScopedThreadProxy; |
| 23 class CCTextureUpdateQueue; | 23 class CCTextureUpdateQueue; |
| 24 class CCThread; | 24 class CCThread; |
| 25 class CCThreadProxyContextRecreationTimer; | 25 class CCThreadProxyContextRecreationTimer; |
| 26 | 26 |
| 27 class CCThreadProxy : public CCProxy, CCLayerTreeHostImplClient, CCSchedulerClie
nt, CCTextureUpdateControllerClient { | 27 class CCThreadProxy : public CCProxy, CCLayerTreeHostImplClient, CCSchedulerClie
nt, CCTextureUpdateControllerClient { |
| 28 public: | 28 public: |
| 29 static PassOwnPtr<CCProxy> create(CCLayerTreeHost*); | 29 static scoped_ptr<CCProxy> create(CCLayerTreeHost*); |
| 30 | 30 |
| 31 virtual ~CCThreadProxy(); | 31 virtual ~CCThreadProxy(); |
| 32 | 32 |
| 33 // CCProxy implementation | 33 // CCProxy implementation |
| 34 virtual bool compositeAndReadback(void *pixels, const IntRect&) OVERRIDE; | 34 virtual bool compositeAndReadback(void *pixels, const IntRect&) OVERRIDE; |
| 35 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; |
| 36 virtual void finishAllRendering() OVERRIDE; | 36 virtual void finishAllRendering() OVERRIDE; |
| 37 virtual bool isStarted() const OVERRIDE; | 37 virtual bool isStarted() const OVERRIDE; |
| 38 virtual bool initializeContext() OVERRIDE; | 38 virtual bool initializeContext() OVERRIDE; |
| 39 virtual void setSurfaceReady() OVERRIDE; | 39 virtual void setSurfaceReady() OVERRIDE; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 54 virtual void acquireLayerTextures() OVERRIDE; | 54 virtual void acquireLayerTextures() OVERRIDE; |
| 55 virtual void forceSerializeOnSwapBuffers() OVERRIDE; | 55 virtual void forceSerializeOnSwapBuffers() OVERRIDE; |
| 56 | 56 |
| 57 // CCLayerTreeHostImplClient implementation | 57 // CCLayerTreeHostImplClient implementation |
| 58 virtual void didLoseContextOnImplThread() OVERRIDE; | 58 virtual void didLoseContextOnImplThread() OVERRIDE; |
| 59 virtual void onSwapBuffersCompleteOnImplThread() OVERRIDE; | 59 virtual void onSwapBuffersCompleteOnImplThread() OVERRIDE; |
| 60 virtual void onVSyncParametersChanged(double monotonicTimebase, double inter
valInSeconds) OVERRIDE; | 60 virtual void onVSyncParametersChanged(double monotonicTimebase, double inter
valInSeconds) OVERRIDE; |
| 61 virtual void onCanDrawStateChanged(bool canDraw) OVERRIDE; | 61 virtual void onCanDrawStateChanged(bool canDraw) OVERRIDE; |
| 62 virtual void setNeedsRedrawOnImplThread() OVERRIDE; | 62 virtual void setNeedsRedrawOnImplThread() OVERRIDE; |
| 63 virtual void setNeedsCommitOnImplThread() OVERRIDE; | 63 virtual void setNeedsCommitOnImplThread() OVERRIDE; |
| 64 virtual void postAnimationEventsToMainThreadOnImplThread(PassOwnPtr<CCAnimat
ionEventsVector>, double wallClockTime) OVERRIDE; | 64 virtual void postAnimationEventsToMainThreadOnImplThread(scoped_ptr<CCAnimat
ionEventsVector>, double wallClockTime) OVERRIDE; |
| 65 virtual void releaseContentsTexturesOnImplThread() OVERRIDE; | 65 virtual void releaseContentsTexturesOnImplThread() OVERRIDE; |
| 66 | 66 |
| 67 // CCSchedulerClient implementation | 67 // CCSchedulerClient implementation |
| 68 virtual void scheduledActionBeginFrame() OVERRIDE; | 68 virtual void scheduledActionBeginFrame() OVERRIDE; |
| 69 virtual CCScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapIfPossi
ble() OVERRIDE; | 69 virtual CCScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapIfPossi
ble() OVERRIDE; |
| 70 virtual CCScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapForced(
) OVERRIDE; | 70 virtual CCScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapForced(
) OVERRIDE; |
| 71 virtual void scheduledActionCommit() OVERRIDE; | 71 virtual void scheduledActionCommit() OVERRIDE; |
| 72 virtual void scheduledActionBeginContextRecreation() OVERRIDE; | 72 virtual void scheduledActionBeginContextRecreation() OVERRIDE; |
| 73 virtual void scheduledActionAcquireLayerTexturesForMainThread() OVERRIDE; | 73 virtual void scheduledActionAcquireLayerTexturesForMainThread() OVERRIDE; |
| 74 virtual void didAnticipatedDrawTimeChange(base::TimeTicks) OVERRIDE; | 74 virtual void didAnticipatedDrawTimeChange(base::TimeTicks) OVERRIDE; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 90 WebKit::WebTransformationMatrix implTransform; | 90 WebKit::WebTransformationMatrix implTransform; |
| 91 CCPrioritizedTextureManager::BackingVector evictedContentsTexturesBackin
gs; | 91 CCPrioritizedTextureManager::BackingVector evictedContentsTexturesBackin
gs; |
| 92 size_t memoryAllocationLimitBytes; | 92 size_t memoryAllocationLimitBytes; |
| 93 }; | 93 }; |
| 94 OwnPtr<BeginFrameAndCommitState> m_pendingBeginFrameRequest; | 94 OwnPtr<BeginFrameAndCommitState> m_pendingBeginFrameRequest; |
| 95 | 95 |
| 96 // Called on main thread | 96 // Called on main thread |
| 97 void beginFrame(); | 97 void beginFrame(); |
| 98 void didCommitAndDrawFrame(); | 98 void didCommitAndDrawFrame(); |
| 99 void didCompleteSwapBuffers(); | 99 void didCompleteSwapBuffers(); |
| 100 void setAnimationEvents(PassOwnPtr<CCAnimationEventsVector>, double wallCloc
kTime); | 100 void setAnimationEvents(CCAnimationEventsVector*, double wallClockTime); |
| 101 void beginContextRecreation(); | 101 void beginContextRecreation(); |
| 102 void tryToRecreateContext(); | 102 void tryToRecreateContext(); |
| 103 | 103 |
| 104 // Called on impl thread | 104 // Called on impl thread |
| 105 struct ReadbackRequest { | 105 struct ReadbackRequest { |
| 106 CCCompletionEvent completion; | 106 CCCompletionEvent completion; |
| 107 bool success; | 107 bool success; |
| 108 void* pixels; | 108 void* pixels; |
| 109 IntRect rect; | 109 IntRect rect; |
| 110 }; | 110 }; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 | 176 |
| 177 bool m_renderVSyncEnabled; | 177 bool m_renderVSyncEnabled; |
| 178 | 178 |
| 179 base::TimeDelta m_totalCommitTime; | 179 base::TimeDelta m_totalCommitTime; |
| 180 size_t m_totalCommitCount; | 180 size_t m_totalCommitCount; |
| 181 }; | 181 }; |
| 182 | 182 |
| 183 } | 183 } |
| 184 | 184 |
| 185 #endif | 185 #endif |
| OLD | NEW |