| 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" | |
| 11 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 12 #include "base/hash_tables.h" | 11 #include "base/hash_tables.h" |
| 13 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 14 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 15 #include "cc/animation_events.h" | 14 #include "cc/animation_events.h" |
| 16 #include "cc/graphics_context.h" | 15 #include "cc/graphics_context.h" |
| 17 #include "cc/layer_tree_host_client.h" | 16 #include "cc/layer_tree_host_client.h" |
| 18 #include "cc/layer_tree_host_common.h" | 17 #include "cc/layer_tree_host_common.h" |
| 19 #include "cc/occlusion_tracker.h" | 18 #include "cc/occlusion_tracker.h" |
| 20 #include "cc/prioritized_texture_manager.h" | 19 #include "cc/prioritized_texture_manager.h" |
| 21 #include "cc/proxy.h" | 20 #include "cc/proxy.h" |
| 22 #include "cc/rate_limiter.h" | 21 #include "cc/rate_limiter.h" |
| 23 #include "cc/rendering_stats.h" | 22 #include "cc/rendering_stats.h" |
| 24 #include "cc/scoped_ptr_vector.h" | 23 #include "cc/scoped_ptr_vector.h" |
| 25 #include "third_party/skia/include/core/SkColor.h" | 24 #include "third_party/skia/include/core/SkColor.h" |
| 25 #include "ui/gfx/rect.h" |
| 26 | 26 |
| 27 #if defined(COMPILER_GCC) | 27 #if defined(COMPILER_GCC) |
| 28 namespace BASE_HASH_NAMESPACE { | 28 namespace BASE_HASH_NAMESPACE { |
| 29 template<> | 29 template<> |
| 30 struct hash<WebKit::WebGraphicsContext3D*> { | 30 struct hash<WebKit::WebGraphicsContext3D*> { |
| 31 size_t operator()(WebKit::WebGraphicsContext3D* ptr) const { | 31 size_t operator()(WebKit::WebGraphicsContext3D* ptr) const { |
| 32 return hash<size_t>()(reinterpret_cast<size_t>(ptr)); | 32 return hash<size_t>()(reinterpret_cast<size_t>(ptr)); |
| 33 } | 33 } |
| 34 }; | 34 }; |
| 35 } // namespace BASE_HASH_NAMESPACE | 35 } // namespace BASE_HASH_NAMESPACE |
| 36 #endif // COMPILER | 36 #endif // COMPILER |
| 37 | 37 |
| 38 namespace cc { | 38 namespace cc { |
| 39 | 39 |
| 40 class FontAtlas; | 40 class FontAtlas; |
| 41 class IntRect; |
| 41 class Layer; | 42 class Layer; |
| 42 class LayerTreeHostImpl; | 43 class LayerTreeHostImpl; |
| 43 class LayerTreeHostImplClient; | 44 class LayerTreeHostImplClient; |
| 44 class PrioritizedTextureManager; | 45 class PrioritizedTextureManager; |
| 45 class TextureUpdateQueue; | 46 class TextureUpdateQueue; |
| 46 class HeadsUpDisplayLayer; | 47 class HeadsUpDisplayLayer; |
| 47 class Region; | 48 class Region; |
| 48 struct ScrollAndScaleSet; | 49 struct ScrollAndScaleSet; |
| 49 | 50 |
| 50 struct LayerTreeSettings { | 51 struct LayerTreeSettings { |
| 51 LayerTreeSettings(); | 52 LayerTreeSettings(); |
| 52 ~LayerTreeSettings(); | 53 ~LayerTreeSettings(); |
| 53 | 54 |
| 54 bool acceleratePainting; | 55 bool acceleratePainting; |
| 55 bool showFPSCounter; | 56 bool showFPSCounter; |
| 56 bool showPlatformLayerTree; | 57 bool showPlatformLayerTree; |
| 57 bool showPaintRects; | 58 bool showPaintRects; |
| 58 bool showPropertyChangedRects; | 59 bool showPropertyChangedRects; |
| 59 bool showSurfaceDamageRects; | 60 bool showSurfaceDamageRects; |
| 60 bool showScreenSpaceRects; | 61 bool showScreenSpaceRects; |
| 61 bool showReplicaScreenSpaceRects; | 62 bool showReplicaScreenSpaceRects; |
| 62 bool showOccludingRects; | 63 bool showOccludingRects; |
| 63 bool renderVSyncEnabled; | 64 bool renderVSyncEnabled; |
| 64 double refreshRate; | 65 double refreshRate; |
| 65 size_t maxPartialTextureUpdates; | 66 size_t maxPartialTextureUpdates; |
| 66 IntSize defaultTileSize; | 67 gfx::Size defaultTileSize; |
| 67 IntSize maxUntiledLayerSize; | 68 gfx::Size maxUntiledLayerSize; |
| 68 IntSize minimumOcclusionTrackingSize; | 69 gfx::Size minimumOcclusionTrackingSize; |
| 69 | 70 |
| 70 bool showDebugInfo() const { return showPlatformLayerTree || showFPSCounter
|| showDebugRects(); } | 71 bool showDebugInfo() const { return showPlatformLayerTree || showFPSCounter
|| showDebugRects(); } |
| 71 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; } |
| 72 }; | 73 }; |
| 73 | 74 |
| 74 // 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 |
| 75 struct RendererCapabilities { | 76 struct RendererCapabilities { |
| 76 RendererCapabilities(); | 77 RendererCapabilities(); |
| 77 ~RendererCapabilities(); | 78 ~RendererCapabilities(); |
| 78 | 79 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 | 160 |
| 160 void setAnimationEvents(scoped_ptr<AnimationEventsVector>, double wallClockT
ime); | 161 void setAnimationEvents(scoped_ptr<AnimationEventsVector>, double wallClockT
ime); |
| 161 virtual void didAddAnimation(); | 162 virtual void didAddAnimation(); |
| 162 | 163 |
| 163 Layer* rootLayer() { return m_rootLayer.get(); } | 164 Layer* rootLayer() { return m_rootLayer.get(); } |
| 164 const Layer* rootLayer() const { return m_rootLayer.get(); } | 165 const Layer* rootLayer() const { return m_rootLayer.get(); } |
| 165 void setRootLayer(scoped_refptr<Layer>); | 166 void setRootLayer(scoped_refptr<Layer>); |
| 166 | 167 |
| 167 const LayerTreeSettings& settings() const { return m_settings; } | 168 const LayerTreeSettings& settings() const { return m_settings; } |
| 168 | 169 |
| 169 void setViewportSize(const IntSize& layoutViewportSize, const IntSize& devic
eViewportSize); | 170 void setViewportSize(const gfx::Size& layoutViewportSize, const gfx::Size& d
eviceViewportSize); |
| 170 | 171 |
| 171 const IntSize& layoutViewportSize() const { return m_layoutViewportSize; } | 172 const gfx::Size& layoutViewportSize() const { return m_layoutViewportSize; } |
| 172 const IntSize& deviceViewportSize() const { return m_deviceViewportSize; } | 173 const gfx::Size& deviceViewportSize() const { return m_deviceViewportSize; } |
| 173 | 174 |
| 174 void setPageScaleFactorAndLimits(float pageScaleFactor, float minPageScaleFa
ctor, float maxPageScaleFactor); | 175 void setPageScaleFactorAndLimits(float pageScaleFactor, float minPageScaleFa
ctor, float maxPageScaleFactor); |
| 175 | 176 |
| 176 void setBackgroundColor(SkColor color) { m_backgroundColor = color; } | 177 void setBackgroundColor(SkColor color) { m_backgroundColor = color; } |
| 177 | 178 |
| 178 void setHasTransparentBackground(bool transparent) { m_hasTransparentBackgro
und = transparent; } | 179 void setHasTransparentBackground(bool transparent) { m_hasTransparentBackgro
und = transparent; } |
| 179 | 180 |
| 180 PrioritizedTextureManager* contentsTextureManager() const; | 181 PrioritizedTextureManager* contentsTextureManager() const; |
| 181 | 182 |
| 182 bool visible() const { return m_visible; } | 183 bool visible() const { return m_visible; } |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 | 245 |
| 245 scoped_refptr<Layer> m_rootLayer; | 246 scoped_refptr<Layer> m_rootLayer; |
| 246 scoped_refptr<HeadsUpDisplayLayer> m_hudLayer; | 247 scoped_refptr<HeadsUpDisplayLayer> m_hudLayer; |
| 247 scoped_ptr<FontAtlas> m_fontAtlas; | 248 scoped_ptr<FontAtlas> m_fontAtlas; |
| 248 | 249 |
| 249 scoped_ptr<PrioritizedTextureManager> m_contentsTextureManager; | 250 scoped_ptr<PrioritizedTextureManager> m_contentsTextureManager; |
| 250 scoped_ptr<PrioritizedTexture> m_surfaceMemoryPlaceholder; | 251 scoped_ptr<PrioritizedTexture> m_surfaceMemoryPlaceholder; |
| 251 | 252 |
| 252 LayerTreeSettings m_settings; | 253 LayerTreeSettings m_settings; |
| 253 | 254 |
| 254 IntSize m_layoutViewportSize; | 255 gfx::Size m_layoutViewportSize; |
| 255 IntSize m_deviceViewportSize; | 256 gfx::Size m_deviceViewportSize; |
| 256 float m_deviceScaleFactor; | 257 float m_deviceScaleFactor; |
| 257 | 258 |
| 258 bool m_visible; | 259 bool m_visible; |
| 259 | 260 |
| 260 typedef base::hash_map<WebKit::WebGraphicsContext3D*, scoped_refptr<RateLimi
ter> > RateLimiterMap; | 261 typedef base::hash_map<WebKit::WebGraphicsContext3D*, scoped_refptr<RateLimi
ter> > RateLimiterMap; |
| 261 RateLimiterMap m_rateLimiters; | 262 RateLimiterMap m_rateLimiters; |
| 262 | 263 |
| 263 float m_pageScaleFactor; | 264 float m_pageScaleFactor; |
| 264 float m_minPageScaleFactor, m_maxPageScaleFactor; | 265 float m_minPageScaleFactor, m_maxPageScaleFactor; |
| 265 WebKit::WebTransformationMatrix m_implTransform; | 266 WebKit::WebTransformationMatrix m_implTransform; |
| 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<PrioritizedTexture> TextureList; | 272 typedef ScopedPtrVector<PrioritizedTexture> TextureList; |
| 272 TextureList m_deleteTextureAfterCommitList; | 273 TextureList m_deleteTextureAfterCommitList; |
| 273 size_t m_partialTextureUpdateRequests; | 274 size_t m_partialTextureUpdateRequests; |
| 274 | 275 |
| 275 static bool s_needsFilterContext; | 276 static bool s_needsFilterContext; |
| 276 | 277 |
| 277 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); | 278 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); |
| 278 }; | 279 }; |
| 279 | 280 |
| 280 } // namespace cc | 281 } // namespace cc |
| 281 | 282 |
| 282 #endif | 283 #endif |
| OLD | NEW |