| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 // LayerTreeHost->Proxy callback interface. | 44 // LayerTreeHost->Proxy callback interface. |
| 45 class LayerTreeHostImplClient { | 45 class LayerTreeHostImplClient { |
| 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 didSwapUseIncompleteTextureOnImplThread() = 0; |
| 54 virtual void didUploadVisibleHighResolutionTileOnImplTread() = 0; |
| 53 virtual void setNeedsCommitOnImplThread() = 0; | 55 virtual void setNeedsCommitOnImplThread() = 0; |
| 54 virtual void setNeedsManageTilesOnImplThread() = 0; | 56 virtual void setNeedsManageTilesOnImplThread() = 0; |
| 55 virtual void postAnimationEventsToMainThreadOnImplThread(scoped_ptr<Animatio
nEventsVector>, base::Time wallClockTime) = 0; | 57 virtual void postAnimationEventsToMainThreadOnImplThread(scoped_ptr<Animatio
nEventsVector>, base::Time wallClockTime) = 0; |
| 56 // Returns true if resources were deleted by this call. | 58 // Returns true if resources were deleted by this call. |
| 57 virtual bool reduceContentsTextureMemoryOnImplThread(size_t limitBytes, int
priorityCutoff) = 0; | 59 virtual bool reduceContentsTextureMemoryOnImplThread(size_t limitBytes, int
priorityCutoff) = 0; |
| 58 virtual void sendManagedMemoryStats() = 0; | 60 virtual void sendManagedMemoryStats() = 0; |
| 61 virtual bool isInsideDraw() = 0; |
| 59 }; | 62 }; |
| 60 | 63 |
| 61 // LayerTreeHostImpl owns the LayerImpl tree as well as associated rendering sta
te | 64 // LayerTreeHostImpl owns the LayerImpl tree as well as associated rendering sta
te |
| 62 class CC_EXPORT LayerTreeHostImpl : public InputHandlerClient, | 65 class CC_EXPORT LayerTreeHostImpl : public InputHandlerClient, |
| 63 public RendererClient, | 66 public RendererClient, |
| 64 public TileManagerClient, | 67 public TileManagerClient, |
| 65 public OutputSurfaceClient, | 68 public OutputSurfaceClient, |
| 66 public TopControlsManagerClient { | 69 public TopControlsManagerClient { |
| 67 typedef std::vector<LayerImpl*> LayerList; | 70 typedef std::vector<LayerImpl*> LayerList; |
| 68 | 71 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 virtual void onSwapBuffersComplete() OVERRIDE; | 127 virtual void onSwapBuffersComplete() OVERRIDE; |
| 125 virtual void setFullRootLayerDamage() OVERRIDE; | 128 virtual void setFullRootLayerDamage() OVERRIDE; |
| 126 virtual void setManagedMemoryPolicy(const ManagedMemoryPolicy& policy) OVERR
IDE; | 129 virtual void setManagedMemoryPolicy(const ManagedMemoryPolicy& policy) OVERR
IDE; |
| 127 virtual void enforceManagedMemoryPolicy(const ManagedMemoryPolicy& policy) O
VERRIDE; | 130 virtual void enforceManagedMemoryPolicy(const ManagedMemoryPolicy& policy) O
VERRIDE; |
| 128 virtual bool hasImplThread() const OVERRIDE; | 131 virtual bool hasImplThread() const OVERRIDE; |
| 129 virtual bool shouldClearRootRenderPass() const OVERRIDE; | 132 virtual bool shouldClearRootRenderPass() const OVERRIDE; |
| 130 virtual CompositorFrameMetadata makeCompositorFrameMetadata() const OVERRIDE
; | 133 virtual CompositorFrameMetadata makeCompositorFrameMetadata() const OVERRIDE
; |
| 131 | 134 |
| 132 // TileManagerClient implementation. | 135 // TileManagerClient implementation. |
| 133 virtual void ScheduleManageTiles() OVERRIDE; | 136 virtual void ScheduleManageTiles() OVERRIDE; |
| 137 virtual void DidUploadVisibleHighResolutionTile() OVERRIDE; |
| 134 | 138 |
| 135 // OutputSurfaceClient implementation. | 139 // OutputSurfaceClient implementation. |
| 136 virtual void OnVSyncParametersChanged(base::TimeTicks timebase, base::TimeDe
lta interval) OVERRIDE; | 140 virtual void OnVSyncParametersChanged(base::TimeTicks timebase, base::TimeDe
lta interval) OVERRIDE; |
| 137 virtual void OnSendFrameToParentCompositorAck(const CompositorFrameAck&) OVE
RRIDE; | 141 virtual void OnSendFrameToParentCompositorAck(const CompositorFrameAck&) OVE
RRIDE; |
| 138 | 142 |
| 139 // Called from LayerTreeImpl. | 143 // Called from LayerTreeImpl. |
| 140 void OnCanDrawStateChangedForTree(LayerTreeImpl*); | 144 void OnCanDrawStateChangedForTree(LayerTreeImpl*); |
| 141 | 145 |
| 142 // Implementation | 146 // Implementation |
| 143 bool canDraw(); | 147 bool canDraw(); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 156 const RendererCapabilities& rendererCapabilities() const; | 160 const RendererCapabilities& rendererCapabilities() const; |
| 157 | 161 |
| 158 bool swapBuffers(); | 162 bool swapBuffers(); |
| 159 | 163 |
| 160 void readback(void* pixels, const gfx::Rect&); | 164 void readback(void* pixels, const gfx::Rect&); |
| 161 | 165 |
| 162 const LayerTreeImpl* activeTree() const { return m_activeTree.get(); } | 166 const LayerTreeImpl* activeTree() const { return m_activeTree.get(); } |
| 163 LayerTreeImpl* pendingTree() { return m_pendingTree.get(); } | 167 LayerTreeImpl* pendingTree() { return m_pendingTree.get(); } |
| 164 const LayerTreeImpl* pendingTree() const { return m_pendingTree.get(); } | 168 const LayerTreeImpl* pendingTree() const { return m_pendingTree.get(); } |
| 165 void createPendingTree(); | 169 void createPendingTree(); |
| 166 void checkForCompletedSetPixels(); | 170 void checkForCompletedTextures(); |
| 167 virtual void activatePendingTreeIfNeeded(); | 171 virtual void activatePendingTreeIfNeeded(); |
| 168 | 172 |
| 169 // Shortcuts to layers on the active tree. | 173 // Shortcuts to layers on the active tree. |
| 170 LayerImpl* rootLayer() const; | 174 LayerImpl* rootLayer() const; |
| 171 LayerImpl* rootScrollLayer() const; | 175 LayerImpl* rootScrollLayer() const; |
| 172 LayerImpl* currentlyScrollingLayer() const; | 176 LayerImpl* currentlyScrollingLayer() const; |
| 173 | 177 |
| 174 bool visible() const { return m_visible; } | 178 bool visible() const { return m_visible; } |
| 175 void setVisible(bool); | 179 void setVisible(bool); |
| 176 | 180 |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 size_t m_lastSentMemoryUseBytes; | 356 size_t m_lastSentMemoryUseBytes; |
| 353 | 357 |
| 354 scoped_ptr<AnimationRegistrar> m_animationRegistrar; | 358 scoped_ptr<AnimationRegistrar> m_animationRegistrar; |
| 355 | 359 |
| 356 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 360 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
| 357 }; | 361 }; |
| 358 | 362 |
| 359 } // namespace cc | 363 } // namespace cc |
| 360 | 364 |
| 361 #endif // CC_LAYER_TREE_HOST_IMPL_H_ | 365 #endif // CC_LAYER_TREE_HOST_IMPL_H_ |
| OLD | NEW |