| 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 }; | 74 }; |
| 74 | 75 |
| 75 class CC_EXPORT LayerTreeHost : public RateLimiterClient { | 76 class CC_EXPORT LayerTreeHost : public RateLimiterClient { |
| 76 public: | 77 public: |
| 77 static scoped_ptr<LayerTreeHost> create(LayerTreeHostClient*, const LayerTre
eSettings&, scoped_ptr<Thread> implThread); | 78 static scoped_ptr<LayerTreeHost> create(LayerTreeHostClient*, const LayerTre
eSettings&, scoped_ptr<Thread> implThread); |
| 78 virtual ~LayerTreeHost(); | 79 virtual ~LayerTreeHost(); |
| 79 | 80 |
| 80 void setSurfaceReady(); | 81 void setSurfaceReady(); |
| 81 | 82 |
| 82 // Returns true if any LayerTreeHost is alive. | 83 // Returns true if any LayerTreeHost is alive. |
| 83 static bool anyLayerTreeHostInstanceExists(); | 84 static bool anyLayerTreeHostInstanceExists(); |
| 84 | 85 |
| 85 static bool needsFilterContext() { return s_needsFilterContext; } | 86 void setNeedsFilterContext() { m_needsFilterContext = true; } |
| 86 static void setNeedsFilterContext(bool needsFilterContext) { s_needsFilterCo
ntext = needsFilterContext; } | 87 bool needsOffscreenContext() const { return m_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); |
| 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(); |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 void setPrioritiesForSurfaces(size_t surfaceMemoryBytes); | 222 void setPrioritiesForSurfaces(size_t surfaceMemoryBytes); |
| 223 void setPrioritiesForLayers(const LayerList&); | 223 void setPrioritiesForLayers(const LayerList&); |
| 224 size_t calculateMemoryForRenderSurfaces(const LayerList& updateList); | 224 size_t calculateMemoryForRenderSurfaces(const LayerList& updateList); |
| 225 | 225 |
| 226 void animateLayers(base::TimeTicks monotonicTime); | 226 void animateLayers(base::TimeTicks monotonicTime); |
| 227 bool animateLayersRecursive(Layer* current, base::TimeTicks time); | 227 bool animateLayersRecursive(Layer* current, base::TimeTicks time); |
| 228 void setAnimationEventsRecursive(const AnimationEventsVector&, Layer*, base:
:Time wallClockTime); | 228 void setAnimationEventsRecursive(const AnimationEventsVector&, Layer*, base:
:Time wallClockTime); |
| 229 | 229 |
| 230 bool m_animating; | 230 bool m_animating; |
| 231 bool m_needsFullTreeSync; | 231 bool m_needsFullTreeSync; |
| 232 bool m_needsFilterContext; |
| 232 | 233 |
| 233 base::CancelableClosure m_prepaintCallback; | 234 base::CancelableClosure m_prepaintCallback; |
| 234 | 235 |
| 235 LayerTreeHostClient* m_client; | 236 LayerTreeHostClient* m_client; |
| 236 scoped_ptr<Proxy> m_proxy; | 237 scoped_ptr<Proxy> m_proxy; |
| 237 | 238 |
| 238 int m_commitNumber; | 239 int m_commitNumber; |
| 239 RenderingStats m_renderingStats; | 240 RenderingStats m_renderingStats; |
| 240 | 241 |
| 241 bool m_rendererInitialized; | 242 bool m_rendererInitialized; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 266 bool m_triggerIdleUpdates; | 267 bool m_triggerIdleUpdates; |
| 267 | 268 |
| 268 SkColor m_backgroundColor; | 269 SkColor m_backgroundColor; |
| 269 bool m_hasTransparentBackground; | 270 bool m_hasTransparentBackground; |
| 270 | 271 |
| 271 typedef ScopedPtrVector<PrioritizedResource> TextureList; | 272 typedef ScopedPtrVector<PrioritizedResource> TextureList; |
| 272 size_t m_partialTextureUpdateRequests; | 273 size_t m_partialTextureUpdateRequests; |
| 273 | 274 |
| 274 scoped_ptr<AnimationRegistrar> m_animationRegistrar; | 275 scoped_ptr<AnimationRegistrar> m_animationRegistrar; |
| 275 | 276 |
| 276 static bool s_needsFilterContext; | |
| 277 | |
| 278 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); | 277 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); |
| 279 }; | 278 }; |
| 280 | 279 |
| 281 } // namespace cc | 280 } // namespace cc |
| 282 | 281 |
| 283 #endif // CC_LAYER_TREE_HOST_H_ | 282 #endif // CC_LAYER_TREE_HOST_H_ |
| OLD | NEW |