| 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" | 
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 54     virtual void forceSerializeOnSwapBuffers() OVERRIDE; | 54     virtual void forceSerializeOnSwapBuffers() OVERRIDE; | 
| 55 | 55 | 
| 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     virtual void releaseContentsTexturesOnImplThread() OVERRIDE; | 
| 64 | 65 | 
| 65     // CCSchedulerClient implementation | 66     // CCSchedulerClient implementation | 
| 66     virtual void scheduledActionBeginFrame() OVERRIDE; | 67     virtual void scheduledActionBeginFrame() OVERRIDE; | 
| 67     virtual CCScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapIfPossi
     ble() OVERRIDE; | 68     virtual CCScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapIfPossi
     ble() OVERRIDE; | 
| 68     virtual CCScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapForced(
     ) OVERRIDE; | 69     virtual CCScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapForced(
     ) OVERRIDE; | 
| 69     virtual void scheduledActionUpdateMoreResources(double monotonicTimeLimit) O
     VERRIDE; | 70     virtual void scheduledActionUpdateMoreResources(double monotonicTimeLimit) O
     VERRIDE; | 
| 70     virtual void scheduledActionCommit() OVERRIDE; | 71     virtual void scheduledActionCommit() OVERRIDE; | 
| 71     virtual void scheduledActionBeginContextRecreation() OVERRIDE; | 72     virtual void scheduledActionBeginContextRecreation() OVERRIDE; | 
| 72     virtual void scheduledActionAcquireLayerTexturesForMainThread() OVERRIDE; | 73     virtual void scheduledActionAcquireLayerTexturesForMainThread() OVERRIDE; | 
| 73 | 74 | 
| 74     // CCTextureUpdateControllerClient implementation | 75     // CCTextureUpdateControllerClient implementation | 
| 75     virtual void updateTexturesCompleted() OVERRIDE; | 76     virtual void updateTexturesCompleted() OVERRIDE; | 
| 76 | 77 | 
| 77 private: | 78 private: | 
| 78     explicit CCThreadProxy(CCLayerTreeHost*); | 79     explicit CCThreadProxy(CCLayerTreeHost*); | 
| 79     friend class CCThreadProxyContextRecreationTimer; | 80     friend class CCThreadProxyContextRecreationTimer; | 
| 80 | 81 | 
| 81     // Set on impl thread, read on main thread. | 82     // Set on impl thread, read on main thread. | 
| 82     struct BeginFrameAndCommitState { | 83     struct BeginFrameAndCommitState { | 
| 83         BeginFrameAndCommitState() | 84         BeginFrameAndCommitState() | 
| 84             : monotonicFrameBeginTime(0) | 85             : monotonicFrameBeginTime(0) | 
| 85         { | 86         { | 
| 86         } | 87         } | 
| 87 | 88 | 
| 88         double monotonicFrameBeginTime; | 89         double monotonicFrameBeginTime; | 
| 89         OwnPtr<CCScrollAndScaleSet> scrollInfo; | 90         OwnPtr<CCScrollAndScaleSet> scrollInfo; | 
| 90         bool contentsTexturesWereDeleted; | 91         CCPrioritizedTextureManager::BackingVector evictedContentsTexturesBackin
     gs; | 
| 91         size_t memoryAllocationLimitBytes; | 92         size_t memoryAllocationLimitBytes; | 
| 92     }; | 93     }; | 
| 93     OwnPtr<BeginFrameAndCommitState> m_pendingBeginFrameRequest; | 94     OwnPtr<BeginFrameAndCommitState> m_pendingBeginFrameRequest; | 
| 94 | 95 | 
| 95     // Called on main thread | 96     // Called on main thread | 
| 96     void beginFrame(); | 97     void beginFrame(); | 
| 97     void didCommitAndDrawFrame(); | 98     void didCommitAndDrawFrame(); | 
| 98     void didCompleteSwapBuffers(); | 99     void didCompleteSwapBuffers(); | 
| 99     void setAnimationEvents(PassOwnPtr<CCAnimationEventsVector>, double wallCloc
     kTime); | 100     void setAnimationEvents(PassOwnPtr<CCAnimationEventsVector>, double wallCloc
     kTime); | 
