| 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_TREES_LAYER_TREE_HOST_IMPL_H_ | 5 #ifndef CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
| 6 #define CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 6 #define CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 const LayerTreeSettings& settings() const { return settings_; } | 176 const LayerTreeSettings& settings() const { return settings_; } |
| 177 | 177 |
| 178 // Evict all textures by enforcing a memory policy with an allocation of 0. | 178 // Evict all textures by enforcing a memory policy with an allocation of 0. |
| 179 void EvictTexturesForTesting(); | 179 void EvictTexturesForTesting(); |
| 180 | 180 |
| 181 // When blocking, this prevents client_->NotifyReadyToActivate() from being | 181 // When blocking, this prevents client_->NotifyReadyToActivate() from being |
| 182 // called. When disabled, it calls client_->NotifyReadyToActivate() | 182 // called. When disabled, it calls client_->NotifyReadyToActivate() |
| 183 // immediately if any notifications had been blocked while blocking. | 183 // immediately if any notifications had been blocked while blocking. |
| 184 virtual void BlockNotifyReadyToActivateForTesting(bool block); | 184 virtual void BlockNotifyReadyToActivateForTesting(bool block); |
| 185 | 185 |
| 186 // This allows us to inject DidInitializeVisibleTile events for testing. |
| 187 void DidInitializeVisibleTileForTesting(); |
| 188 |
| 186 bool device_viewport_valid_for_tile_management() const { | 189 bool device_viewport_valid_for_tile_management() const { |
| 187 return device_viewport_valid_for_tile_management_; | 190 return device_viewport_valid_for_tile_management_; |
| 188 } | 191 } |
| 189 | 192 |
| 190 // Viewport size in draw space: this size is in physical pixels and is used | 193 // Viewport size in draw space: this size is in physical pixels and is used |
| 191 // for draw properties, tilings, quads and render passes. | 194 // for draw properties, tilings, quads and render passes. |
| 192 gfx::Size DrawViewportSize() const; | 195 gfx::Size DrawViewportSize() const; |
| 193 | 196 |
| 194 // Viewport size for scrolling and fixed-position compensation. This value | 197 // Viewport size for scrolling and fixed-position compensation. This value |
| 195 // excludes the URL bar and non-overlay scrollbars and is in DIP (and | 198 // excludes the URL bar and non-overlay scrollbars and is in DIP (and |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 bool page_scale_animation_active() const { return !!page_scale_animation_; } | 401 bool page_scale_animation_active() const { return !!page_scale_animation_; } |
| 399 | 402 |
| 400 void CreateUIResource(UIResourceId uid, | 403 void CreateUIResource(UIResourceId uid, |
| 401 scoped_refptr<UIResourceBitmap> bitmap); | 404 scoped_refptr<UIResourceBitmap> bitmap); |
| 402 // Deletes a UI resource. May safely be called more than once. | 405 // Deletes a UI resource. May safely be called more than once. |
| 403 void DeleteUIResource(UIResourceId uid); | 406 void DeleteUIResource(UIResourceId uid); |
| 404 void DeleteAllUIResources(); | 407 void DeleteAllUIResources(); |
| 405 | 408 |
| 406 ResourceProvider::ResourceId ResourceIdForUIResource(UIResourceId uid) const; | 409 ResourceProvider::ResourceId ResourceIdForUIResource(UIResourceId uid) const; |
| 407 | 410 |
| 408 void DidInitializeVisibleTileForTesting() { DidInitializeVisibleTile(); } | |
| 409 | |
| 410 protected: | 411 protected: |
| 411 LayerTreeHostImpl( | 412 LayerTreeHostImpl( |
| 412 const LayerTreeSettings& settings, | 413 const LayerTreeSettings& settings, |
| 413 LayerTreeHostImplClient* client, | 414 LayerTreeHostImplClient* client, |
| 414 Proxy* proxy, | 415 Proxy* proxy, |
| 415 RenderingStatsInstrumentation* rendering_stats_instrumentation); | 416 RenderingStatsInstrumentation* rendering_stats_instrumentation); |
| 416 | 417 |
| 417 // Virtual for testing. | 418 // Virtual for testing. |
| 418 virtual void AnimateLayers(base::TimeTicks monotonic_time, | 419 virtual void AnimateLayers(base::TimeTicks monotonic_time, |
| 419 base::Time wall_clock_time); | 420 base::Time wall_clock_time); |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 | 599 |
| 599 // Optional callback to notify of new tree activations. | 600 // Optional callback to notify of new tree activations. |
| 600 base::Closure tree_activation_callback_; | 601 base::Closure tree_activation_callback_; |
| 601 | 602 |
| 602 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 603 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
| 603 }; | 604 }; |
| 604 | 605 |
| 605 } // namespace cc | 606 } // namespace cc |
| 606 | 607 |
| 607 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 608 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
| OLD | NEW |