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