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 29 matching lines...) Expand all Loading... |
40 | 40 |
41 // LayerTreeHost->Proxy callback interface. | 41 // LayerTreeHost->Proxy callback interface. |
42 class LayerTreeHostImplClient { | 42 class LayerTreeHostImplClient { |
43 public: | 43 public: |
44 virtual void didLoseOutputSurfaceOnImplThread() = 0; | 44 virtual void didLoseOutputSurfaceOnImplThread() = 0; |
45 virtual void onSwapBuffersCompleteOnImplThread() = 0; | 45 virtual void onSwapBuffersCompleteOnImplThread() = 0; |
46 virtual void onVSyncParametersChanged(base::TimeTicks timebase, base::TimeDe
lta interval) = 0; | 46 virtual void onVSyncParametersChanged(base::TimeTicks timebase, base::TimeDe
lta interval) = 0; |
47 virtual void onCanDrawStateChanged(bool canDraw) = 0; | 47 virtual void onCanDrawStateChanged(bool canDraw) = 0; |
48 virtual void onHasPendingTreeStateChanged(bool hasPendingTree) = 0; | 48 virtual void onHasPendingTreeStateChanged(bool hasPendingTree) = 0; |
49 virtual void setNeedsRedrawOnImplThread() = 0; | 49 virtual void setNeedsRedrawOnImplThread() = 0; |
| 50 virtual void setNeedsRedrawOnVisibleTextureUploadOnImplThread() = 0; |
50 virtual void setNeedsCommitOnImplThread() = 0; | 51 virtual void setNeedsCommitOnImplThread() = 0; |
51 virtual void setNeedsManageTilesOnImplThread() = 0; | 52 virtual void setNeedsManageTilesOnImplThread() = 0; |
52 virtual void postAnimationEventsToMainThreadOnImplThread(scoped_ptr<Animatio
nEventsVector>, base::Time wallClockTime) = 0; | 53 virtual void postAnimationEventsToMainThreadOnImplThread(scoped_ptr<Animatio
nEventsVector>, base::Time wallClockTime) = 0; |
53 // Returns true if resources were deleted by this call. | 54 // Returns true if resources were deleted by this call. |
54 virtual bool reduceContentsTextureMemoryOnImplThread(size_t limitBytes, int
priorityCutoff) = 0; | 55 virtual bool reduceContentsTextureMemoryOnImplThread(size_t limitBytes, int
priorityCutoff) = 0; |
55 virtual void sendManagedMemoryStats() = 0; | 56 virtual void sendManagedMemoryStats() = 0; |
56 }; | 57 }; |
57 | 58 |
58 // LayerTreeHostImpl owns the LayerImpl tree as well as associated rendering sta
te | 59 // LayerTreeHostImpl owns the LayerImpl tree as well as associated rendering sta
te |
59 class CC_EXPORT LayerTreeHostImpl : public InputHandlerClient, | 60 class CC_EXPORT LayerTreeHostImpl : public InputHandlerClient, |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 | 149 |
149 bool swapBuffers(); | 150 bool swapBuffers(); |
150 | 151 |
151 void readback(void* pixels, const gfx::Rect&); | 152 void readback(void* pixels, const gfx::Rect&); |
152 | 153 |
153 LayerTreeImpl* activeTree() { return m_activeTree.get(); } | 154 LayerTreeImpl* activeTree() { return m_activeTree.get(); } |
154 const LayerTreeImpl* activeTree() const { return m_activeTree.get(); } | 155 const LayerTreeImpl* activeTree() const { return m_activeTree.get(); } |
155 LayerTreeImpl* pendingTree() { return m_pendingTree.get(); } | 156 LayerTreeImpl* pendingTree() { return m_pendingTree.get(); } |
156 const LayerTreeImpl* pendingTree() const { return m_pendingTree.get(); } | 157 const LayerTreeImpl* pendingTree() const { return m_pendingTree.get(); } |
157 void createPendingTree(); | 158 void createPendingTree(); |
158 void checkForCompletedSetPixels(); | 159 // returns true if newly completed pixels are visible and high resolution |
| 160 bool checkForCompletedSetPixels(); |
159 virtual void activatePendingTreeIfNeeded(); | 161 virtual void activatePendingTreeIfNeeded(); |
160 | 162 |
161 // Shortcuts to layers on the active tree. | 163 // Shortcuts to layers on the active tree. |
162 LayerImpl* rootLayer() const; | 164 LayerImpl* rootLayer() const; |
163 LayerImpl* rootScrollLayer() const; | 165 LayerImpl* rootScrollLayer() const; |
164 LayerImpl* currentlyScrollingLayer() const; | 166 LayerImpl* currentlyScrollingLayer() const; |
165 | 167 |
166 bool visible() const { return m_visible; } | 168 bool visible() const { return m_visible; } |
167 void setVisible(bool); | 169 void setVisible(bool); |
168 | 170 |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 size_t m_lastSentMemoryUseBytes; | 342 size_t m_lastSentMemoryUseBytes; |
341 | 343 |
342 scoped_ptr<AnimationRegistrar> m_animationRegistrar; | 344 scoped_ptr<AnimationRegistrar> m_animationRegistrar; |
343 | 345 |
344 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 346 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
345 }; | 347 }; |
346 | 348 |
347 } // namespace cc | 349 } // namespace cc |
348 | 350 |
349 #endif // CC_LAYER_TREE_HOST_IMPL_H_ | 351 #endif // CC_LAYER_TREE_HOST_IMPL_H_ |
OLD | NEW |