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_H_ | 5 #ifndef CC_TREES_LAYER_TREE_HOST_H_ |
6 #define CC_TREES_LAYER_TREE_HOST_H_ | 6 #define CC_TREES_LAYER_TREE_HOST_H_ |
7 | 7 |
8 #include <limits> | 8 #include <limits> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/cancelable_callback.h" | 14 #include "base/cancelable_callback.h" |
15 #include "base/containers/hash_tables.h" | 15 #include "base/containers/hash_tables.h" |
16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
18 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
19 #include "base/time/time.h" | 19 #include "base/time/time.h" |
20 #include "base/timer/timer.h" | |
21 #include "cc/animation/animation_events.h" | 20 #include "cc/animation/animation_events.h" |
22 #include "cc/base/cc_export.h" | 21 #include "cc/base/cc_export.h" |
23 #include "cc/base/scoped_ptr_vector.h" | 22 #include "cc/base/scoped_ptr_vector.h" |
24 #include "cc/debug/frame_timing_tracker.h" | 23 #include "cc/debug/frame_timing_tracker.h" |
25 #include "cc/debug/micro_benchmark.h" | 24 #include "cc/debug/micro_benchmark.h" |
26 #include "cc/debug/micro_benchmark_controller.h" | 25 #include "cc/debug/micro_benchmark_controller.h" |
27 #include "cc/input/input_handler.h" | 26 #include "cc/input/input_handler.h" |
28 #include "cc/input/layer_selection_bound.h" | 27 #include "cc/input/layer_selection_bound.h" |
29 #include "cc/input/scrollbar.h" | 28 #include "cc/input/scrollbar.h" |
30 #include "cc/input/top_controls_state.h" | 29 #include "cc/input/top_controls_state.h" |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 void SetThrottleFrameProduction(bool throttle); | 236 void SetThrottleFrameProduction(bool throttle); |
238 | 237 |
239 void StartPageScaleAnimation(const gfx::Vector2d& target_offset, | 238 void StartPageScaleAnimation(const gfx::Vector2d& target_offset, |
240 bool use_anchor, | 239 bool use_anchor, |
241 float scale, | 240 float scale, |
242 base::TimeDelta duration); | 241 base::TimeDelta duration); |
243 | 242 |
244 void ApplyScrollAndScale(ScrollAndScaleSet* info); | 243 void ApplyScrollAndScale(ScrollAndScaleSet* info); |
245 void SetImplTransform(const gfx::Transform& transform); | 244 void SetImplTransform(const gfx::Transform& transform); |
246 | 245 |
247 // Virtual for tests. | |
248 virtual void StartRateLimiter(); | |
249 virtual void StopRateLimiter(); | |
250 | |
251 void RateLimit(); | |
252 | |
253 void SetDeviceScaleFactor(float device_scale_factor); | 246 void SetDeviceScaleFactor(float device_scale_factor); |
254 float device_scale_factor() const { return device_scale_factor_; } | 247 float device_scale_factor() const { return device_scale_factor_; } |
255 | 248 |
256 void UpdateTopControlsState(TopControlsState constraints, | 249 void UpdateTopControlsState(TopControlsState constraints, |
257 TopControlsState current, | 250 TopControlsState current, |
258 bool animate); | 251 bool animate); |
259 | 252 |
260 HeadsUpDisplayLayer* hud_layer() const { return hud_layer_.get(); } | 253 HeadsUpDisplayLayer* hud_layer() const { return hud_layer_.get(); } |
261 | 254 |
262 Proxy* proxy() const { return proxy_.get(); } | 255 Proxy* proxy() const { return proxy_.get(); } |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 typedef std::vector<UIResourceRequest> UIResourceRequestQueue; | 410 typedef std::vector<UIResourceRequest> UIResourceRequestQueue; |
418 UIResourceRequestQueue ui_resource_request_queue_; | 411 UIResourceRequestQueue ui_resource_request_queue_; |
419 | 412 |
420 void RecordGpuRasterizationHistogram(); | 413 void RecordGpuRasterizationHistogram(); |
421 void CalculateLCDTextMetricsCallback(Layer* layer); | 414 void CalculateLCDTextMetricsCallback(Layer* layer); |
422 | 415 |
423 void NotifySwapPromiseMonitorsOfSetNeedsCommit(); | 416 void NotifySwapPromiseMonitorsOfSetNeedsCommit(); |
424 | 417 |
425 void SetPropertyTreesNeedRebuild(); | 418 void SetPropertyTreesNeedRebuild(); |
426 | 419 |
427 bool inside_begin_main_frame_; | |
428 bool needs_full_tree_sync_; | 420 bool needs_full_tree_sync_; |
429 bool needs_meta_info_recomputation_; | 421 bool needs_meta_info_recomputation_; |
430 | 422 |
431 LayerTreeHostClient* client_; | 423 LayerTreeHostClient* client_; |
432 scoped_ptr<Proxy> proxy_; | 424 scoped_ptr<Proxy> proxy_; |
433 | 425 |
434 int source_frame_number_; | 426 int source_frame_number_; |
435 int meta_information_sequence_number_; | 427 int meta_information_sequence_number_; |
436 scoped_ptr<RenderingStatsInstrumentation> rendering_stats_instrumentation_; | 428 scoped_ptr<RenderingStatsInstrumentation> rendering_stats_instrumentation_; |
437 | 429 |
(...skipping 10 matching lines...) Expand all Loading... |
448 | 440 |
449 gfx::Size device_viewport_size_; | 441 gfx::Size device_viewport_size_; |
450 bool top_controls_shrink_blink_size_; | 442 bool top_controls_shrink_blink_size_; |
451 float top_controls_height_; | 443 float top_controls_height_; |
452 float top_controls_shown_ratio_; | 444 float top_controls_shown_ratio_; |
453 bool hide_pinch_scrollbars_near_min_scale_; | 445 bool hide_pinch_scrollbars_near_min_scale_; |
454 float device_scale_factor_; | 446 float device_scale_factor_; |
455 | 447 |
456 bool visible_; | 448 bool visible_; |
457 | 449 |
458 base::OneShotTimer<LayerTreeHost> rate_limit_timer_; | |
459 | |
460 float page_scale_factor_; | 450 float page_scale_factor_; |
461 float min_page_scale_factor_; | 451 float min_page_scale_factor_; |
462 float max_page_scale_factor_; | 452 float max_page_scale_factor_; |
463 gfx::Vector2dF elastic_overscroll_; | 453 gfx::Vector2dF elastic_overscroll_; |
464 bool has_gpu_rasterization_trigger_; | 454 bool has_gpu_rasterization_trigger_; |
465 bool content_is_suitable_for_gpu_rasterization_; | 455 bool content_is_suitable_for_gpu_rasterization_; |
466 bool gpu_rasterization_histogram_recorded_; | 456 bool gpu_rasterization_histogram_recorded_; |
467 | 457 |
468 SkColor background_color_; | 458 SkColor background_color_; |
469 bool has_transparent_background_; | 459 bool has_transparent_background_; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 | 493 |
504 uint32_t surface_id_namespace_; | 494 uint32_t surface_id_namespace_; |
505 uint32_t next_surface_sequence_; | 495 uint32_t next_surface_sequence_; |
506 | 496 |
507 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); | 497 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); |
508 }; | 498 }; |
509 | 499 |
510 } // namespace cc | 500 } // namespace cc |
511 | 501 |
512 #endif // CC_TREES_LAYER_TREE_HOST_H_ | 502 #endif // CC_TREES_LAYER_TREE_HOST_H_ |
OLD | NEW |