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_LAYER_TREE_HOST_IMPL_H_ | 5 #ifndef CC_LAYER_TREE_HOST_IMPL_H_ |
6 #define CC_LAYER_TREE_HOST_IMPL_H_ | 6 #define CC_LAYER_TREE_HOST_IMPL_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 public: | 46 public: |
47 virtual void didLoseOutputSurfaceOnImplThread() = 0; | 47 virtual void didLoseOutputSurfaceOnImplThread() = 0; |
48 virtual void onSwapBuffersCompleteOnImplThread() = 0; | 48 virtual void onSwapBuffersCompleteOnImplThread() = 0; |
49 virtual void onVSyncParametersChanged(base::TimeTicks timebase, base::TimeDe
lta interval) = 0; | 49 virtual void onVSyncParametersChanged(base::TimeTicks timebase, base::TimeDe
lta interval) = 0; |
50 virtual void onCanDrawStateChanged(bool canDraw) = 0; | 50 virtual void onCanDrawStateChanged(bool canDraw) = 0; |
51 virtual void onHasPendingTreeStateChanged(bool hasPendingTree) = 0; | 51 virtual void onHasPendingTreeStateChanged(bool hasPendingTree) = 0; |
52 virtual void setNeedsRedrawOnImplThread() = 0; | 52 virtual void setNeedsRedrawOnImplThread() = 0; |
53 virtual void didUploadVisibleHighResolutionTileOnImplThread() = 0; | 53 virtual void didUploadVisibleHighResolutionTileOnImplThread() = 0; |
54 virtual void setNeedsCommitOnImplThread() = 0; | 54 virtual void setNeedsCommitOnImplThread() = 0; |
55 virtual void setNeedsManageTilesOnImplThread() = 0; | 55 virtual void setNeedsManageTilesOnImplThread() = 0; |
| 56 virtual void setNeedsCheckForCompletedRasterTasksOnImplThread() = 0; |
56 virtual void postAnimationEventsToMainThreadOnImplThread(scoped_ptr<Animatio
nEventsVector>, base::Time wallClockTime) = 0; | 57 virtual void postAnimationEventsToMainThreadOnImplThread(scoped_ptr<Animatio
nEventsVector>, base::Time wallClockTime) = 0; |
57 // Returns true if resources were deleted by this call. | 58 // Returns true if resources were deleted by this call. |
58 virtual bool reduceContentsTextureMemoryOnImplThread(size_t limitBytes, int
priorityCutoff) = 0; | 59 virtual bool reduceContentsTextureMemoryOnImplThread(size_t limitBytes, int
priorityCutoff) = 0; |
59 virtual void reduceWastedContentsTextureMemoryOnImplThread() = 0; | 60 virtual void reduceWastedContentsTextureMemoryOnImplThread() = 0; |
60 virtual void sendManagedMemoryStats() = 0; | 61 virtual void sendManagedMemoryStats() = 0; |
61 virtual bool isInsideDraw() = 0; | 62 virtual bool isInsideDraw() = 0; |
62 virtual void renewTreePriority() = 0; | 63 virtual void renewTreePriority() = 0; |
63 }; | 64 }; |
64 | 65 |
65 // LayerTreeHostImpl owns the LayerImpl tree as well as associated rendering sta
te | 66 // LayerTreeHostImpl owns the LayerImpl tree as well as associated rendering sta
te |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 virtual void onSwapBuffersComplete() OVERRIDE; | 131 virtual void onSwapBuffersComplete() OVERRIDE; |
131 virtual void setFullRootLayerDamage() OVERRIDE; | 132 virtual void setFullRootLayerDamage() OVERRIDE; |
132 virtual void setManagedMemoryPolicy(const ManagedMemoryPolicy& policy) OVERR
IDE; | 133 virtual void setManagedMemoryPolicy(const ManagedMemoryPolicy& policy) OVERR
IDE; |
133 virtual void enforceManagedMemoryPolicy(const ManagedMemoryPolicy& policy) O
VERRIDE; | 134 virtual void enforceManagedMemoryPolicy(const ManagedMemoryPolicy& policy) O
VERRIDE; |
134 virtual bool hasImplThread() const OVERRIDE; | 135 virtual bool hasImplThread() const OVERRIDE; |
135 virtual bool shouldClearRootRenderPass() const OVERRIDE; | 136 virtual bool shouldClearRootRenderPass() const OVERRIDE; |
136 virtual CompositorFrameMetadata makeCompositorFrameMetadata() const OVERRIDE
; | 137 virtual CompositorFrameMetadata makeCompositorFrameMetadata() const OVERRIDE
; |
137 | 138 |
138 // TileManagerClient implementation. | 139 // TileManagerClient implementation. |
139 virtual void ScheduleManageTiles() OVERRIDE; | 140 virtual void ScheduleManageTiles() OVERRIDE; |
| 141 virtual void ScheduleCheckForCompletedRasterTasks() OVERRIDE; |
140 virtual void DidUploadVisibleHighResolutionTile() OVERRIDE; | 142 virtual void DidUploadVisibleHighResolutionTile() OVERRIDE; |
141 | 143 |
142 // OutputSurfaceClient implementation. | 144 // OutputSurfaceClient implementation. |
143 virtual void OnVSyncParametersChanged(base::TimeTicks timebase, base::TimeDe
lta interval) OVERRIDE; | 145 virtual void OnVSyncParametersChanged(base::TimeTicks timebase, base::TimeDe
lta interval) OVERRIDE; |
144 virtual void OnSendFrameToParentCompositorAck(const CompositorFrameAck&) OVE
RRIDE; | 146 virtual void OnSendFrameToParentCompositorAck(const CompositorFrameAck&) OVE
RRIDE; |
145 | 147 |
146 // Called from LayerTreeImpl. | 148 // Called from LayerTreeImpl. |
147 void OnCanDrawStateChangedForTree(LayerTreeImpl*); | 149 void OnCanDrawStateChangedForTree(LayerTreeImpl*); |
148 | 150 |
149 // Implementation | 151 // Implementation |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 | 255 |
254 skia::RefPtr<SkPicture> capturePicture(); | 256 skia::RefPtr<SkPicture> capturePicture(); |
255 | 257 |
256 bool pinchGestureActive() const { return m_pinchGestureActive; } | 258 bool pinchGestureActive() const { return m_pinchGestureActive; } |
257 | 259 |
258 void setTreePriority(TreePriority priority); | 260 void setTreePriority(TreePriority priority); |
259 | 261 |
260 void beginNextFrame(); | 262 void beginNextFrame(); |
261 base::TimeTicks currentFrameTime(); | 263 base::TimeTicks currentFrameTime(); |
262 | 264 |
| 265 void checkForCompletedRasterTasks(); |
| 266 |
263 protected: | 267 protected: |
264 LayerTreeHostImpl(const LayerTreeSettings&, LayerTreeHostImplClient*, Proxy*
); | 268 LayerTreeHostImpl(const LayerTreeSettings&, LayerTreeHostImplClient*, Proxy*
); |
265 void activatePendingTree(); | 269 void activatePendingTree(); |
266 | 270 |
267 // Virtual for testing. | 271 // Virtual for testing. |
268 virtual void animateLayers(base::TimeTicks monotonicTime, base::Time wallClo
ckTime); | 272 virtual void animateLayers(base::TimeTicks monotonicTime, base::Time wallClo
ckTime); |
269 virtual void updateAnimationState(); | 273 virtual void updateAnimationState(); |
270 | 274 |
271 // Virtual for testing. | 275 // Virtual for testing. |
272 virtual base::TimeDelta lowFrequencyAnimationInterval() const; | 276 virtual base::TimeDelta lowFrequencyAnimationInterval() const; |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 base::TimeTicks m_currentFrameTime; | 372 base::TimeTicks m_currentFrameTime; |
369 | 373 |
370 scoped_ptr<AnimationRegistrar> m_animationRegistrar; | 374 scoped_ptr<AnimationRegistrar> m_animationRegistrar; |
371 | 375 |
372 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 376 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
373 }; | 377 }; |
374 | 378 |
375 } // namespace cc | 379 } // namespace cc |
376 | 380 |
377 #endif // CC_LAYER_TREE_HOST_IMPL_H_ | 381 #endif // CC_LAYER_TREE_HOST_IMPL_H_ |
OLD | NEW |