| 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 22 matching lines...) Expand all Loading... |
| 33 struct hash<WebKit::WebGraphicsContext3D*> { | 33 struct hash<WebKit::WebGraphicsContext3D*> { |
| 34 size_t operator()(WebKit::WebGraphicsContext3D* ptr) const { | 34 size_t operator()(WebKit::WebGraphicsContext3D* ptr) const { |
| 35 return hash<size_t>()(reinterpret_cast<size_t>(ptr)); | 35 return hash<size_t>()(reinterpret_cast<size_t>(ptr)); |
| 36 } | 36 } |
| 37 }; | 37 }; |
| 38 } // namespace BASE_HASH_NAMESPACE | 38 } // namespace BASE_HASH_NAMESPACE |
| 39 #endif // COMPILER | 39 #endif // COMPILER |
| 40 | 40 |
| 41 namespace cc { | 41 namespace cc { |
| 42 | 42 |
| 43 class FontAtlas; | |
| 44 class Layer; | 43 class Layer; |
| 45 class LayerTreeHostImpl; | 44 class LayerTreeHostImpl; |
| 46 class LayerTreeHostImplClient; | 45 class LayerTreeHostImplClient; |
| 47 class PrioritizedResourceManager; | 46 class PrioritizedResourceManager; |
| 48 class ResourceUpdateQueue; | 47 class ResourceUpdateQueue; |
| 49 class HeadsUpDisplayLayer; | 48 class HeadsUpDisplayLayer; |
| 50 class Region; | 49 class Region; |
| 51 struct ScrollAndScaleSet; | 50 struct ScrollAndScaleSet; |
| 52 | 51 |
| 53 struct CC_EXPORT LayerTreeDebugState { | 52 struct CC_EXPORT LayerTreeDebugState { |
| 54 LayerTreeDebugState(); | 53 LayerTreeDebugState(); |
| 55 ~LayerTreeDebugState(); | 54 ~LayerTreeDebugState(); |
| 56 | 55 |
| 57 bool showFPSCounter; | 56 bool showFPSCounter; |
| 58 bool showPlatformLayerTree; | 57 bool showPlatformLayerTree; |
| 59 bool showDebugBorders; | 58 bool showDebugBorders; |
| 60 | 59 |
| 61 bool showPaintRects; | 60 bool showPaintRects; |
| 62 bool showPropertyChangedRects; | 61 bool showPropertyChangedRects; |
| 63 bool showSurfaceDamageRects; | 62 bool showSurfaceDamageRects; |
| 64 bool showScreenSpaceRects; | 63 bool showScreenSpaceRects; |
| 65 bool showReplicaScreenSpaceRects; | 64 bool showReplicaScreenSpaceRects; |
| 66 bool showOccludingRects; | 65 bool showOccludingRects; |
| 67 bool showNonOccludingRects; | 66 bool showNonOccludingRects; |
| 68 | 67 |
| 69 bool showHudInfo() const; | 68 bool showHudInfo() const; |
| 70 bool showHudRects() const; | 69 bool showHudRects() const; |
| 70 bool hudNeedsFont() const; |
| 71 | 71 |
| 72 static bool equal(const LayerTreeDebugState& a, const LayerTreeDebugState& b
); | 72 static bool equal(const LayerTreeDebugState& a, const LayerTreeDebugState& b
); |
| 73 static LayerTreeDebugState unite(const LayerTreeDebugState& a, const LayerTr
eeDebugState& b); | 73 static LayerTreeDebugState unite(const LayerTreeDebugState& a, const LayerTr
eeDebugState& b); |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 struct CC_EXPORT LayerTreeSettings { | 76 struct CC_EXPORT LayerTreeSettings { |
| 77 LayerTreeSettings(); | 77 LayerTreeSettings(); |
| 78 ~LayerTreeSettings(); | 78 ~LayerTreeSettings(); |
| 79 | 79 |
| 80 bool acceleratePainting; | 80 bool acceleratePainting; |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 | 230 |
| 231 // RateLimitClient implementation | 231 // RateLimitClient implementation |
| 232 virtual void rateLimit() OVERRIDE; | 232 virtual void rateLimit() OVERRIDE; |
| 233 | 233 |
| 234 bool bufferedUpdates(); | 234 bool bufferedUpdates(); |
| 235 bool requestPartialTextureUpdate(); | 235 bool requestPartialTextureUpdate(); |
| 236 | 236 |
| 237 void setDeviceScaleFactor(float); | 237 void setDeviceScaleFactor(float); |
| 238 float deviceScaleFactor() const { return m_deviceScaleFactor; } | 238 float deviceScaleFactor() const { return m_deviceScaleFactor; } |
| 239 | 239 |
| 240 void setFontAtlas(scoped_ptr<FontAtlas>); | |
| 241 | |
| 242 HeadsUpDisplayLayer* hudLayer() const { return m_hudLayer.get(); } | 240 HeadsUpDisplayLayer* hudLayer() const { return m_hudLayer.get(); } |
| 243 | 241 |
| 244 Proxy* proxy() const { return m_proxy.get(); } | 242 Proxy* proxy() const { return m_proxy.get(); } |
| 245 | 243 |
| 246 protected: | 244 protected: |
| 247 LayerTreeHost(LayerTreeHostClient*, const LayerTreeSettings&); | 245 LayerTreeHost(LayerTreeHostClient*, const LayerTreeSettings&); |
| 248 bool initialize(scoped_ptr<Thread> implThread); | 246 bool initialize(scoped_ptr<Thread> implThread); |
| 249 | 247 |
| 250 private: | 248 private: |
| 251 typedef std::vector<scoped_refptr<Layer> > LayerList; | 249 typedef std::vector<scoped_refptr<Layer> > LayerList; |
| 252 | 250 |
| 253 void initializeRenderer(); | 251 void initializeRenderer(); |
| 254 | 252 |
| 255 void update(Layer*, ResourceUpdateQueue&, const OcclusionTracker*); | 253 void update(Layer*, ResourceUpdateQueue&, const OcclusionTracker*); |
| 256 bool paintLayerContents(const LayerList&, ResourceUpdateQueue&); | 254 bool paintLayerContents(const LayerList&, ResourceUpdateQueue&); |
| 257 bool paintMasksForRenderSurface(Layer*, ResourceUpdateQueue&); | 255 bool paintMasksForRenderSurface(Layer*, ResourceUpdateQueue&); |
| 258 | 256 |
| 259 void updateLayers(Layer*, ResourceUpdateQueue&); | 257 void updateLayers(Layer*, ResourceUpdateQueue&); |
| 260 void triggerPrepaint(); | 258 void triggerPrepaint(); |
| 261 | 259 |
| 262 void prioritizeTextures(const LayerList&, OverdrawMetrics&); | 260 void prioritizeTextures(const LayerList&, OverdrawMetrics&); |
| 263 void setPrioritiesForSurfaces(size_t surfaceMemoryBytes); | 261 void setPrioritiesForSurfaces(size_t surfaceMemoryBytes); |
| 264 void setPrioritiesForLayers(const LayerList&); | 262 void setPrioritiesForLayers(const LayerList&); |
| 265 size_t calculateMemoryForRenderSurfaces(const LayerList& updateList); | 263 size_t calculateMemoryForRenderSurfaces(const LayerList& updateList); |
| 266 | 264 |
| 267 void animateLayers(base::TimeTicks monotonicTime); | 265 void animateLayers(base::TimeTicks monotonicTime); |
| 268 bool animateLayersRecursive(Layer* current, base::TimeTicks time); | 266 bool animateLayersRecursive(Layer* current, base::TimeTicks time); |
| 269 void setAnimationEventsRecursive(const AnimationEventsVector&, Layer*, base:
:Time wallClockTime); | 267 void setAnimationEventsRecursive(const AnimationEventsVector&, Layer*, base:
:Time wallClockTime); |
| 270 | 268 |
| 271 void createHUDLayerIfNeeded(); | |
| 272 | |
| 273 bool m_animating; | 269 bool m_animating; |
| 274 bool m_needsAnimateLayers; | 270 bool m_needsAnimateLayers; |
| 275 | 271 |
| 276 base::CancelableClosure m_prepaintCallback; | 272 base::CancelableClosure m_prepaintCallback; |
| 277 | 273 |
| 278 LayerTreeHostClient* m_client; | 274 LayerTreeHostClient* m_client; |
| 279 scoped_ptr<Proxy> m_proxy; | 275 scoped_ptr<Proxy> m_proxy; |
| 280 | 276 |
| 281 int m_commitNumber; | 277 int m_commitNumber; |
| 282 RenderingStats m_renderingStats; | 278 RenderingStats m_renderingStats; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 size_t m_partialTextureUpdateRequests; | 312 size_t m_partialTextureUpdateRequests; |
| 317 | 313 |
| 318 static bool s_needsFilterContext; | 314 static bool s_needsFilterContext; |
| 319 | 315 |
| 320 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); | 316 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); |
| 321 }; | 317 }; |
| 322 | 318 |
| 323 } // namespace cc | 319 } // namespace cc |
| 324 | 320 |
| 325 #endif // CC_LAYER_TREE_HOST_H_ | 321 #endif // CC_LAYER_TREE_HOST_H_ |
| OLD | NEW |