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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 | 405 |
403 void CreateUIResource(UIResourceId uid, | 406 void CreateUIResource(UIResourceId uid, |
404 scoped_refptr<UIResourceBitmap> bitmap); | 407 scoped_refptr<UIResourceBitmap> bitmap); |
405 // Deletes a UI resource. May safely be called more than once. | 408 // Deletes a UI resource. May safely be called more than once. |
406 void DeleteUIResource(UIResourceId uid); | 409 void DeleteUIResource(UIResourceId uid); |
407 void EvictAllUIResources(); | 410 void EvictAllUIResources(); |
408 bool EvictedUIResourcesExist() const; | 411 bool EvictedUIResourcesExist() const; |
409 | 412 |
410 ResourceProvider::ResourceId ResourceIdForUIResource(UIResourceId uid) const; | 413 ResourceProvider::ResourceId ResourceIdForUIResource(UIResourceId uid) const; |
411 | 414 |
412 void DidInitializeVisibleTileForTesting() { DidInitializeVisibleTile(); } | |
413 | |
414 protected: | 415 protected: |
415 LayerTreeHostImpl( | 416 LayerTreeHostImpl( |
416 const LayerTreeSettings& settings, | 417 const LayerTreeSettings& settings, |
417 LayerTreeHostImplClient* client, | 418 LayerTreeHostImplClient* client, |
418 Proxy* proxy, | 419 Proxy* proxy, |
419 RenderingStatsInstrumentation* rendering_stats_instrumentation); | 420 RenderingStatsInstrumentation* rendering_stats_instrumentation); |
420 | 421 |
421 // Virtual for testing. | 422 // Virtual for testing. |
422 virtual void AnimateLayers(base::TimeTicks monotonic_time, | 423 virtual void AnimateLayers(base::TimeTicks monotonic_time, |
423 base::Time wall_clock_time); | 424 base::Time wall_clock_time); |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
609 | 610 |
610 // Optional callback to notify of new tree activations. | 611 // Optional callback to notify of new tree activations. |
611 base::Closure tree_activation_callback_; | 612 base::Closure tree_activation_callback_; |
612 | 613 |
613 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 614 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
614 }; | 615 }; |
615 | 616 |
616 } // namespace cc | 617 } // namespace cc |
617 | 618 |
618 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 619 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
OLD | NEW |