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/base/latency_info_swap_promise.h" | 17 #include "cc/base/latency_info_swap_promise.h" |
18 #include "cc/base/latency_info_swap_promise_monitor.h" | 18 #include "cc/base/latency_info_swap_promise_monitor.h" |
| 19 #include "cc/base/swap_promise.h" |
19 #include "cc/base/switches.h" | 20 #include "cc/base/switches.h" |
20 #include "cc/debug/layer_tree_debug_state.h" | 21 #include "cc/debug/layer_tree_debug_state.h" |
21 #include "cc/debug/micro_benchmark.h" | 22 #include "cc/debug/micro_benchmark.h" |
22 #include "cc/layers/layer.h" | 23 #include "cc/layers/layer.h" |
23 #include "cc/output/copy_output_request.h" | 24 #include "cc/output/copy_output_request.h" |
24 #include "cc/output/copy_output_result.h" | 25 #include "cc/output/copy_output_result.h" |
25 #include "cc/resources/single_release_callback.h" | 26 #include "cc/resources/single_release_callback.h" |
26 #include "cc/trees/layer_tree_host.h" | 27 #include "cc/trees/layer_tree_host.h" |
27 #include "content/child/child_shared_bitmap_manager.h" | 28 #include "content/child/child_shared_bitmap_manager.h" |
28 #include "content/common/content_switches_internal.h" | 29 #include "content/common/content_switches_internal.h" |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 | 396 |
396 void RenderWidgetCompositor::QueueSwapPromise( | 397 void RenderWidgetCompositor::QueueSwapPromise( |
397 scoped_ptr<cc::SwapPromise> swap_promise) { | 398 scoped_ptr<cc::SwapPromise> swap_promise) { |
398 layer_tree_host_->QueueSwapPromise(swap_promise.Pass()); | 399 layer_tree_host_->QueueSwapPromise(swap_promise.Pass()); |
399 } | 400 } |
400 | 401 |
401 int RenderWidgetCompositor::GetLayerTreeId() const { | 402 int RenderWidgetCompositor::GetLayerTreeId() const { |
402 return layer_tree_host_->id(); | 403 return layer_tree_host_->id(); |
403 } | 404 } |
404 | 405 |
| 406 int RenderWidgetCompositor::GetSourceFrameNumber() const { |
| 407 return layer_tree_host_->source_frame_number(); |
| 408 } |
| 409 |
| 410 void RenderWidgetCompositor::SetNeedsCommit() { |
| 411 layer_tree_host_->SetNeedsCommit(); |
| 412 } |
| 413 |
405 void RenderWidgetCompositor::NotifyInputThrottledUntilCommit() { | 414 void RenderWidgetCompositor::NotifyInputThrottledUntilCommit() { |
406 layer_tree_host_->NotifyInputThrottledUntilCommit(); | 415 layer_tree_host_->NotifyInputThrottledUntilCommit(); |
407 } | 416 } |
408 | 417 |
409 const cc::Layer* RenderWidgetCompositor::GetRootLayer() const { | 418 const cc::Layer* RenderWidgetCompositor::GetRootLayer() const { |
410 return layer_tree_host_->root_layer(); | 419 return layer_tree_host_->root_layer(); |
411 } | 420 } |
412 | 421 |
413 int RenderWidgetCompositor::ScheduleMicroBenchmark( | 422 int RenderWidgetCompositor::ScheduleMicroBenchmark( |
414 const std::string& name, | 423 const std::string& name, |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 widget_->OnSwapBuffersAborted(); | 709 widget_->OnSwapBuffersAborted(); |
701 } | 710 } |
702 | 711 |
703 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { | 712 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { |
704 cc::ContextProvider* provider = | 713 cc::ContextProvider* provider = |
705 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); | 714 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); |
706 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); | 715 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); |
707 } | 716 } |
708 | 717 |
709 } // namespace content | 718 } // namespace content |
OLD | NEW |