| 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/time.h" | 15 #include "base/time.h" |
| 16 #include "cc/animation_events.h" | 16 #include "cc/animation_events.h" |
| 17 #include "cc/cc_export.h" | 17 #include "cc/cc_export.h" |
| 18 #include "cc/layer_tree_host_client.h" | 18 #include "cc/layer_tree_host_client.h" |
| 19 #include "cc/layer_tree_host_common.h" | 19 #include "cc/layer_tree_host_common.h" |
| 20 #include "cc/layer_tree_settings.h" | 20 #include "cc/layer_tree_settings.h" |
| 21 #include "cc/occlusion_tracker.h" | 21 #include "cc/occlusion_tracker.h" |
| 22 #include "cc/output_surface.h" | 22 #include "cc/output_surface.h" |
| 23 #include "cc/proxy.h" | 23 #include "cc/proxy.h" |
| 24 #include "cc/rate_limiter.h" | 24 #include "cc/rate_limiter.h" |
| 25 #include "cc/rendering_stats.h" | 25 #include "cc/rendering_stats.h" |
| 26 #include "cc/scoped_ptr_vector.h" | 26 #include "cc/scoped_ptr_vector.h" |
| 27 #include "skia/ext/refptr.h" |
| 27 #include "third_party/skia/include/core/SkColor.h" | 28 #include "third_party/skia/include/core/SkColor.h" |
| 29 #include "third_party/skia/include/core/SkPicture.h" |
| 28 #include "ui/gfx/rect.h" | 30 #include "ui/gfx/rect.h" |
| 29 | 31 |
| 30 #if defined(COMPILER_GCC) | 32 #if defined(COMPILER_GCC) |
| 31 namespace BASE_HASH_NAMESPACE { | 33 namespace BASE_HASH_NAMESPACE { |
| 32 template<> | 34 template<> |
| 33 struct hash<WebKit::WebGraphicsContext3D*> { | 35 struct hash<WebKit::WebGraphicsContext3D*> { |
| 34 size_t operator()(WebKit::WebGraphicsContext3D* ptr) const { | 36 size_t operator()(WebKit::WebGraphicsContext3D* ptr) const { |
| 35 return hash<size_t>()(reinterpret_cast<size_t>(ptr)); | 37 return hash<size_t>()(reinterpret_cast<size_t>(ptr)); |
| 36 } | 38 } |
| 37 }; | 39 }; |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 | 194 |
| 193 void setDeviceScaleFactor(float); | 195 void setDeviceScaleFactor(float); |
| 194 float deviceScaleFactor() const { return m_deviceScaleFactor; } | 196 float deviceScaleFactor() const { return m_deviceScaleFactor; } |
| 195 | 197 |
| 196 HeadsUpDisplayLayer* hudLayer() const { return m_hudLayer.get(); } | 198 HeadsUpDisplayLayer* hudLayer() const { return m_hudLayer.get(); } |
| 197 | 199 |
| 198 Proxy* proxy() const { return m_proxy.get(); } | 200 Proxy* proxy() const { return m_proxy.get(); } |
| 199 | 201 |
| 200 AnimationRegistrar* animationRegistrar() const { return m_animationRegistrar
.get(); } | 202 AnimationRegistrar* animationRegistrar() const { return m_animationRegistrar
.get(); } |
| 201 | 203 |
| 204 skia::RefPtr<SkPicture> capturePicture(); |
| 205 |
| 202 protected: | 206 protected: |
| 203 LayerTreeHost(LayerTreeHostClient*, const LayerTreeSettings&); | 207 LayerTreeHost(LayerTreeHostClient*, const LayerTreeSettings&); |
| 204 bool initialize(scoped_ptr<Thread> implThread); | 208 bool initialize(scoped_ptr<Thread> implThread); |
| 205 bool initializeForTesting(scoped_ptr<Proxy> proxyForTesting); | 209 bool initializeForTesting(scoped_ptr<Proxy> proxyForTesting); |
| 206 | 210 |
| 207 private: | 211 private: |
| 208 typedef std::vector<scoped_refptr<Layer> > LayerList; | 212 typedef std::vector<scoped_refptr<Layer> > LayerList; |
| 209 | 213 |
| 210 bool initializeProxy(scoped_ptr<Proxy> proxy); | 214 bool initializeProxy(scoped_ptr<Proxy> proxy); |
| 211 void initializeRenderer(); | 215 void initializeRenderer(); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 scoped_ptr<AnimationRegistrar> m_animationRegistrar; | 279 scoped_ptr<AnimationRegistrar> m_animationRegistrar; |
| 276 | 280 |
| 277 static bool s_needsFilterContext; | 281 static bool s_needsFilterContext; |
| 278 | 282 |
| 279 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); | 283 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); |
| 280 }; | 284 }; |
| 281 | 285 |
| 282 } // namespace cc | 286 } // namespace cc |
| 283 | 287 |
| 284 #endif // CC_LAYER_TREE_HOST_H_ | 288 #endif // CC_LAYER_TREE_HOST_H_ |
| OLD | NEW |