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 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 void RenderWidgetCompositor::setRootLayer(const blink::WebLayer& layer) { | 600 void RenderWidgetCompositor::setRootLayer(const blink::WebLayer& layer) { |
602 layer_tree_host_->SetRootLayer( | 601 layer_tree_host_->SetRootLayer( |
603 static_cast<const cc_blink::WebLayerImpl*>(&layer)->layer()); | 602 static_cast<const cc_blink::WebLayerImpl*>(&layer)->layer()); |
604 } | 603 } |
605 | 604 |
606 void RenderWidgetCompositor::clearRootLayer() { | 605 void RenderWidgetCompositor::clearRootLayer() { |
607 layer_tree_host_->SetRootLayer(scoped_refptr<cc::Layer>()); | 606 layer_tree_host_->SetRootLayer(scoped_refptr<cc::Layer>()); |
608 } | 607 } |
609 | 608 |
610 void RenderWidgetCompositor::attachCompositorAnimationTimeline( | 609 void RenderWidgetCompositor::attachCompositorAnimationTimeline( |
611 blink::WebCompositorAnimationTimeline* compositor_timeline) { | 610 cc::AnimationTimeline* compositor_timeline) { |
612 DCHECK(compositor_timeline); | |
613 DCHECK(layer_tree_host_->animation_host()); | 611 DCHECK(layer_tree_host_->animation_host()); |
614 layer_tree_host_->animation_host()->AddAnimationTimeline( | 612 layer_tree_host_->animation_host()->AddAnimationTimeline(compositor_timeline); |
615 static_cast<const cc_blink::WebCompositorAnimationTimelineImpl*>( | |
616 compositor_timeline)->animation_timeline()); | |
617 } | 613 } |
618 | 614 |
619 void RenderWidgetCompositor::detachCompositorAnimationTimeline( | 615 void RenderWidgetCompositor::detachCompositorAnimationTimeline( |
620 blink::WebCompositorAnimationTimeline* compositor_timeline) { | 616 cc::AnimationTimeline* compositor_timeline) { |
621 DCHECK(compositor_timeline); | |
622 DCHECK(layer_tree_host_->animation_host()); | 617 DCHECK(layer_tree_host_->animation_host()); |
623 layer_tree_host_->animation_host()->RemoveAnimationTimeline( | 618 layer_tree_host_->animation_host()->RemoveAnimationTimeline( |
624 static_cast<const cc_blink::WebCompositorAnimationTimelineImpl*>( | 619 compositor_timeline); |
625 compositor_timeline)->animation_timeline()); | |
626 } | 620 } |
627 | 621 |
628 void RenderWidgetCompositor::setViewportSize( | 622 void RenderWidgetCompositor::setViewportSize( |
629 const WebSize& device_viewport_size) { | 623 const WebSize& device_viewport_size) { |
630 layer_tree_host_->SetViewportSize(device_viewport_size); | 624 layer_tree_host_->SetViewportSize(device_viewport_size); |
631 } | 625 } |
632 | 626 |
633 WebFloatPoint RenderWidgetCompositor::adjustEventPointForPinchZoom( | 627 WebFloatPoint RenderWidgetCompositor::adjustEventPointForPinchZoom( |
634 const WebFloatPoint& point) const { | 628 const WebFloatPoint& point) const { |
635 return point; | 629 return point; |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1147 #endif | 1141 #endif |
1148 return actual; | 1142 return actual; |
1149 } | 1143 } |
1150 | 1144 |
1151 void RenderWidgetCompositor::SetPaintedDeviceScaleFactor( | 1145 void RenderWidgetCompositor::SetPaintedDeviceScaleFactor( |
1152 float device_scale) { | 1146 float device_scale) { |
1153 layer_tree_host_->SetPaintedDeviceScaleFactor(device_scale); | 1147 layer_tree_host_->SetPaintedDeviceScaleFactor(device_scale); |
1154 } | 1148 } |
1155 | 1149 |
1156 } // namespace content | 1150 } // namespace content |
OLD | NEW |