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 <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "cc/input/top_controls_manager_client.h" | 25 #include "cc/input/top_controls_manager_client.h" |
26 #include "cc/layers/layer_lists.h" | 26 #include "cc/layers/layer_lists.h" |
27 #include "cc/layers/render_pass_sink.h" | 27 #include "cc/layers/render_pass_sink.h" |
28 #include "cc/output/begin_frame_args.h" | 28 #include "cc/output/begin_frame_args.h" |
29 #include "cc/output/managed_memory_policy.h" | 29 #include "cc/output/managed_memory_policy.h" |
30 #include "cc/output/output_surface_client.h" | 30 #include "cc/output/output_surface_client.h" |
31 #include "cc/output/renderer.h" | 31 #include "cc/output/renderer.h" |
32 #include "cc/quads/render_pass.h" | 32 #include "cc/quads/render_pass.h" |
33 #include "cc/resources/resource_provider.h" | 33 #include "cc/resources/resource_provider.h" |
34 #include "cc/resources/ui_resource_client.h" | 34 #include "cc/resources/ui_resource_client.h" |
| 35 #include "cc/scheduler/begin_frame_tracker.h" |
35 #include "cc/scheduler/commit_earlyout_reason.h" | 36 #include "cc/scheduler/commit_earlyout_reason.h" |
36 #include "cc/scheduler/draw_result.h" | 37 #include "cc/scheduler/draw_result.h" |
37 #include "cc/scheduler/video_frame_controller.h" | 38 #include "cc/scheduler/video_frame_controller.h" |
38 #include "cc/tiles/tile_manager.h" | 39 #include "cc/tiles/tile_manager.h" |
39 #include "cc/trees/layer_tree_settings.h" | 40 #include "cc/trees/layer_tree_settings.h" |
40 #include "cc/trees/proxy.h" | 41 #include "cc/trees/proxy.h" |
41 #include "skia/ext/refptr.h" | 42 #include "skia/ext/refptr.h" |
42 #include "third_party/skia/include/core/SkColor.h" | 43 #include "third_party/skia/include/core/SkColor.h" |
43 #include "ui/gfx/geometry/rect.h" | 44 #include "ui/gfx/geometry/rect.h" |
44 | 45 |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 | 445 |
445 gfx::Vector2dF accumulated_root_overscroll() const { | 446 gfx::Vector2dF accumulated_root_overscroll() const { |
446 return accumulated_root_overscroll_; | 447 return accumulated_root_overscroll_; |
447 } | 448 } |
448 | 449 |
449 bool pinch_gesture_active() const { return pinch_gesture_active_; } | 450 bool pinch_gesture_active() const { return pinch_gesture_active_; } |
450 | 451 |
451 void SetTreePriority(TreePriority priority); | 452 void SetTreePriority(TreePriority priority); |
452 TreePriority GetTreePriority() const; | 453 TreePriority GetTreePriority() const; |
453 | 454 |
| 455 // TODO(mithro): Remove this methods which exposes the internal |
| 456 // BeginFrameArgs to external callers. |
454 virtual BeginFrameArgs CurrentBeginFrameArgs() const; | 457 virtual BeginFrameArgs CurrentBeginFrameArgs() const; |
455 | 458 |
456 // Expected time between two begin impl frame calls. | 459 // Expected time between two begin impl frame calls. |
457 base::TimeDelta begin_impl_frame_interval() const { | 460 base::TimeDelta CurrentBeginFrameInterval() const; |
458 return begin_impl_frame_interval_; | |
459 } | |
460 | 461 |
461 void AsValueWithFrameInto(FrameData* frame, | 462 void AsValueWithFrameInto(FrameData* frame, |
462 base::trace_event::TracedValue* value) const; | 463 base::trace_event::TracedValue* value) const; |
463 scoped_refptr<base::trace_event::ConvertableToTraceFormat> AsValueWithFrame( | 464 scoped_refptr<base::trace_event::ConvertableToTraceFormat> AsValueWithFrame( |
464 FrameData* frame) const; | 465 FrameData* frame) const; |
465 void ActivationStateAsValueInto(base::trace_event::TracedValue* value) const; | 466 void ActivationStateAsValueInto(base::trace_event::TracedValue* value) const; |
466 | 467 |
467 bool page_scale_animation_active() const { return !!page_scale_animation_; } | 468 bool page_scale_animation_active() const { return !!page_scale_animation_; } |
468 | 469 |
469 virtual void CreateUIResource(UIResourceId uid, | 470 virtual void CreateUIResource(UIResourceId uid, |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 bool is_likely_to_require_a_draw() const { | 555 bool is_likely_to_require_a_draw() const { |
555 return is_likely_to_require_a_draw_; | 556 return is_likely_to_require_a_draw_; |
556 } | 557 } |
557 | 558 |
558 // Removes empty or orphan RenderPasses from the frame. | 559 // Removes empty or orphan RenderPasses from the frame. |
559 static void RemoveRenderPasses(FrameData* frame); | 560 static void RemoveRenderPasses(FrameData* frame); |
560 | 561 |
561 LayerTreeHostImplClient* client_; | 562 LayerTreeHostImplClient* client_; |
562 Proxy* proxy_; | 563 Proxy* proxy_; |
563 | 564 |
| 565 BeginFrameTracker current_begin_frame_tracker_; |
| 566 |
564 private: | 567 private: |
565 gfx::Vector2dF ScrollLayerWithViewportSpaceDelta( | 568 gfx::Vector2dF ScrollLayerWithViewportSpaceDelta( |
566 LayerImpl* layer_impl, | 569 LayerImpl* layer_impl, |
567 const gfx::PointF& viewport_point, | 570 const gfx::PointF& viewport_point, |
568 const gfx::Vector2dF& viewport_delta); | 571 const gfx::Vector2dF& viewport_delta); |
569 | 572 |
570 void CreateAndSetRenderer(); | 573 void CreateAndSetRenderer(); |
571 void CreateAndSetTileManager(); | 574 void CreateAndSetTileManager(); |
572 void DestroyTileManager(); | 575 void DestroyTileManager(); |
573 void ReleaseTreeResources(); | 576 void ReleaseTreeResources(); |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
729 // - viewport_rect_for_tile_priority_ is the rect in view space used for | 732 // - viewport_rect_for_tile_priority_ is the rect in view space used for |
730 // tiling priority. | 733 // tiling priority. |
731 gfx::Transform external_transform_; | 734 gfx::Transform external_transform_; |
732 gfx::Rect external_viewport_; | 735 gfx::Rect external_viewport_; |
733 gfx::Rect external_clip_; | 736 gfx::Rect external_clip_; |
734 gfx::Rect viewport_rect_for_tile_priority_; | 737 gfx::Rect viewport_rect_for_tile_priority_; |
735 bool resourceless_software_draw_; | 738 bool resourceless_software_draw_; |
736 | 739 |
737 gfx::Rect viewport_damage_rect_; | 740 gfx::Rect viewport_damage_rect_; |
738 | 741 |
739 BeginFrameArgs current_begin_frame_args_; | |
740 | |
741 // Expected time between two begin impl frame calls. | |
742 base::TimeDelta begin_impl_frame_interval_; | |
743 | |
744 scoped_ptr<AnimationRegistrar> animation_registrar_; | 742 scoped_ptr<AnimationRegistrar> animation_registrar_; |
745 std::set<ScrollbarAnimationController*> scrollbar_animation_controllers_; | 743 std::set<ScrollbarAnimationController*> scrollbar_animation_controllers_; |
746 std::set<VideoFrameController*> video_frame_controllers_; | 744 std::set<VideoFrameController*> video_frame_controllers_; |
747 | 745 |
748 RenderingStatsInstrumentation* rendering_stats_instrumentation_; | 746 RenderingStatsInstrumentation* rendering_stats_instrumentation_; |
749 MicroBenchmarkControllerImpl micro_benchmark_controller_; | 747 MicroBenchmarkControllerImpl micro_benchmark_controller_; |
750 scoped_ptr<TaskGraphRunner> single_thread_synchronous_task_graph_runner_; | 748 scoped_ptr<TaskGraphRunner> single_thread_synchronous_task_graph_runner_; |
751 | 749 |
752 // Optional callback to notify of new tree activations. | 750 // Optional callback to notify of new tree activations. |
753 base::Closure tree_activation_callback_; | 751 base::Closure tree_activation_callback_; |
(...skipping 11 matching lines...) Expand all Loading... |
765 scoped_ptr<FrameTimingTracker> frame_timing_tracker_; | 763 scoped_ptr<FrameTimingTracker> frame_timing_tracker_; |
766 | 764 |
767 scoped_ptr<Viewport> viewport_; | 765 scoped_ptr<Viewport> viewport_; |
768 | 766 |
769 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 767 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
770 }; | 768 }; |
771 | 769 |
772 } // namespace cc | 770 } // namespace cc |
773 | 771 |
774 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 772 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
OLD | NEW |