OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #include "content/renderer/gpu/render_widget_compositor.h" | 5 #include "content/renderer/gpu/render_widget_compositor.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <limits> | 8 #include <limits> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
11 | 11 |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
13 #include "base/location.h" | 13 #include "base/location.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/numerics/safe_conversions.h" | 15 #include "base/numerics/safe_conversions.h" |
16 #include "base/single_thread_task_runner.h" | 16 #include "base/single_thread_task_runner.h" |
17 #include "base/strings/string_number_conversions.h" | 17 #include "base/strings/string_number_conversions.h" |
18 #include "base/synchronization/lock.h" | 18 #include "base/synchronization/lock.h" |
19 #include "base/sys_info.h" | 19 #include "base/sys_info.h" |
20 #include "base/thread_task_runner_handle.h" | 20 #include "base/thread_task_runner_handle.h" |
21 #include "base/time/time.h" | 21 #include "base/time/time.h" |
22 #include "base/values.h" | 22 #include "base/values.h" |
23 #include "build/build_config.h" | 23 #include "build/build_config.h" |
24 #include "cc/animation/animation_host.h" | 24 #include "cc/animation/animation_host.h" |
25 #include "cc/animation/animation_timeline.h" | 25 #include "cc/animation/animation_timeline.h" |
26 #include "cc/base/switches.h" | 26 #include "cc/base/switches.h" |
27 #include "cc/blink/web_compositor_animation_timeline_impl.h" | |
28 #include "cc/blink/web_layer_impl.h" | 27 #include "cc/blink/web_layer_impl.h" |
29 #include "cc/debug/layer_tree_debug_state.h" | 28 #include "cc/debug/layer_tree_debug_state.h" |
30 #include "cc/debug/micro_benchmark.h" | 29 #include "cc/debug/micro_benchmark.h" |
31 #include "cc/input/layer_selection_bound.h" | 30 #include "cc/input/layer_selection_bound.h" |
32 #include "cc/layers/layer.h" | 31 #include "cc/layers/layer.h" |
33 #include "cc/output/begin_frame_args.h" | 32 #include "cc/output/begin_frame_args.h" |
34 #include "cc/output/copy_output_request.h" | 33 #include "cc/output/copy_output_request.h" |
35 #include "cc/output/copy_output_result.h" | 34 #include "cc/output/copy_output_result.h" |
36 #include "cc/output/latency_info_swap_promise.h" | 35 #include "cc/output/latency_info_swap_promise.h" |
37 #include "cc/output/swap_promise.h" | 36 #include "cc/output/swap_promise.h" |
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 void RenderWidgetCompositor::setRootLayer(const blink::WebLayer& layer) { | 597 void RenderWidgetCompositor::setRootLayer(const blink::WebLayer& layer) { |
599 layer_tree_host_->SetRootLayer( | 598 layer_tree_host_->SetRootLayer( |
600 static_cast<const cc_blink::WebLayerImpl*>(&layer)->layer()); | 599 static_cast<const cc_blink::WebLayerImpl*>(&layer)->layer()); |
601 } | 600 } |
602 | 601 |
603 void RenderWidgetCompositor::clearRootLayer() { | 602 void RenderWidgetCompositor::clearRootLayer() { |
604 layer_tree_host_->SetRootLayer(scoped_refptr<cc::Layer>()); | 603 layer_tree_host_->SetRootLayer(scoped_refptr<cc::Layer>()); |
605 } | 604 } |
606 | 605 |
607 void RenderWidgetCompositor::attachCompositorAnimationTimeline( | 606 void RenderWidgetCompositor::attachCompositorAnimationTimeline( |
608 blink::WebCompositorAnimationTimeline* compositor_timeline) { | 607 cc::AnimationTimeline* compositor_timeline) { |
609 DCHECK(compositor_timeline); | |
610 DCHECK(layer_tree_host_->animation_host()); | 608 DCHECK(layer_tree_host_->animation_host()); |
611 layer_tree_host_->animation_host()->AddAnimationTimeline( | 609 layer_tree_host_->animation_host()->AddAnimationTimeline(compositor_timeline); |
612 static_cast<const cc_blink::WebCompositorAnimationTimelineImpl*>( | |
613 compositor_timeline)->animation_timeline()); | |
614 } | 610 } |
615 | 611 |
616 void RenderWidgetCompositor::detachCompositorAnimationTimeline( | 612 void RenderWidgetCompositor::detachCompositorAnimationTimeline( |
617 blink::WebCompositorAnimationTimeline* compositor_timeline) { | 613 cc::AnimationTimeline* compositor_timeline) { |
618 DCHECK(compositor_timeline); | |
619 DCHECK(layer_tree_host_->animation_host()); | 614 DCHECK(layer_tree_host_->animation_host()); |
620 layer_tree_host_->animation_host()->RemoveAnimationTimeline( | 615 layer_tree_host_->animation_host()->RemoveAnimationTimeline( |
621 static_cast<const cc_blink::WebCompositorAnimationTimelineImpl*>( | 616 compositor_timeline); |
622 compositor_timeline)->animation_timeline()); | |
623 } | 617 } |
624 | 618 |
625 void RenderWidgetCompositor::setViewportSize( | 619 void RenderWidgetCompositor::setViewportSize( |
626 const WebSize& device_viewport_size) { | 620 const WebSize& device_viewport_size) { |
627 layer_tree_host_->SetViewportSize(device_viewport_size); | 621 layer_tree_host_->SetViewportSize(device_viewport_size); |
628 } | 622 } |
629 | 623 |
630 WebFloatPoint RenderWidgetCompositor::adjustEventPointForPinchZoom( | 624 WebFloatPoint RenderWidgetCompositor::adjustEventPointForPinchZoom( |
631 const WebFloatPoint& point) const { | 625 const WebFloatPoint& point) const { |
632 return point; | 626 return point; |
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1106 #endif | 1100 #endif |
1107 return actual; | 1101 return actual; |
1108 } | 1102 } |
1109 | 1103 |
1110 void RenderWidgetCompositor::SetPaintedDeviceScaleFactor( | 1104 void RenderWidgetCompositor::SetPaintedDeviceScaleFactor( |
1111 float device_scale) { | 1105 float device_scale) { |
1112 layer_tree_host_->SetPaintedDeviceScaleFactor(device_scale); | 1106 layer_tree_host_->SetPaintedDeviceScaleFactor(device_scale); |
1113 } | 1107 } |
1114 | 1108 |
1115 } // namespace content | 1109 } // namespace content |
OLD | NEW |