| 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/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
| 13 #include "base/synchronization/lock.h" | 13 #include "base/synchronization/lock.h" |
| 14 #include "base/sys_info.h" | 14 #include "base/sys_info.h" |
| 15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 16 #include "base/values.h" | 16 #include "base/values.h" |
| 17 #include "cc/animation/animation_timeline.h" |
| 17 #include "cc/base/latency_info_swap_promise.h" | 18 #include "cc/base/latency_info_swap_promise.h" |
| 18 #include "cc/base/latency_info_swap_promise_monitor.h" | 19 #include "cc/base/latency_info_swap_promise_monitor.h" |
| 19 #include "cc/base/swap_promise.h" | 20 #include "cc/base/swap_promise.h" |
| 20 #include "cc/base/switches.h" | 21 #include "cc/base/switches.h" |
| 22 #include "cc/blink/web_compositor_animation_timeline_impl.h" |
| 21 #include "cc/blink/web_layer_impl.h" | 23 #include "cc/blink/web_layer_impl.h" |
| 22 #include "cc/debug/layer_tree_debug_state.h" | 24 #include "cc/debug/layer_tree_debug_state.h" |
| 23 #include "cc/debug/micro_benchmark.h" | 25 #include "cc/debug/micro_benchmark.h" |
| 24 #include "cc/input/layer_selection_bound.h" | 26 #include "cc/input/layer_selection_bound.h" |
| 25 #include "cc/layers/layer.h" | 27 #include "cc/layers/layer.h" |
| 26 #include "cc/output/begin_frame_args.h" | 28 #include "cc/output/begin_frame_args.h" |
| 27 #include "cc/output/copy_output_request.h" | 29 #include "cc/output/copy_output_request.h" |
| 28 #include "cc/output/copy_output_result.h" | 30 #include "cc/output/copy_output_result.h" |
| 29 #include "cc/resources/single_release_callback.h" | 31 #include "cc/resources/single_release_callback.h" |
| 30 #include "cc/scheduler/begin_frame_source.h" | 32 #include "cc/scheduler/begin_frame_source.h" |
| (...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 | 556 |
| 555 void RenderWidgetCompositor::setRootLayer(const blink::WebLayer& layer) { | 557 void RenderWidgetCompositor::setRootLayer(const blink::WebLayer& layer) { |
| 556 layer_tree_host_->SetRootLayer( | 558 layer_tree_host_->SetRootLayer( |
| 557 static_cast<const cc_blink::WebLayerImpl*>(&layer)->layer()); | 559 static_cast<const cc_blink::WebLayerImpl*>(&layer)->layer()); |
| 558 } | 560 } |
| 559 | 561 |
| 560 void RenderWidgetCompositor::clearRootLayer() { | 562 void RenderWidgetCompositor::clearRootLayer() { |
| 561 layer_tree_host_->SetRootLayer(scoped_refptr<cc::Layer>()); | 563 layer_tree_host_->SetRootLayer(scoped_refptr<cc::Layer>()); |
| 562 } | 564 } |
| 563 | 565 |
| 566 void RenderWidgetCompositor::setCompositorAnimationTimeline( |
| 567 blink::WebCompositorAnimationTimeline* compositor_timeline) { |
| 568 layer_tree_host_->SetAnimationTimeline( |
| 569 compositor_timeline |
| 570 ? static_cast<const cc_blink::WebCompositorAnimationTimelineImpl*>( |
| 571 compositor_timeline)->animation_timeline() |
| 572 : scoped_refptr<cc::AnimationTimeline>()); |
| 573 } |
| 574 |
| 564 void RenderWidgetCompositor::setViewportSize( | 575 void RenderWidgetCompositor::setViewportSize( |
| 565 const WebSize&, | 576 const WebSize&, |
| 566 const WebSize& device_viewport_size) { | 577 const WebSize& device_viewport_size) { |
| 567 layer_tree_host_->SetViewportSize(device_viewport_size); | 578 layer_tree_host_->SetViewportSize(device_viewport_size); |
| 568 } | 579 } |
| 569 | 580 |
| 570 void RenderWidgetCompositor::setViewportSize( | 581 void RenderWidgetCompositor::setViewportSize( |
| 571 const WebSize& device_viewport_size) { | 582 const WebSize& device_viewport_size) { |
| 572 layer_tree_host_->SetViewportSize(device_viewport_size); | 583 layer_tree_host_->SetViewportSize(device_viewport_size); |
| 573 } | 584 } |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 889 widget_->OnSwapBuffersAborted(); | 900 widget_->OnSwapBuffersAborted(); |
| 890 } | 901 } |
| 891 | 902 |
| 892 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { | 903 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { |
| 893 cc::ContextProvider* provider = | 904 cc::ContextProvider* provider = |
| 894 compositor_deps_->GetSharedMainThreadContextProvider(); | 905 compositor_deps_->GetSharedMainThreadContextProvider(); |
| 895 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); | 906 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); |
| 896 } | 907 } |
| 897 | 908 |
| 898 } // namespace content | 909 } // namespace content |
| OLD | NEW |