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