| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 | 62 |
| 63 unsigned bestTextureFormat; | 63 unsigned bestTextureFormat; |
| 64 bool usingPartialSwap; | 64 bool usingPartialSwap; |
| 65 bool usingAcceleratedPainting; | 65 bool usingAcceleratedPainting; |
| 66 bool usingSetVisibility; | 66 bool usingSetVisibility; |
| 67 bool usingSwapCompleteCallback; | 67 bool usingSwapCompleteCallback; |
| 68 bool usingGpuMemoryManager; | 68 bool usingGpuMemoryManager; |
| 69 bool usingDiscardBackbuffer; | 69 bool usingDiscardBackbuffer; |
| 70 bool usingEglImage; | 70 bool usingEglImage; |
| 71 bool allowPartialTextureUpdates; | 71 bool allowPartialTextureUpdates; |
| 72 bool usingOffscreenContext3d; |
| 72 int maxTextureSize; | 73 int maxTextureSize; |
| 73 bool avoidPow2Textures; | 74 bool avoidPow2Textures; |
| 74 }; | 75 }; |
| 75 | 76 |
| 76 class CC_EXPORT LayerTreeHost : public RateLimiterClient { | 77 class CC_EXPORT LayerTreeHost : public RateLimiterClient { |
| 77 public: | 78 public: |
| 78 static scoped_ptr<LayerTreeHost> create(LayerTreeHostClient*, const LayerTre
eSettings&, scoped_ptr<Thread> implThread); | 79 static scoped_ptr<LayerTreeHost> create(LayerTreeHostClient*, const LayerTre
eSettings&, scoped_ptr<Thread> implThread); |
| 79 virtual ~LayerTreeHost(); | 80 virtual ~LayerTreeHost(); |
| 80 | 81 |
| 81 void setSurfaceReady(); | 82 void setSurfaceReady(); |
| 82 | 83 |
| 83 // Returns true if any LayerTreeHost is alive. | 84 // Returns true if any LayerTreeHost is alive. |
| 84 static bool anyLayerTreeHostInstanceExists(); | 85 static bool anyLayerTreeHostInstanceExists(); |
| 85 | 86 |
| 86 static bool needsFilterContext() { return s_needsFilterContext; } | 87 void setNeedsFilterContext() { m_needsFilterContext = true; } |
| 87 static void setNeedsFilterContext(bool needsFilterContext) { s_needsFilterCo
ntext = needsFilterContext; } | 88 bool needsOffscreenContext() const { return m_needsFilterContext || settings
().acceleratePainting; } |
| 88 bool needsSharedContext() const { return needsFilterContext() || settings().
acceleratePainting; } | |
| 89 | 89 |
| 90 // LayerTreeHost interface to Proxy. | 90 // LayerTreeHost interface to Proxy. |
| 91 void willBeginFrame() { m_client->willBeginFrame(); } | 91 void willBeginFrame() { m_client->willBeginFrame(); } |
| 92 void didBeginFrame(); | 92 void didBeginFrame(); |
| 93 void updateAnimations(base::TimeTicks monotonicFrameBeginTime); | 93 void updateAnimations(base::TimeTicks monotonicFrameBeginTime); |
| 94 void didStopFlinging(); | 94 void didStopFlinging(); |
| 95 void layout(); | 95 void layout(); |
| 96 void beginCommitOnImplThread(LayerTreeHostImpl*); | 96 void beginCommitOnImplThread(LayerTreeHostImpl*); |
| 97 void finishCommitOnImplThread(LayerTreeHostImpl*); | 97 void finishCommitOnImplThread(LayerTreeHostImpl*); |
| 98 void willCommit(); | 98 void willCommit(); |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 void setPrioritiesForSurfaces(size_t surfaceMemoryBytes); | 226 void setPrioritiesForSurfaces(size_t surfaceMemoryBytes); |
| 227 void setPrioritiesForLayers(const LayerList&); | 227 void setPrioritiesForLayers(const LayerList&); |
| 228 size_t calculateMemoryForRenderSurfaces(const LayerList& updateList); | 228 size_t calculateMemoryForRenderSurfaces(const LayerList& updateList); |
| 229 | 229 |
| 230 void animateLayers(base::TimeTicks monotonicTime); | 230 void animateLayers(base::TimeTicks monotonicTime); |
| 231 bool animateLayersRecursive(Layer* current, base::TimeTicks time); | 231 bool animateLayersRecursive(Layer* current, base::TimeTicks time); |
| 232 void setAnimationEventsRecursive(const AnimationEventsVector&, Layer*, base:
:Time wallClockTime); | 232 void setAnimationEventsRecursive(const AnimationEventsVector&, Layer*, base:
:Time wallClockTime); |
| 233 | 233 |
| 234 bool m_animating; | 234 bool m_animating; |
| 235 bool m_needsFullTreeSync; | 235 bool m_needsFullTreeSync; |
| 236 bool m_needsFilterContext; |
| 236 | 237 |
| 237 base::CancelableClosure m_prepaintCallback; | 238 base::CancelableClosure m_prepaintCallback; |
| 238 | 239 |
| 239 LayerTreeHostClient* m_client; | 240 LayerTreeHostClient* m_client; |
| 240 scoped_ptr<Proxy> m_proxy; | 241 scoped_ptr<Proxy> m_proxy; |
| 241 | 242 |
| 242 int m_commitNumber; | 243 int m_commitNumber; |
| 243 RenderingStats m_renderingStats; | 244 RenderingStats m_renderingStats; |
| 244 | 245 |
| 245 bool m_rendererInitialized; | 246 bool m_rendererInitialized; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 270 bool m_triggerIdleUpdates; | 271 bool m_triggerIdleUpdates; |
| 271 | 272 |
| 272 SkColor m_backgroundColor; | 273 SkColor m_backgroundColor; |
| 273 bool m_hasTransparentBackground; | 274 bool m_hasTransparentBackground; |
| 274 | 275 |
| 275 typedef ScopedPtrVector<PrioritizedResource> TextureList; | 276 typedef ScopedPtrVector<PrioritizedResource> TextureList; |
| 276 size_t m_partialTextureUpdateRequests; | 277 size_t m_partialTextureUpdateRequests; |
| 277 | 278 |
| 278 scoped_ptr<AnimationRegistrar> m_animationRegistrar; | 279 scoped_ptr<AnimationRegistrar> m_animationRegistrar; |
| 279 | 280 |
| 280 static bool s_needsFilterContext; | |
| 281 | |
| 282 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); | 281 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); |
| 283 }; | 282 }; |
| 284 | 283 |
| 285 } // namespace cc | 284 } // namespace cc |
| 286 | 285 |
| 287 #endif // CC_LAYER_TREE_HOST_H_ | 286 #endif // CC_LAYER_TREE_HOST_H_ |
| OLD | NEW |