| 100     void beginContextRecreation(); | 101     void beginContextRecreation(); | 
| 101     void tryToRecreateContext(); | 102     void tryToRecreateContext(); | 
| 102 | 103 | 
| 103     // Called on impl thread | 104     // Called on impl thread | 
| 104     struct ReadbackRequest { | 105     struct ReadbackRequest { | 
| 105         CCCompletionEvent completion; | 106         CCCompletionEvent completion; | 
| 106         bool success; | 107         bool success; | 
| 107         void* pixels; | 108         void* pixels; | 
| 108         IntRect rect; | 109         IntRect rect; | 
| 109     }; | 110     }; | 
| 110     void forceBeginFrameOnImplThread(CCCompletionEvent*); | 111     void forceBeginFrameOnImplThread(CCCompletionEvent*); | 
| 111     void beginFrameCompleteOnImplThread(CCCompletionEvent*, PassOwnPtr<CCTexture
     UpdateQueue>, bool contentsTexturesWereDeleted); | 112     void beginFrameCompleteOnImplThread(CCCompletionEvent*, PassOwnPtr<CCTexture
     UpdateQueue>); | 
| 112     void beginFrameAbortedOnImplThread(); | 113     void beginFrameAbortedOnImplThread(); | 
| 113     void requestReadbackOnImplThread(ReadbackRequest*); | 114     void requestReadbackOnImplThread(ReadbackRequest*); | 
| 114     void requestStartPageScaleAnimationOnImplThread(IntSize targetPosition, bool
      useAnchor, float scale, double durationSec); | 115     void requestStartPageScaleAnimationOnImplThread(IntSize targetPosition, bool
      useAnchor, float scale, double durationSec); | 
| 115     void finishAllRenderingOnImplThread(CCCompletionEvent*); | 116     void finishAllRenderingOnImplThread(CCCompletionEvent*); | 
| 116     void initializeImplOnImplThread(CCCompletionEvent*, PassOwnPtr<CCInputHandle
     r>); | 117     void initializeImplOnImplThread(CCCompletionEvent*, PassOwnPtr<CCInputHandle
     r>); | 
| 117     void setSurfaceReadyOnImplThread(); | 118     void setSurfaceReadyOnImplThread(); | 
| 118     void setVisibleOnImplThread(CCCompletionEvent*, bool); | 119     void setVisibleOnImplThread(CCCompletionEvent*, bool); | 
| 119     void initializeContextOnImplThread(CCGraphicsContext*); | 120     void initializeContextOnImplThread(CCGraphicsContext*); | 
| 120     void initializeRendererOnImplThread(CCCompletionEvent*, bool* initializeSucc
     eeded, RendererCapabilities*); | 121     void initializeRendererOnImplThread(CCCompletionEvent*, bool* initializeSucc
     eeded, RendererCapabilities*); | 
| 121     void layerTreeHostClosedOnImplThread(CCCompletionEvent*); | 122     void layerTreeHostClosedOnImplThread(CCCompletionEvent*); | 
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 172 | 173 | 
| 173     // 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. | 
| 174     bool m_nextFrameIsNewlyCommittedFrameOnImplThread; | 175     bool m_nextFrameIsNewlyCommittedFrameOnImplThread; | 
| 175 | 176 | 
| 176     bool m_renderVSyncEnabled; | 177     bool m_renderVSyncEnabled; | 
| 177 }; | 178 }; | 
| 178 | 179 | 
| 179 } | 180 } | 
| 180 | 181 | 
| 181 #endif | 182 #endif | 
| OLD | NEW | 
|---|