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 <wtf/OwnPtr.h> | 14 #include <wtf/OwnPtr.h> |
14 | 15 |
15 namespace WebCore { | 16 namespace WebCore { |
16 | 17 |
17 class CCInputHandler; | 18 class CCInputHandler; |
18 class CCLayerTreeHost; | 19 class CCLayerTreeHost; |
19 class CCScheduler; | 20 class CCScheduler; |
20 class CCScopedThreadProxy; | 21 class CCScopedThreadProxy; |
21 class CCTextureUpdateQueue; | 22 class CCTextureUpdateQueue; |
22 class CCTextureUpdateController; | |
23 class CCThread; | 23 class CCThread; |
24 class CCThreadProxyContextRecreationTimer; | 24 class CCThreadProxyContextRecreationTimer; |
25 | 25 |
26 class CCThreadProxy : public CCProxy, CCLayerTreeHostImplClient, CCSchedulerClie
nt { | 26 class CCThreadProxy : public CCProxy, CCLayerTreeHostImplClient, CCSchedulerClie
nt, CCTextureUpdateControllerClient { |
27 public: | 27 public: |
28 static PassOwnPtr<CCProxy> create(CCLayerTreeHost*); | 28 static PassOwnPtr<CCProxy> create(CCLayerTreeHost*); |
29 | 29 |
30 virtual ~CCThreadProxy(); | 30 virtual ~CCThreadProxy(); |
31 | 31 |
32 // CCProxy implementation | 32 // CCProxy implementation |
33 virtual bool compositeAndReadback(void *pixels, const IntRect&) OVERRIDE; | 33 virtual bool compositeAndReadback(void *pixels, const IntRect&) OVERRIDE; |
34 virtual void startPageScaleAnimation(const IntSize& targetPosition, bool use
Anchor, float scale, double duration) OVERRIDE; | 34 virtual void startPageScaleAnimation(const IntSize& targetPosition, bool use
Anchor, float scale, double duration) OVERRIDE; |
35 virtual void finishAllRendering() OVERRIDE; | 35 virtual void finishAllRendering() OVERRIDE; |
36 virtual bool isStarted() const OVERRIDE; | 36 virtual bool isStarted() const OVERRIDE; |
(...skipping 19 matching lines...) Expand all Loading... |
56 // CCLayerTreeHostImplClient implementation | 56 // CCLayerTreeHostImplClient implementation |
57 virtual void didLoseContextOnImplThread() OVERRIDE; | 57 virtual void didLoseContextOnImplThread() OVERRIDE; |
58 virtual void onSwapBuffersCompleteOnImplThread() OVERRIDE; | 58 virtual void onSwapBuffersCompleteOnImplThread() OVERRIDE; |
59 virtual void onVSyncParametersChanged(double monotonicTimebase, double inter
valInSeconds) OVERRIDE; | 59 virtual void onVSyncParametersChanged(double monotonicTimebase, double inter
valInSeconds) OVERRIDE; |
60 virtual void onCanDrawStateChanged(bool canDraw) OVERRIDE; | 60 virtual void onCanDrawStateChanged(bool canDraw) OVERRIDE; |
61 virtual void setNeedsRedrawOnImplThread() OVERRIDE; | 61 virtual void setNeedsRedrawOnImplThread() OVERRIDE; |
62 virtual void setNeedsCommitOnImplThread() OVERRIDE; | 62 virtual void setNeedsCommitOnImplThread() OVERRIDE; |
63 virtual void postAnimationEventsToMainThreadOnImplThread(PassOwnPtr<CCAnimat
ionEventsVector>, double wallClockTime) OVERRIDE; | 63 virtual void postAnimationEventsToMainThreadOnImplThread(PassOwnPtr<CCAnimat
ionEventsVector>, double wallClockTime) OVERRIDE; |
64 | 64 |
65 // CCSchedulerClient implementation | 65 // CCSchedulerClient implementation |
66 virtual bool hasMoreResourceUpdates() const OVERRIDE; | |
67 | |
68 virtual void scheduledActionBeginFrame() OVERRIDE; | 66 virtual void scheduledActionBeginFrame() OVERRIDE; |
69 virtual CCScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapIfPossi
ble() OVERRIDE; | 67 virtual CCScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapIfPossi
ble() OVERRIDE; |
70 virtual CCScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapForced(
) OVERRIDE; | 68 virtual CCScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapForced(
) OVERRIDE; |
71 virtual void scheduledActionUpdateMoreResources(double monotonicTimeLimit) O
VERRIDE; | 69 virtual void scheduledActionUpdateMoreResources(double monotonicTimeLimit) O
VERRIDE; |
72 virtual void scheduledActionCommit() OVERRIDE; | 70 virtual void scheduledActionCommit() OVERRIDE; |
73 virtual void scheduledActionBeginContextRecreation() OVERRIDE; | 71 virtual void scheduledActionBeginContextRecreation() OVERRIDE; |
74 virtual void scheduledActionAcquireLayerTexturesForMainThread() OVERRIDE; | 72 virtual void scheduledActionAcquireLayerTexturesForMainThread() OVERRIDE; |
75 | 73 |
| 74 // CCTextureUpdateControllerClient implementation |
| 75 virtual void updateTexturesCompleted() OVERRIDE; |
| 76 |
76 private: | 77 private: |
77 explicit CCThreadProxy(CCLayerTreeHost*); | 78 explicit CCThreadProxy(CCLayerTreeHost*); |
78 friend class CCThreadProxyContextRecreationTimer; | 79 friend class CCThreadProxyContextRecreationTimer; |
79 | 80 |
80 // Set on impl thread, read on main thread. | 81 // Set on impl thread, read on main thread. |
81 struct BeginFrameAndCommitState { | 82 struct BeginFrameAndCommitState { |
82 BeginFrameAndCommitState() | 83 BeginFrameAndCommitState() |
83 : monotonicFrameBeginTime(0) | 84 : monotonicFrameBeginTime(0) |
84 { | 85 { |
85 } | 86 } |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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; |
176 }; | 177 }; |
177 | 178 |
178 } | 179 } |
179 | 180 |
180 #endif | 181 #endif |
OLD | NEW |