Chromium Code Reviews| 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" |
| 11 #include "base/cancelable_callback.h" | 11 #include "base/cancelable_callback.h" |
| 12 #include "base/hash_tables.h" | 12 #include "base/hash_tables.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "base/time.h" | 16 #include "base/time.h" |
| 17 #include "cc/animation_events.h" | 17 #include "cc/animation_events.h" |
| 18 #include "cc/cc_export.h" | 18 #include "cc/cc_export.h" |
| 19 #include "cc/layer_tree_host_client.h" | 19 #include "cc/layer_tree_host_client.h" |
| 20 #include "cc/layer_tree_host_common.h" | 20 #include "cc/layer_tree_host_common.h" |
| 21 #include "cc/layer_tree_settings.h" | 21 #include "cc/layer_tree_settings.h" |
| 22 #include "cc/occlusion_tracker.h" | 22 #include "cc/occlusion_tracker.h" |
| 23 #include "cc/output_surface.h" | 23 #include "cc/output_surface.h" |
| 24 #include "cc/proxy.h" | 24 #include "cc/proxy.h" |
| 25 #include "cc/rate_limiter.h" | 25 #include "cc/rate_limiter.h" |
| 26 #include "cc/rendering_stats.h" | 26 #include "cc/rendering_stats.h" |
| 27 #include "cc/rendering_stats_recorder.h" | |
|
danakj
2013/03/13 17:25:41
forward declare the class here, include the .h fro
egraether
2013/03/14 18:58:07
Done.
| |
| 27 #include "cc/scoped_ptr_vector.h" | 28 #include "cc/scoped_ptr_vector.h" |
| 28 #include "skia/ext/refptr.h" | 29 #include "skia/ext/refptr.h" |
| 29 #include "third_party/skia/include/core/SkColor.h" | 30 #include "third_party/skia/include/core/SkColor.h" |
| 30 #include "third_party/skia/include/core/SkPicture.h" | 31 #include "third_party/skia/include/core/SkPicture.h" |
| 31 #include "ui/gfx/rect.h" | 32 #include "ui/gfx/rect.h" |
| 32 | 33 |
| 33 #if defined(COMPILER_GCC) | 34 #if defined(COMPILER_GCC) |
| 34 namespace BASE_HASH_NAMESPACE { | 35 namespace BASE_HASH_NAMESPACE { |
| 35 template<> | 36 template<> |
| 36 struct hash<WebKit::WebGraphicsContext3D*> { | 37 struct hash<WebKit::WebGraphicsContext3D*> { |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 131 void finishAllRendering(); | 132 void finishAllRendering(); |
| 132 | 133 |
| 133 void setDeferCommits(bool deferCommits); | 134 void setDeferCommits(bool deferCommits); |
| 134 | 135 |
| 135 // Test only hook | 136 // Test only hook |
| 136 virtual void didDeferCommit(); | 137 virtual void didDeferCommit(); |
| 137 | 138 |
| 138 int commitNumber() const { return m_commitNumber; } | 139 int commitNumber() const { return m_commitNumber; } |
| 139 | 140 |
| 140 void renderingStats(RenderingStats*) const; | 141 void renderingStats(RenderingStats*) const; |
| 142 RenderingStatsRecorder* renderingStatsRecorder() const; | |
| 141 | 143 |
| 142 const RendererCapabilities& rendererCapabilities() const; | 144 const RendererCapabilities& rendererCapabilities() const; |
| 143 | 145 |
| 144 void setNeedsAnimate(); | 146 void setNeedsAnimate(); |
| 145 // virtual for testing | 147 // virtual for testing |
| 146 virtual void setNeedsCommit(); | 148 virtual void setNeedsCommit(); |
| 147 virtual void setNeedsFullTreeSync(); | 149 virtual void setNeedsFullTreeSync(); |
| 148 void setNeedsRedraw(); | 150 void setNeedsRedraw(); |
| 149 bool commitRequested() const; | 151 bool commitRequested() const; |
| 150 | 152 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 213 bool initializeForTesting(scoped_ptr<Proxy> proxyForTesting); | 215 bool initializeForTesting(scoped_ptr<Proxy> proxyForTesting); |
| 214 | 216 |
| 215 private: | 217 private: |
| 216 typedef std::vector<scoped_refptr<Layer> > LayerList; | 218 typedef std::vector<scoped_refptr<Layer> > LayerList; |
| 217 | 219 |
| 218 bool initializeProxy(scoped_ptr<Proxy> proxy); | 220 bool initializeProxy(scoped_ptr<Proxy> proxy); |
| 219 void initializeRenderer(); | 221 void initializeRenderer(); |
| 220 | 222 |
| 221 void update(Layer*, ResourceUpdateQueue&, const OcclusionTracker*); | 223 void update(Layer*, ResourceUpdateQueue&, const OcclusionTracker*); |
| 222 bool paintLayerContents(const LayerList&, ResourceUpdateQueue&); | 224 bool paintLayerContents(const LayerList&, ResourceUpdateQueue&); |
| 223 bool paintMasksForRenderSurface(Layer*, ResourceUpdateQueue&); | 225 bool paintMasksForRenderSurface(Layer*, ResourceUpdateQueue&, RenderingStats *); |
| 224 | 226 |
| 225 void updateLayers(Layer*, ResourceUpdateQueue&); | 227 void updateLayers(Layer*, ResourceUpdateQueue&); |
| 226 void updateHudLayer(); | 228 void updateHudLayer(); |
| 227 void triggerPrepaint(); | 229 void triggerPrepaint(); |
| 228 | 230 |
| 229 void prioritizeTextures(const LayerList&, OverdrawMetrics&); | 231 void prioritizeTextures(const LayerList&, OverdrawMetrics&); |
| 230 void setPrioritiesForSurfaces(size_t surfaceMemoryBytes); | 232 void setPrioritiesForSurfaces(size_t surfaceMemoryBytes); |
| 231 void setPrioritiesForLayers(const LayerList&); | 233 void setPrioritiesForLayers(const LayerList&); |
| 232 size_t calculateMemoryForRenderSurfaces(const LayerList& updateList); | 234 size_t calculateMemoryForRenderSurfaces(const LayerList& updateList); |
| 233 | 235 |
| 234 void animateLayers(base::TimeTicks monotonicTime); | 236 void animateLayers(base::TimeTicks monotonicTime); |
| 235 bool animateLayersRecursive(Layer* current, base::TimeTicks time); | 237 bool animateLayersRecursive(Layer* current, base::TimeTicks time); |
| 236 void setAnimationEventsRecursive(const AnimationEventsVector&, Layer*, base: :Time wallClockTime); | 238 void setAnimationEventsRecursive(const AnimationEventsVector&, Layer*, base: :Time wallClockTime); |
| 237 | 239 |
| 238 bool m_animating; | 240 bool m_animating; |
| 239 bool m_needsFullTreeSync; | 241 bool m_needsFullTreeSync; |
| 240 bool m_needsFilterContext; | 242 bool m_needsFilterContext; |
| 241 | 243 |
| 242 base::CancelableClosure m_prepaintCallback; | 244 base::CancelableClosure m_prepaintCallback; |
| 243 | 245 |
| 244 LayerTreeHostClient* m_client; | 246 LayerTreeHostClient* m_client; |
| 245 scoped_ptr<Proxy> m_proxy; | 247 scoped_ptr<Proxy> m_proxy; |
| 246 | 248 |
| 247 int m_commitNumber; | 249 int m_commitNumber; |
| 248 RenderingStats m_renderingStats; | 250 scoped_ptr<RenderingStatsRecorder> m_renderingStatsRecorder; |
| 249 | 251 |
| 250 bool m_rendererInitialized; | 252 bool m_rendererInitialized; |
| 251 bool m_outputSurfaceLost; | 253 bool m_outputSurfaceLost; |
| 252 int m_numFailedRecreateAttempts; | 254 int m_numFailedRecreateAttempts; |
| 253 | 255 |
| 254 scoped_refptr<Layer> m_rootLayer; | 256 scoped_refptr<Layer> m_rootLayer; |
| 255 scoped_refptr<HeadsUpDisplayLayer> m_hudLayer; | 257 scoped_refptr<HeadsUpDisplayLayer> m_hudLayer; |
| 256 | 258 |
| 257 scoped_ptr<PrioritizedResourceManager> m_contentsTextureManager; | 259 scoped_ptr<PrioritizedResourceManager> m_contentsTextureManager; |
| 258 scoped_ptr<PrioritizedResource> m_surfaceMemoryPlaceholder; | 260 scoped_ptr<PrioritizedResource> m_surfaceMemoryPlaceholder; |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 283 size_t m_partialTextureUpdateRequests; | 285 size_t m_partialTextureUpdateRequests; |
| 284 | 286 |
| 285 scoped_ptr<AnimationRegistrar> m_animationRegistrar; | 287 scoped_ptr<AnimationRegistrar> m_animationRegistrar; |
| 286 | 288 |
| 287 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); | 289 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); |
| 288 }; | 290 }; |
| 289 | 291 |
| 290 } // namespace cc | 292 } // namespace cc |
| 291 | 293 |
| 292 #endif // CC_LAYER_TREE_HOST_H_ | 294 #endif // CC_LAYER_TREE_HOST_H_ |
| OLD | NEW |