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