| 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_H_ | 5 #ifndef CC_LAYER_TREE_HOST_H_ |
| 6 #define CC_LAYER_TREE_HOST_H_ | 6 #define CC_LAYER_TREE_HOST_H_ |
| 7 | 7 |
| 8 #include <limits> | 8 #include <limits> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 // Returns true if any LayerTreeHost is alive. | 82 // Returns true if any LayerTreeHost is alive. |
| 83 static bool anyLayerTreeHostInstanceExists(); | 83 static bool anyLayerTreeHostInstanceExists(); |
| 84 | 84 |
| 85 static bool needsFilterContext() { return s_needsFilterContext; } | 85 static bool needsFilterContext() { return s_needsFilterContext; } |
| 86 static void setNeedsFilterContext(bool needsFilterContext) { s_needsFilterCo
ntext = needsFilterContext; } | 86 static void setNeedsFilterContext(bool needsFilterContext) { s_needsFilterCo
ntext = needsFilterContext; } |
| 87 bool needsSharedContext() const { return needsFilterContext() || settings().
acceleratePainting; } | 87 bool needsSharedContext() const { return needsFilterContext() || settings().
acceleratePainting; } |
| 88 | 88 |
| 89 // LayerTreeHost interface to Proxy. | 89 // LayerTreeHost interface to Proxy. |
| 90 void willBeginFrame() { m_client->willBeginFrame(); } | 90 void willBeginFrame() { m_client->willBeginFrame(); } |
| 91 void didBeginFrame(); | 91 void didBeginFrame(); |
| 92 void updateAnimations(base::TimeTicks monotonicFrameBeginTime); | 92 void updateAnimations(base::TimeTicks monotonicFrameBeginTime, base::Time wa
llClockFrameBeginTime); |
| 93 void didStopFlinging(); | 93 void didStopFlinging(); |
| 94 void layout(); | 94 void layout(); |
| 95 void beginCommitOnImplThread(LayerTreeHostImpl*); | 95 void beginCommitOnImplThread(LayerTreeHostImpl*); |
| 96 void finishCommitOnImplThread(LayerTreeHostImpl*); | 96 void finishCommitOnImplThread(LayerTreeHostImpl*); |
| 97 void willCommit(); | 97 void willCommit(); |
| 98 void commitComplete(); | 98 void commitComplete(); |
| 99 scoped_ptr<OutputSurface> createOutputSurface(); | 99 scoped_ptr<OutputSurface> createOutputSurface(); |
| 100 scoped_ptr<InputHandler> createInputHandler(); | 100 scoped_ptr<InputHandler> createInputHandler(); |
| 101 virtual scoped_ptr<LayerTreeHostImpl> createLayerTreeHostImpl(LayerTreeHostI
mplClient*); | 101 virtual scoped_ptr<LayerTreeHostImpl> createLayerTreeHostImpl(LayerTreeHostI
mplClient*); |
| 102 void didLoseOutputSurface(); | 102 void didLoseOutputSurface(); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 HeadsUpDisplayLayer* hudLayer() const { return m_hudLayer.get(); } | 193 HeadsUpDisplayLayer* hudLayer() const { return m_hudLayer.get(); } |
| 194 | 194 |
| 195 Proxy* proxy() const { return m_proxy.get(); } | 195 Proxy* proxy() const { return m_proxy.get(); } |
| 196 | 196 |
| 197 AnimationRegistrar* animationRegistrar() const { return m_animationRegistrar
.get(); } | 197 AnimationRegistrar* animationRegistrar() const { return m_animationRegistrar
.get(); } |
| 198 | 198 |
| 199 skia::RefPtr<SkPicture> capturePicture(); | 199 skia::RefPtr<SkPicture> capturePicture(); |
| 200 | 200 |
| 201 bool blocksPendingCommit() const; | 201 bool blocksPendingCommit() const; |
| 202 | 202 |
| 203 void didUpdateLayout(); |
| 204 |
| 203 protected: | 205 protected: |
| 204 LayerTreeHost(LayerTreeHostClient*, const LayerTreeSettings&); | 206 LayerTreeHost(LayerTreeHostClient*, const LayerTreeSettings&); |
| 205 bool initialize(scoped_ptr<Thread> implThread); | 207 bool initialize(scoped_ptr<Thread> implThread); |
| 206 bool initializeForTesting(scoped_ptr<Proxy> proxyForTesting); | 208 bool initializeForTesting(scoped_ptr<Proxy> proxyForTesting); |
| 207 | 209 |
| 208 private: | 210 private: |
| 209 typedef std::vector<scoped_refptr<Layer> > LayerList; | 211 typedef std::vector<scoped_refptr<Layer> > LayerList; |
| 210 | 212 |
| 211 bool initializeProxy(scoped_ptr<Proxy> proxy); | 213 bool initializeProxy(scoped_ptr<Proxy> proxy); |
| 212 void initializeRenderer(); | 214 void initializeRenderer(); |
| 213 | 215 |
| 214 void update(Layer*, ResourceUpdateQueue&, const OcclusionTracker*); | 216 void update(Layer*, ResourceUpdateQueue&, const OcclusionTracker*); |
| 215 bool paintLayerContents(const LayerList&, ResourceUpdateQueue&); | 217 bool paintLayerContents(const LayerList&, ResourceUpdateQueue&); |
| 216 bool paintMasksForRenderSurface(Layer*, ResourceUpdateQueue&); | 218 bool paintMasksForRenderSurface(Layer*, ResourceUpdateQueue&); |
| 217 | 219 |
| 218 void updateLayers(Layer*, ResourceUpdateQueue&); | 220 void updateLayers(Layer*, ResourceUpdateQueue&); |
| 219 void triggerPrepaint(); | 221 void triggerPrepaint(); |
| 220 | 222 |
| 221 void prioritizeTextures(const LayerList&, OverdrawMetrics&); | 223 void prioritizeTextures(const LayerList&, OverdrawMetrics&); |
| 222 void setPrioritiesForSurfaces(size_t surfaceMemoryBytes); | 224 void setPrioritiesForSurfaces(size_t surfaceMemoryBytes); |
| 223 void setPrioritiesForLayers(const LayerList&); | 225 void setPrioritiesForLayers(const LayerList&); |
| 224 size_t calculateMemoryForRenderSurfaces(const LayerList& updateList); | 226 size_t calculateMemoryForRenderSurfaces(const LayerList& updateList); |
| 225 | 227 |
| 226 void animateLayers(base::TimeTicks monotonicTime); | 228 void animateLayers(base::TimeTicks monotonicTime, base::Time wallClockTime); |
| 227 bool animateLayersRecursive(Layer* current, base::TimeTicks time); | 229 bool animateLayersRecursive(Layer* current, base::TimeTicks time); |
| 228 void setAnimationEventsRecursive(const AnimationEventsVector&, Layer*, base:
:Time wallClockTime); | 230 void setAnimationEventsRecursive(const AnimationEventsVector&, Layer*, base:
:Time wallClockTime); |
| 229 | 231 |
| 230 bool m_animating; | 232 bool m_animating; |
| 231 bool m_needsFullTreeSync; | 233 bool m_needsFullTreeSync; |
| 232 | 234 |
| 233 base::CancelableClosure m_prepaintCallback; | 235 base::CancelableClosure m_prepaintCallback; |
| 234 | 236 |
| 235 LayerTreeHostClient* m_client; | 237 LayerTreeHostClient* m_client; |
| 236 scoped_ptr<Proxy> m_proxy; | 238 scoped_ptr<Proxy> m_proxy; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 scoped_ptr<AnimationRegistrar> m_animationRegistrar; | 276 scoped_ptr<AnimationRegistrar> m_animationRegistrar; |
| 275 | 277 |
| 276 static bool s_needsFilterContext; | 278 static bool s_needsFilterContext; |
| 277 | 279 |
| 278 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); | 280 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); |
| 279 }; | 281 }; |
| 280 | 282 |
| 281 } // namespace cc | 283 } // namespace cc |
| 282 | 284 |
| 283 #endif // CC_LAYER_TREE_HOST_H_ | 285 #endif // CC_LAYER_TREE_HOST_H_ |
| OLD | NEW |