| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 class FontAtlas; | 43 class FontAtlas; |
| 44 class Layer; | 44 class Layer; |
| 45 class LayerTreeHostImpl; | 45 class LayerTreeHostImpl; |
| 46 class LayerTreeHostImplClient; | 46 class LayerTreeHostImplClient; |
| 47 class PrioritizedResourceManager; | 47 class PrioritizedResourceManager; |
| 48 class ResourceUpdateQueue; | 48 class ResourceUpdateQueue; |
| 49 class HeadsUpDisplayLayer; | 49 class HeadsUpDisplayLayer; |
| 50 class Region; | 50 class Region; |
| 51 struct ScrollAndScaleSet; | 51 struct ScrollAndScaleSet; |
| 52 | 52 |
| 53 struct CC_EXPORT LayerTreeSettings { | 53 struct CC_EXPORT LayerTreeDebugState { |
| 54 LayerTreeSettings(); | 54 LayerTreeDebugState(); |
| 55 ~LayerTreeSettings(); | 55 ~LayerTreeDebugState(); |
| 56 | 56 |
| 57 bool acceleratePainting; | 57 bool showFPSCounter; |
| 58 bool implSidePainting; | 58 bool showPlatformLayerTree; |
| 59 bool showDebugBorders; | 59 bool showDebugBorders; |
| 60 bool showPlatformLayerTree; | 60 |
| 61 bool showPaintRects; | 61 bool showPaintRects; |
| 62 bool showPropertyChangedRects; | 62 bool showPropertyChangedRects; |
| 63 bool showSurfaceDamageRects; | 63 bool showSurfaceDamageRects; |
| 64 bool showScreenSpaceRects; | 64 bool showScreenSpaceRects; |
| 65 bool showReplicaScreenSpaceRects; | 65 bool showReplicaScreenSpaceRects; |
| 66 bool showOccludingRects; | 66 bool showOccludingRects; |
| 67 bool showNonOccludingRects; | 67 bool showNonOccludingRects; |
| 68 |
| 69 bool showHudInfo() const; |
| 70 bool showHudRects() const; |
| 71 |
| 72 static bool equal(const LayerTreeDebugState& a, const LayerTreeDebugState& b
); |
| 73 static LayerTreeDebugState unite(const LayerTreeDebugState& a, const LayerTr
eeDebugState& b); |
| 74 }; |
| 75 |
| 76 struct CC_EXPORT LayerTreeSettings { |
| 77 LayerTreeSettings(); |
| 78 ~LayerTreeSettings(); |
| 79 |
| 80 bool acceleratePainting; |
| 81 bool implSidePainting; |
| 68 bool renderVSyncEnabled; | 82 bool renderVSyncEnabled; |
| 69 bool perTilePaintingEnabled; | 83 bool perTilePaintingEnabled; |
| 70 bool partialSwapEnabled; | 84 bool partialSwapEnabled; |
| 71 bool acceleratedAnimationEnabled; | 85 bool acceleratedAnimationEnabled; |
| 72 bool pageScalePinchZoomEnabled; | 86 bool pageScalePinchZoomEnabled; |
| 73 bool backgroundColorInsteadOfCheckerboard; | 87 bool backgroundColorInsteadOfCheckerboard; |
| 74 bool showOverdrawInTracing; | 88 bool showOverdrawInTracing; |
| 75 double refreshRate; | 89 double refreshRate; |
| 76 size_t maxPartialTextureUpdates; | 90 size_t maxPartialTextureUpdates; |
| 77 gfx::Size defaultTileSize; | 91 gfx::Size defaultTileSize; |
| 78 gfx::Size maxUntiledLayerSize; | 92 gfx::Size maxUntiledLayerSize; |
| 79 gfx::Size minimumOcclusionTrackingSize; | 93 gfx::Size minimumOcclusionTrackingSize; |
| 80 | 94 |
| 81 bool showDebugInfo() const { return showPlatformLayerTree || showDebugRects(
); } | 95 LayerTreeDebugState initialDebugState; |
| 82 bool showDebugRects() const { return showPaintRects || showPropertyChangedRe
cts || showSurfaceDamageRects || showScreenSpaceRects || showReplicaScreenSpaceR
ects || showOccludingRects || showNonOccludingRects; } | |
| 83 }; | 96 }; |
| 84 | 97 |
| 85 // Provides information on an Impl's rendering capabilities back to the LayerTre
eHost | 98 // Provides information on an Impl's rendering capabilities back to the LayerTre
eHost |
| 86 struct CC_EXPORT RendererCapabilities { | 99 struct CC_EXPORT RendererCapabilities { |
| 87 RendererCapabilities(); | 100 RendererCapabilities(); |
| 88 ~RendererCapabilities(); | 101 ~RendererCapabilities(); |
| 89 | 102 |
| 90 GLenum bestTextureFormat; | 103 GLenum bestTextureFormat; |
| 91 bool contextHasCachedFrontBuffer; | 104 bool contextHasCachedFrontBuffer; |
| 92 bool usingPartialSwap; | 105 bool usingPartialSwap; |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 | 189 |
| 177 void setAnimationEvents(scoped_ptr<AnimationEventsVector>, base::Time wallCl
ockTime); | 190 void setAnimationEvents(scoped_ptr<AnimationEventsVector>, base::Time wallCl
ockTime); |
| 178 virtual void didAddAnimation(); | 191 virtual void didAddAnimation(); |
| 179 | 192 |
| 180 Layer* rootLayer() { return m_rootLayer.get(); } | 193 Layer* rootLayer() { return m_rootLayer.get(); } |
| 181 const Layer* rootLayer() const { return m_rootLayer.get(); } | 194 const Layer* rootLayer() const { return m_rootLayer.get(); } |
| 182 void setRootLayer(scoped_refptr<Layer>); | 195 void setRootLayer(scoped_refptr<Layer>); |
| 183 | 196 |
| 184 const LayerTreeSettings& settings() const { return m_settings; } | 197 const LayerTreeSettings& settings() const { return m_settings; } |
| 185 | 198 |
| 199 void setDebugState(const LayerTreeDebugState& debugState); |
| 200 const LayerTreeDebugState& debugState() const { return m_debugState; } |
| 201 |
| 186 void setViewportSize(const gfx::Size& layoutViewportSize, const gfx::Size& d
eviceViewportSize); | 202 void setViewportSize(const gfx::Size& layoutViewportSize, const gfx::Size& d
eviceViewportSize); |
| 187 | 203 |
| 188 const gfx::Size& layoutViewportSize() const { return m_layoutViewportSize; } | 204 const gfx::Size& layoutViewportSize() const { return m_layoutViewportSize; } |
| 189 const gfx::Size& deviceViewportSize() const { return m_deviceViewportSize; } | 205 const gfx::Size& deviceViewportSize() const { return m_deviceViewportSize; } |
| 190 | 206 |
| 191 void setPageScaleFactorAndLimits(float pageScaleFactor, float minPageScaleFa
ctor, float maxPageScaleFactor); | 207 void setPageScaleFactorAndLimits(float pageScaleFactor, float minPageScaleFa
ctor, float maxPageScaleFactor); |
| 192 | 208 |
| 193 void setBackgroundColor(SkColor color) { m_backgroundColor = color; } | 209 void setBackgroundColor(SkColor color) { m_backgroundColor = color; } |
| 194 | 210 |
| 195 void setHasTransparentBackground(bool transparent) { m_hasTransparentBackgro
und = transparent; } | 211 void setHasTransparentBackground(bool transparent) { m_hasTransparentBackgro
und = transparent; } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 214 | 230 |
| 215 // RateLimitClient implementation | 231 // RateLimitClient implementation |
| 216 virtual void rateLimit() OVERRIDE; | 232 virtual void rateLimit() OVERRIDE; |
| 217 | 233 |
| 218 bool bufferedUpdates(); | 234 bool bufferedUpdates(); |
| 219 bool requestPartialTextureUpdate(); | 235 bool requestPartialTextureUpdate(); |
| 220 | 236 |
| 221 void setDeviceScaleFactor(float); | 237 void setDeviceScaleFactor(float); |
| 222 float deviceScaleFactor() const { return m_deviceScaleFactor; } | 238 float deviceScaleFactor() const { return m_deviceScaleFactor; } |
| 223 | 239 |
| 224 void setShowFPSCounter(bool show); | |
| 225 void setFontAtlas(scoped_ptr<FontAtlas>); | 240 void setFontAtlas(scoped_ptr<FontAtlas>); |
| 226 | 241 |
| 227 HeadsUpDisplayLayer* hudLayer() const { return m_hudLayer.get(); } | 242 HeadsUpDisplayLayer* hudLayer() const { return m_hudLayer.get(); } |
| 228 | 243 |
| 229 Proxy* proxy() const { return m_proxy.get(); } | 244 Proxy* proxy() const { return m_proxy.get(); } |
| 230 | 245 |
| 231 protected: | 246 protected: |
| 232 LayerTreeHost(LayerTreeHostClient*, const LayerTreeSettings&); | 247 LayerTreeHost(LayerTreeHostClient*, const LayerTreeSettings&); |
| 233 bool initialize(scoped_ptr<Thread> implThread); | 248 bool initialize(scoped_ptr<Thread> implThread); |
| 234 | 249 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 int m_numTimesRecreateShouldFail; | 286 int m_numTimesRecreateShouldFail; |
| 272 int m_numFailedRecreateAttempts; | 287 int m_numFailedRecreateAttempts; |
| 273 | 288 |
| 274 scoped_refptr<Layer> m_rootLayer; | 289 scoped_refptr<Layer> m_rootLayer; |
| 275 scoped_refptr<HeadsUpDisplayLayer> m_hudLayer; | 290 scoped_refptr<HeadsUpDisplayLayer> m_hudLayer; |
| 276 | 291 |
| 277 scoped_ptr<PrioritizedResourceManager> m_contentsTextureManager; | 292 scoped_ptr<PrioritizedResourceManager> m_contentsTextureManager; |
| 278 scoped_ptr<PrioritizedResource> m_surfaceMemoryPlaceholder; | 293 scoped_ptr<PrioritizedResource> m_surfaceMemoryPlaceholder; |
| 279 | 294 |
| 280 LayerTreeSettings m_settings; | 295 LayerTreeSettings m_settings; |
| 296 LayerTreeDebugState m_debugState; |
| 281 | 297 |
| 282 gfx::Size m_layoutViewportSize; | 298 gfx::Size m_layoutViewportSize; |
| 283 gfx::Size m_deviceViewportSize; | 299 gfx::Size m_deviceViewportSize; |
| 284 float m_deviceScaleFactor; | 300 float m_deviceScaleFactor; |
| 285 | 301 |
| 286 bool m_visible; | 302 bool m_visible; |
| 287 | 303 |
| 288 typedef base::hash_map<WebKit::WebGraphicsContext3D*, scoped_refptr<RateLimi
ter> > RateLimiterMap; | 304 typedef base::hash_map<WebKit::WebGraphicsContext3D*, scoped_refptr<RateLimi
ter> > RateLimiterMap; |
| 289 RateLimiterMap m_rateLimiters; | 305 RateLimiterMap m_rateLimiters; |
| 290 | 306 |
| 291 float m_pageScaleFactor; | 307 float m_pageScaleFactor; |
| 292 float m_minPageScaleFactor, m_maxPageScaleFactor; | 308 float m_minPageScaleFactor, m_maxPageScaleFactor; |
| 293 gfx::Transform m_implTransform; | 309 gfx::Transform m_implTransform; |
| 294 bool m_triggerIdleUpdates; | 310 bool m_triggerIdleUpdates; |
| 295 | 311 |
| 296 SkColor m_backgroundColor; | 312 SkColor m_backgroundColor; |
| 297 bool m_hasTransparentBackground; | 313 bool m_hasTransparentBackground; |
| 298 | 314 |
| 299 typedef ScopedPtrVector<PrioritizedResource> TextureList; | 315 typedef ScopedPtrVector<PrioritizedResource> TextureList; |
| 300 size_t m_partialTextureUpdateRequests; | 316 size_t m_partialTextureUpdateRequests; |
| 301 | 317 |
| 302 static bool s_needsFilterContext; | 318 static bool s_needsFilterContext; |
| 303 | 319 |
| 304 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); | 320 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); |
| 305 }; | 321 }; |
| 306 | 322 |
| 307 } // namespace cc | 323 } // namespace cc |
| 308 | 324 |
| 309 #endif // CC_LAYER_TREE_HOST_H_ | 325 #endif // CC_LAYER_TREE_HOST_H_ |
| OLD | NEW |