| 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 <limits> | 7 #include <limits> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/location.h" | 11 #include "base/location.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/profiler/scoped_tracker.h" | 13 #include "base/profiler/scoped_tracker.h" |
| 14 #include "base/single_thread_task_runner.h" | 14 #include "base/single_thread_task_runner.h" |
| 15 #include "base/strings/string_number_conversions.h" | 15 #include "base/strings/string_number_conversions.h" |
| 16 #include "base/synchronization/lock.h" | 16 #include "base/synchronization/lock.h" |
| 17 #include "base/sys_info.h" | 17 #include "base/sys_info.h" |
| 18 #include "base/thread_task_runner_handle.h" | 18 #include "base/thread_task_runner_handle.h" |
| 19 #include "base/time/time.h" | 19 #include "base/time/time.h" |
| 20 #include "base/values.h" | 20 #include "base/values.h" |
| 21 #include "cc/animation/animation_host.h" |
| 22 #include "cc/animation/animation_timeline.h" |
| 21 #include "cc/base/switches.h" | 23 #include "cc/base/switches.h" |
| 24 #include "cc/blink/web_compositor_animation_timeline_impl.h" |
| 22 #include "cc/blink/web_layer_impl.h" | 25 #include "cc/blink/web_layer_impl.h" |
| 23 #include "cc/debug/layer_tree_debug_state.h" | 26 #include "cc/debug/layer_tree_debug_state.h" |
| 24 #include "cc/debug/micro_benchmark.h" | 27 #include "cc/debug/micro_benchmark.h" |
| 25 #include "cc/input/layer_selection_bound.h" | 28 #include "cc/input/layer_selection_bound.h" |
| 26 #include "cc/layers/layer.h" | 29 #include "cc/layers/layer.h" |
| 27 #include "cc/output/begin_frame_args.h" | 30 #include "cc/output/begin_frame_args.h" |
| 28 #include "cc/output/copy_output_request.h" | 31 #include "cc/output/copy_output_request.h" |
| 29 #include "cc/output/copy_output_result.h" | 32 #include "cc/output/copy_output_result.h" |
| 30 #include "cc/output/latency_info_swap_promise.h" | 33 #include "cc/output/latency_info_swap_promise.h" |
| 31 #include "cc/output/swap_promise.h" | 34 #include "cc/output/swap_promise.h" |
| (...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 | 580 |
| 578 void RenderWidgetCompositor::setRootLayer(const blink::WebLayer& layer) { | 581 void RenderWidgetCompositor::setRootLayer(const blink::WebLayer& layer) { |
| 579 layer_tree_host_->SetRootLayer( | 582 layer_tree_host_->SetRootLayer( |
| 580 static_cast<const cc_blink::WebLayerImpl*>(&layer)->layer()); | 583 static_cast<const cc_blink::WebLayerImpl*>(&layer)->layer()); |
| 581 } | 584 } |
| 582 | 585 |
| 583 void RenderWidgetCompositor::clearRootLayer() { | 586 void RenderWidgetCompositor::clearRootLayer() { |
| 584 layer_tree_host_->SetRootLayer(scoped_refptr<cc::Layer>()); | 587 layer_tree_host_->SetRootLayer(scoped_refptr<cc::Layer>()); |
| 585 } | 588 } |
| 586 | 589 |
| 590 void RenderWidgetCompositor::attachCompositorAnimationTimeline( |
| 591 blink::WebCompositorAnimationTimeline* compositor_timeline) { |
| 592 DCHECK(compositor_timeline); |
| 593 DCHECK(layer_tree_host_->animation_host()); |
| 594 layer_tree_host_->animation_host()->AddAnimationTimeline( |
| 595 static_cast<const cc_blink::WebCompositorAnimationTimelineImpl*>( |
| 596 compositor_timeline)->animation_timeline()); |
| 597 } |
| 598 |
| 599 void RenderWidgetCompositor::detachCompositorAnimationTimeline( |
| 600 blink::WebCompositorAnimationTimeline* compositor_timeline) { |
| 601 DCHECK(compositor_timeline); |
| 602 DCHECK(layer_tree_host_->animation_host()); |
| 603 layer_tree_host_->animation_host()->RemoveAnimationTimeline( |
| 604 static_cast<const cc_blink::WebCompositorAnimationTimelineImpl*>( |
| 605 compositor_timeline)->animation_timeline()); |
| 606 } |
| 607 |
| 587 void RenderWidgetCompositor::setViewportSize( | 608 void RenderWidgetCompositor::setViewportSize( |
| 588 const WebSize&, | 609 const WebSize&, |
| 589 const WebSize& device_viewport_size) { | 610 const WebSize& device_viewport_size) { |
| 590 layer_tree_host_->SetViewportSize(device_viewport_size); | 611 layer_tree_host_->SetViewportSize(device_viewport_size); |
| 591 } | 612 } |
| 592 | 613 |
| 593 void RenderWidgetCompositor::setViewportSize( | 614 void RenderWidgetCompositor::setViewportSize( |
| 594 const WebSize& device_viewport_size) { | 615 const WebSize& device_viewport_size) { |
| 595 layer_tree_host_->SetViewportSize(device_viewport_size); | 616 layer_tree_host_->SetViewportSize(device_viewport_size); |
| 596 } | 617 } |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1000 return; | 1021 return; |
| 1001 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); | 1022 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); |
| 1002 } | 1023 } |
| 1003 | 1024 |
| 1004 void RenderWidgetCompositor::SetSurfaceIdNamespace( | 1025 void RenderWidgetCompositor::SetSurfaceIdNamespace( |
| 1005 uint32_t surface_id_namespace) { | 1026 uint32_t surface_id_namespace) { |
| 1006 layer_tree_host_->set_surface_id_namespace(surface_id_namespace); | 1027 layer_tree_host_->set_surface_id_namespace(surface_id_namespace); |
| 1007 } | 1028 } |
| 1008 | 1029 |
| 1009 } // namespace content | 1030 } // namespace content |
| OLD | NEW |