| 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 CC_THREAD_PROXY_H_ | 5 #ifndef CC_THREAD_PROXY_H_ |
| 6 #define CC_THREAD_PROXY_H_ | 6 #define CC_THREAD_PROXY_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/time.h" | 10 #include "base/time.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 virtual bool commitPendingForTesting() OVERRIDE; | 58 virtual bool commitPendingForTesting() OVERRIDE; |
| 59 | 59 |
| 60 // LayerTreeHostImplClient implementation | 60 // LayerTreeHostImplClient implementation |
| 61 virtual void didLoseOutputSurfaceOnImplThread() OVERRIDE; | 61 virtual void didLoseOutputSurfaceOnImplThread() OVERRIDE; |
| 62 virtual void onSwapBuffersCompleteOnImplThread() OVERRIDE; | 62 virtual void onSwapBuffersCompleteOnImplThread() OVERRIDE; |
| 63 virtual void onVSyncParametersChanged(base::TimeTicks timebase, base::TimeDe
lta interval) OVERRIDE; | 63 virtual void onVSyncParametersChanged(base::TimeTicks timebase, base::TimeDe
lta interval) OVERRIDE; |
| 64 virtual void onCanDrawStateChanged(bool canDraw) OVERRIDE; | 64 virtual void onCanDrawStateChanged(bool canDraw) OVERRIDE; |
| 65 virtual void onHasPendingTreeStateChanged(bool hasPendingTree) OVERRIDE; | 65 virtual void onHasPendingTreeStateChanged(bool hasPendingTree) OVERRIDE; |
| 66 virtual void setNeedsRedrawOnImplThread() OVERRIDE; | 66 virtual void setNeedsRedrawOnImplThread() OVERRIDE; |
| 67 virtual void didUploadVisibleHighResolutionTileOnImplThread() OVERRIDE; | 67 virtual void didUploadVisibleHighResolutionTileOnImplThread() OVERRIDE; |
| 68 virtual void didDetectIdleRasterOnImplThread() OVERRIDE; |
| 68 virtual void setNeedsCommitOnImplThread() OVERRIDE; | 69 virtual void setNeedsCommitOnImplThread() OVERRIDE; |
| 69 virtual void setNeedsManageTilesOnImplThread() OVERRIDE; | 70 virtual void setNeedsManageTilesOnImplThread() OVERRIDE; |
| 71 virtual void setNeedsCheckForCompletedRasterTasksOnImplThread() OVERRIDE; |
| 70 virtual void postAnimationEventsToMainThreadOnImplThread(scoped_ptr<Animatio
nEventsVector>, base::Time wallClockTime) OVERRIDE; | 72 virtual void postAnimationEventsToMainThreadOnImplThread(scoped_ptr<Animatio
nEventsVector>, base::Time wallClockTime) OVERRIDE; |
| 71 virtual bool reduceContentsTextureMemoryOnImplThread(size_t limitBytes, int
priorityCutoff) OVERRIDE; | 73 virtual bool reduceContentsTextureMemoryOnImplThread(size_t limitBytes, int
priorityCutoff) OVERRIDE; |
| 72 virtual void reduceWastedContentsTextureMemoryOnImplThread() OVERRIDE; | 74 virtual void reduceWastedContentsTextureMemoryOnImplThread() OVERRIDE; |
| 73 virtual void sendManagedMemoryStats() OVERRIDE; | 75 virtual void sendManagedMemoryStats() OVERRIDE; |
| 74 virtual bool isInsideDraw() OVERRIDE; | 76 virtual bool isInsideDraw() OVERRIDE; |
| 75 virtual void renewTreePriority() OVERRIDE; | 77 virtual void renewTreePriority() OVERRIDE; |
| 76 | 78 |
| 77 // SchedulerClient implementation | 79 // SchedulerClient implementation |
| 78 virtual void scheduledActionBeginFrame() OVERRIDE; | 80 virtual void scheduledActionBeginFrame() OVERRIDE; |
| 79 virtual ScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapIfPossibl
e() OVERRIDE; | 81 virtual ScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapIfPossibl
e() OVERRIDE; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 void requestReadbackOnImplThread(ReadbackRequest*); | 130 void requestReadbackOnImplThread(ReadbackRequest*); |
| 129 void requestStartPageScaleAnimationOnImplThread(gfx::Vector2d targetOffset,
bool useAnchor, float scale, base::TimeDelta duration); | 131 void requestStartPageScaleAnimationOnImplThread(gfx::Vector2d targetOffset,
bool useAnchor, float scale, base::TimeDelta duration); |
| 130 void finishAllRenderingOnImplThread(CompletionEvent*); | 132 void finishAllRenderingOnImplThread(CompletionEvent*); |
| 131 void initializeImplOnImplThread(CompletionEvent*, InputHandler*); | 133 void initializeImplOnImplThread(CompletionEvent*, InputHandler*); |
| 132 void setSurfaceReadyOnImplThread(); | 134 void setSurfaceReadyOnImplThread(); |
| 133 void setVisibleOnImplThread(CompletionEvent*, bool); | 135 void setVisibleOnImplThread(CompletionEvent*, bool); |
| 134 void initializeOutputSurfaceOnImplThread(scoped_ptr<OutputSurface>); | 136 void initializeOutputSurfaceOnImplThread(scoped_ptr<OutputSurface>); |
| 135 void initializeRendererOnImplThread(CompletionEvent*, bool* initializeSuccee
ded, RendererCapabilities*); | 137 void initializeRendererOnImplThread(CompletionEvent*, bool* initializeSuccee
ded, RendererCapabilities*); |
| 136 void layerTreeHostClosedOnImplThread(CompletionEvent*); | 138 void layerTreeHostClosedOnImplThread(CompletionEvent*); |
| 137 void manageTilesOnImplThread(); | 139 void manageTilesOnImplThread(); |
| 140 void checkForCompletedRasterTasksOnImplThread(); |
| 138 void setFullRootLayerDamageOnImplThread(); | 141 void setFullRootLayerDamageOnImplThread(); |
| 139 void acquireLayerTexturesForMainThreadOnImplThread(CompletionEvent*); | 142 void acquireLayerTexturesForMainThreadOnImplThread(CompletionEvent*); |
| 140 void recreateOutputSurfaceOnImplThread(CompletionEvent*, scoped_ptr<OutputSu
rface>, bool* recreateSucceeded, RendererCapabilities*); | 143 void recreateOutputSurfaceOnImplThread(CompletionEvent*, scoped_ptr<OutputSu
rface>, bool* recreateSucceeded, RendererCapabilities*); |
| 141 void renderingStatsOnImplThread(CompletionEvent*, RenderingStats*); | 144 void renderingStatsOnImplThread(CompletionEvent*, RenderingStats*); |
| 142 ScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapInternal(bool for
cedDraw); | 145 ScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapInternal(bool for
cedDraw); |
| 143 void forceSerializeOnSwapBuffersOnImplThread(CompletionEvent*); | 146 void forceSerializeOnSwapBuffersOnImplThread(CompletionEvent*); |
| 144 void setNeedsForcedCommitOnImplThread(); | 147 void setNeedsForcedCommitOnImplThread(); |
| 145 void checkOutputSurfaceStatusOnImplThread(); | 148 void checkOutputSurfaceStatusOnImplThread(); |
| 146 void commitPendingOnImplThreadForTesting(CommitPendingRequest* request); | 149 void commitPendingOnImplThreadForTesting(CommitPendingRequest* request); |
| 147 void capturePictureOnImplThread(CompletionEvent*, skia::RefPtr<SkPicture>*); | 150 void capturePictureOnImplThread(CompletionEvent*, skia::RefPtr<SkPicture>*); |
| 148 void asValueOnImplThread(CompletionEvent*, base::DictionaryValue*) const; | 151 void asValueOnImplThread(CompletionEvent*, base::DictionaryValue*) const; |
| 149 void renewTreePriorityOnImplThread(); | 152 void renewTreePriorityOnImplThread(); |
| 150 void didSwapUseIncompleteTileOnImplThread(); | 153 void didSwapUseIncompleteTileOnImplThread(); |
| 151 | 154 |
| 152 // Accessed on main thread only. | 155 // Accessed on main thread only. |
| 153 bool m_animateRequested; // Set only when setNeedsAnimate is called. | 156 bool m_animateRequested; // Set only when setNeedsAnimate is called. |
| 154 bool m_commitRequested; // Set only when setNeedsCommit is called. | 157 bool m_commitRequested; // Set only when setNeedsCommit is called. |
| 155 bool m_commitRequestSentToImplThread; // Set by setNeedsCommit and setNeedsA
nimate. | 158 bool m_commitRequestSentToImplThread; // Set by setNeedsCommit and setNeedsA
nimate. |
| 156 base::CancelableClosure m_outputSurfaceRecreationCallback; | 159 base::CancelableClosure m_outputSurfaceRecreationCallback; |
| 157 LayerTreeHost* m_layerTreeHost; | 160 LayerTreeHost* m_layerTreeHost; |
| 158 bool m_rendererInitialized; | 161 bool m_rendererInitialized; |
| 159 RendererCapabilities m_RendererCapabilitiesMainThreadCopy; | 162 RendererCapabilities m_RendererCapabilitiesMainThreadCopy; |
| 160 bool m_started; | 163 bool m_started; |
| 161 bool m_texturesAcquired; | 164 bool m_texturesAcquired; |
| 162 bool m_inCompositeAndReadback; | 165 bool m_inCompositeAndReadback; |
| 163 bool m_manageTilesPending; | 166 bool m_manageTilesPending; |
| 167 bool m_checkForCompletedRasterTasksPending; |
| 164 // Weak pointer to use when posting tasks to the impl thread. | 168 // Weak pointer to use when posting tasks to the impl thread. |
| 165 base::WeakPtr<ThreadProxy> m_implThreadWeakPtr; | 169 base::WeakPtr<ThreadProxy> m_implThreadWeakPtr; |
| 166 | 170 |
| 167 base::WeakPtrFactory<ThreadProxy> m_weakFactoryOnImplThread; | 171 base::WeakPtrFactory<ThreadProxy> m_weakFactoryOnImplThread; |
| 168 | 172 |
| 169 base::WeakPtr<ThreadProxy> m_mainThreadWeakPtr; | 173 base::WeakPtr<ThreadProxy> m_mainThreadWeakPtr; |
| 170 base::WeakPtrFactory<ThreadProxy> m_weakFactory; | 174 base::WeakPtrFactory<ThreadProxy> m_weakFactory; |
| 171 | 175 |
| 176 base::WeakPtrFactory<ThreadProxy> |
| 177 m_weakCheckForCompletedRasterTasksFactory; |
| 178 |
| 172 scoped_ptr<LayerTreeHostImpl> m_layerTreeHostImpl; | 179 scoped_ptr<LayerTreeHostImpl> m_layerTreeHostImpl; |
| 173 | 180 |
| 174 scoped_ptr<InputHandler> m_inputHandlerOnImplThread; | 181 scoped_ptr<InputHandler> m_inputHandlerOnImplThread; |
| 175 | 182 |
| 176 scoped_ptr<Scheduler> m_schedulerOnImplThread; | 183 scoped_ptr<Scheduler> m_schedulerOnImplThread; |
| 177 | 184 |
| 178 // Holds on to the context we might use for compositing in between initializ
eContext() | 185 // Holds on to the context we might use for compositing in between initializ
eContext() |
| 179 // and initializeRenderer() calls. | 186 // and initializeRenderer() calls. |
| 180 scoped_ptr<OutputSurface> m_outputSurfaceBeforeInitializationOnImplThread; | 187 scoped_ptr<OutputSurface> m_outputSurfaceBeforeInitializationOnImplThread; |
| 181 | 188 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 209 bool m_deferCommits; | 216 bool m_deferCommits; |
| 210 scoped_ptr<BeginFrameAndCommitState> m_pendingDeferredCommit; | 217 scoped_ptr<BeginFrameAndCommitState> m_pendingDeferredCommit; |
| 211 | 218 |
| 212 base::TimeTicks m_smoothnessTakesPriorityExpirationTime; | 219 base::TimeTicks m_smoothnessTakesPriorityExpirationTime; |
| 213 bool m_renewTreePriorityOnImplThreadPending; | 220 bool m_renewTreePriorityOnImplThreadPending; |
| 214 }; | 221 }; |
| 215 | 222 |
| 216 } // namespace cc | 223 } // namespace cc |
| 217 | 224 |
| 218 #endif // CC_THREAD_PROXY_H_ | 225 #endif // CC_THREAD_PROXY_H_ |
| OLD | NEW |