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 CCLayerTreeHost_h | 5 #ifndef CCLayerTreeHost_h |
| 6 #define CCLayerTreeHost_h | 6 #define CCLayerTreeHost_h |
| 7 | 7 |
| 8 #include <limits> | 8 #include <limits> |
| 9 | 9 |
| 10 #include "IntRect.h" | 10 #include "IntRect.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 47 class ResourceUpdateQueue; | 47 class ResourceUpdateQueue; |
| 48 class HeadsUpDisplayLayer; | 48 class HeadsUpDisplayLayer; |
| 49 class Region; | 49 class Region; |
| 50 struct ScrollAndScaleSet; | 50 struct ScrollAndScaleSet; |
| 51 | 51 |
| 52 struct LayerTreeSettings { | 52 struct LayerTreeSettings { |
| 53 LayerTreeSettings(); | 53 LayerTreeSettings(); |
| 54 ~LayerTreeSettings(); | 54 ~LayerTreeSettings(); |
| 55 | 55 |
| 56 bool acceleratePainting; | 56 bool acceleratePainting; |
| 57 bool showFPSCounter; | |
| 58 bool showPlatformLayerTree; | 57 bool showPlatformLayerTree; |
| 59 bool showPaintRects; | 58 bool showPaintRects; |
| 60 bool showPropertyChangedRects; | 59 bool showPropertyChangedRects; |
| 61 bool showSurfaceDamageRects; | 60 bool showSurfaceDamageRects; |
| 62 bool showScreenSpaceRects; | 61 bool showScreenSpaceRects; |
| 63 bool showReplicaScreenSpaceRects; | 62 bool showReplicaScreenSpaceRects; |
| 64 bool showOccludingRects; | 63 bool showOccludingRects; |
| 65 bool renderVSyncEnabled; | 64 bool renderVSyncEnabled; |
| 66 double refreshRate; | 65 double refreshRate; |
| 67 size_t maxPartialTextureUpdates; | 66 size_t maxPartialTextureUpdates; |
| 68 IntSize defaultTileSize; | 67 IntSize defaultTileSize; |
| 69 IntSize maxUntiledLayerSize; | 68 IntSize maxUntiledLayerSize; |
| 70 IntSize minimumOcclusionTrackingSize; | 69 IntSize minimumOcclusionTrackingSize; |
| 71 | 70 |
| 72 bool showDebugInfo() const { return showPlatformLayerTree || showFPSCounter || showDebugRects(); } | 71 bool showDebugInfo() const { return showPlatformLayerTree || showDebugRects( ); } |
|
egraether
2012/10/30 20:14:04
I reintroduced showDebugInfo as the --ui-show-laye
| |
| 73 bool showDebugRects() const { return showPaintRects || showPropertyChangedRe cts || showSurfaceDamageRects || showScreenSpaceRects || showReplicaScreenSpaceR ects || showOccludingRects; } | 72 bool showDebugRects() const { return showPaintRects || showPropertyChangedRe cts || showSurfaceDamageRects || showScreenSpaceRects || showReplicaScreenSpaceR ects || showOccludingRects; } |
| 74 }; | 73 }; |
| 75 | 74 |
| 76 // Provides information on an Impl's rendering capabilities back to the LayerTre eHost | 75 // Provides information on an Impl's rendering capabilities back to the LayerTre eHost |
| 77 struct RendererCapabilities { | 76 struct RendererCapabilities { |
| 78 RendererCapabilities(); | 77 RendererCapabilities(); |
| 79 ~RendererCapabilities(); | 78 ~RendererCapabilities(); |
| 80 | 79 |
| 81 GLenum bestTextureFormat; | 80 GLenum bestTextureFormat; |
| 82 bool contextHasCachedFrontBuffer; | 81 bool contextHasCachedFrontBuffer; |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 199 | 198 |
| 200 // RateLimitClient implementation | 199 // RateLimitClient implementation |
| 201 virtual void rateLimit() OVERRIDE; | 200 virtual void rateLimit() OVERRIDE; |
| 202 | 201 |
| 203 bool bufferedUpdates(); | 202 bool bufferedUpdates(); |
| 204 bool requestPartialTextureUpdate(); | 203 bool requestPartialTextureUpdate(); |
| 205 | 204 |
| 206 void setDeviceScaleFactor(float); | 205 void setDeviceScaleFactor(float); |
| 207 float deviceScaleFactor() const { return m_deviceScaleFactor; } | 206 float deviceScaleFactor() const { return m_deviceScaleFactor; } |
| 208 | 207 |
| 208 void setShowFPSCounter(bool show); | |
| 209 void setFontAtlas(scoped_ptr<FontAtlas>); | 209 void setFontAtlas(scoped_ptr<FontAtlas>); |
| 210 | 210 |
| 211 HeadsUpDisplayLayer* hudLayer() const { return m_hudLayer.get(); } | 211 HeadsUpDisplayLayer* hudLayer() const { return m_hudLayer.get(); } |
| 212 | 212 |
| 213 protected: | 213 protected: |
| 214 LayerTreeHost(LayerTreeHostClient*, const LayerTreeSettings&); | 214 LayerTreeHost(LayerTreeHostClient*, const LayerTreeSettings&); |
| 215 bool initialize(); | 215 bool initialize(); |
| 216 | 216 |
| 217 private: | 217 private: |
| 218 typedef std::vector<scoped_refptr<Layer> > LayerList; | 218 typedef std::vector<scoped_refptr<Layer> > LayerList; |
| 219 | 219 |
| 220 void initializeRenderer(); | 220 void initializeRenderer(); |
| 221 | 221 |
| 222 void update(Layer*, ResourceUpdateQueue&, const OcclusionTracker*); | 222 void update(Layer*, ResourceUpdateQueue&, const OcclusionTracker*); |
| 223 bool paintLayerContents(const LayerList&, ResourceUpdateQueue&); | 223 bool paintLayerContents(const LayerList&, ResourceUpdateQueue&); |
| 224 bool paintMasksForRenderSurface(Layer*, ResourceUpdateQueue&); | 224 bool paintMasksForRenderSurface(Layer*, ResourceUpdateQueue&); |
| 225 | 225 |
| 226 void updateLayers(Layer*, ResourceUpdateQueue&); | 226 void updateLayers(Layer*, ResourceUpdateQueue&); |
| 227 void triggerPrepaint(); | 227 void triggerPrepaint(); |
| 228 | 228 |
| 229 void prioritizeTextures(const LayerList&, OverdrawMetrics&); | 229 void prioritizeTextures(const LayerList&, OverdrawMetrics&); |
| 230 void setPrioritiesForSurfaces(size_t surfaceMemoryBytes); | 230 void setPrioritiesForSurfaces(size_t surfaceMemoryBytes); |
| 231 void setPrioritiesForLayers(const LayerList&); | 231 void setPrioritiesForLayers(const LayerList&); |
| 232 size_t calculateMemoryForRenderSurfaces(const LayerList& updateList); | 232 size_t calculateMemoryForRenderSurfaces(const LayerList& updateList); |
| 233 | 233 |
| 234 void animateLayers(base::TimeTicks monotonicTime); | 234 void animateLayers(base::TimeTicks monotonicTime); |
| 235 bool animateLayersRecursive(Layer* current, base::TimeTicks time); | 235 bool animateLayersRecursive(Layer* current, base::TimeTicks time); |
| 236 void setAnimationEventsRecursive(const AnimationEventsVector&, Layer*, base: :Time wallClockTime); | 236 void setAnimationEventsRecursive(const AnimationEventsVector&, Layer*, base: :Time wallClockTime); |
| 237 | 237 |
| 238 void createHUDLayerIfNeeded(); | |
| 239 | |
| 238 bool m_animating; | 240 bool m_animating; |
| 239 bool m_needsAnimateLayers; | 241 bool m_needsAnimateLayers; |
| 240 | 242 |
| 241 base::CancelableClosure m_prepaintCallback; | 243 base::CancelableClosure m_prepaintCallback; |
| 242 | 244 |
| 243 LayerTreeHostClient* m_client; | 245 LayerTreeHostClient* m_client; |
| 244 | 246 |
| 245 int m_commitNumber; | 247 int m_commitNumber; |
| 246 RenderingStats m_renderingStats; | 248 RenderingStats m_renderingStats; |
| 247 | 249 |
| 248 scoped_ptr<Proxy> m_proxy; | 250 scoped_ptr<Proxy> m_proxy; |
| 249 bool m_rendererInitialized; | 251 bool m_rendererInitialized; |
| 250 bool m_contextLost; | 252 bool m_contextLost; |
| 251 int m_numTimesRecreateShouldFail; | 253 int m_numTimesRecreateShouldFail; |
| 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 scoped_ptr<FontAtlas> m_fontAtlas; | |
| 257 | 258 |
| 258 scoped_ptr<PrioritizedTextureManager> m_contentsTextureManager; | 259 scoped_ptr<PrioritizedTextureManager> m_contentsTextureManager; |
| 259 scoped_ptr<PrioritizedTexture> m_surfaceMemoryPlaceholder; | 260 scoped_ptr<PrioritizedTexture> m_surfaceMemoryPlaceholder; |
| 260 | 261 |
| 261 LayerTreeSettings m_settings; | 262 LayerTreeSettings m_settings; |
| 262 | 263 |
| 263 IntSize m_layoutViewportSize; | 264 IntSize m_layoutViewportSize; |
| 264 IntSize m_deviceViewportSize; | 265 IntSize m_deviceViewportSize; |
| 265 float m_deviceScaleFactor; | 266 float m_deviceScaleFactor; |
| 266 | 267 |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 281 size_t m_partialTextureUpdateRequests; | 282 size_t m_partialTextureUpdateRequests; |
| 282 | 283 |
| 283 static bool s_needsFilterContext; | 284 static bool s_needsFilterContext; |
| 284 | 285 |
| 285 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); | 286 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); |
| 286 }; | 287 }; |
| 287 | 288 |
| 288 } // namespace cc | 289 } // namespace cc |
| 289 | 290 |
| 290 #endif | 291 #endif |
| OLD | NEW |