| 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 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 void RenderWidgetCompositor::setRootLayer(const blink::WebLayer& layer) { | 599 void RenderWidgetCompositor::setRootLayer(const blink::WebLayer& layer) { |
| 601 layer_tree_host_->SetRootLayer( | 600 layer_tree_host_->SetRootLayer( |
| 602 static_cast<const cc_blink::WebLayerImpl*>(&layer)->layer()); | 601 static_cast<const cc_blink::WebLayerImpl*>(&layer)->layer()); |
| 603 } | 602 } |
| 604 | 603 |
| 605 void RenderWidgetCompositor::clearRootLayer() { | 604 void RenderWidgetCompositor::clearRootLayer() { |
| 606 layer_tree_host_->SetRootLayer(scoped_refptr<cc::Layer>()); | 605 layer_tree_host_->SetRootLayer(scoped_refptr<cc::Layer>()); |
| 607 } | 606 } |
| 608 | 607 |
| 609 void RenderWidgetCompositor::attachCompositorAnimationTimeline( | 608 void RenderWidgetCompositor::attachCompositorAnimationTimeline( |
| 610 blink::WebCompositorAnimationTimeline* compositor_timeline) { | 609 cc::AnimationTimeline* compositor_timeline) { |
| 611 DCHECK(compositor_timeline); | |
| 612 DCHECK(layer_tree_host_->animation_host()); | 610 DCHECK(layer_tree_host_->animation_host()); |
| 613 layer_tree_host_->animation_host()->AddAnimationTimeline( | 611 layer_tree_host_->animation_host()->AddAnimationTimeline(compositor_timeline); |
| 614 static_cast<const cc_blink::WebCompositorAnimationTimelineImpl*>( | |
| 615 compositor_timeline)->animation_timeline()); | |
| 616 } | 612 } |
| 617 | 613 |
| 618 void RenderWidgetCompositor::detachCompositorAnimationTimeline( | 614 void RenderWidgetCompositor::detachCompositorAnimationTimeline( |
| 619 blink::WebCompositorAnimationTimeline* compositor_timeline) { | 615 cc::AnimationTimeline* compositor_timeline) { |
| 620 DCHECK(compositor_timeline); | |
| 621 DCHECK(layer_tree_host_->animation_host()); | 616 DCHECK(layer_tree_host_->animation_host()); |
| 622 layer_tree_host_->animation_host()->RemoveAnimationTimeline( | 617 layer_tree_host_->animation_host()->RemoveAnimationTimeline( |
| 623 static_cast<const cc_blink::WebCompositorAnimationTimelineImpl*>( | 618 compositor_timeline); |
| 624 compositor_timeline)->animation_timeline()); | |
| 625 } | 619 } |
| 626 | 620 |
| 627 void RenderWidgetCompositor::setViewportSize( | 621 void RenderWidgetCompositor::setViewportSize( |
| 628 const WebSize& device_viewport_size) { | 622 const WebSize& device_viewport_size) { |
| 629 layer_tree_host_->SetViewportSize(device_viewport_size); | 623 layer_tree_host_->SetViewportSize(device_viewport_size); |
| 630 } | 624 } |
| 631 | 625 |
| 632 WebFloatPoint RenderWidgetCompositor::adjustEventPointForPinchZoom( | 626 WebFloatPoint RenderWidgetCompositor::adjustEventPointForPinchZoom( |
| 633 const WebFloatPoint& point) const { | 627 const WebFloatPoint& point) const { |
| 634 return point; | 628 return point; |
| (...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1100 #endif | 1094 #endif |
| 1101 return actual; | 1095 return actual; |
| 1102 } | 1096 } |
| 1103 | 1097 |
| 1104 void RenderWidgetCompositor::SetPaintedDeviceScaleFactor( | 1098 void RenderWidgetCompositor::SetPaintedDeviceScaleFactor( |
| 1105 float device_scale) { | 1099 float device_scale) { |
| 1106 layer_tree_host_->SetPaintedDeviceScaleFactor(device_scale); | 1100 layer_tree_host_->SetPaintedDeviceScaleFactor(device_scale); |
| 1107 } | 1101 } |
| 1108 | 1102 |
| 1109 } // namespace content | 1103 } // namespace content |
| OLD | NEW |