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 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 } | 390 } |
390 | 391 |
391 scoped_ptr<cc::SwapPromiseMonitor> | 392 scoped_ptr<cc::SwapPromiseMonitor> |
392 RenderWidgetCompositor::CreateLatencyInfoSwapPromiseMonitor( | 393 RenderWidgetCompositor::CreateLatencyInfoSwapPromiseMonitor( |
393 ui::LatencyInfo* latency) { | 394 ui::LatencyInfo* latency) { |
394 return scoped_ptr<cc::SwapPromiseMonitor>( | 395 return scoped_ptr<cc::SwapPromiseMonitor>( |
395 new cc::LatencyInfoSwapPromiseMonitor( | 396 new cc::LatencyInfoSwapPromiseMonitor( |
396 latency, layer_tree_host_.get(), NULL)); | 397 latency, layer_tree_host_.get(), NULL)); |
397 } | 398 } |
398 | 399 |
| 400 void RenderWidgetCompositor::QueueSwapPromise( |
| 401 scoped_ptr<cc::SwapPromise> promise) { |
| 402 layer_tree_host_->QueueSwapPromise(promise.Pass()); |
| 403 } |
| 404 |
399 int RenderWidgetCompositor::GetLayerTreeId() const { | 405 int RenderWidgetCompositor::GetLayerTreeId() const { |
400 return layer_tree_host_->id(); | 406 return layer_tree_host_->id(); |
401 } | 407 } |
402 | 408 |
403 void RenderWidgetCompositor::NotifyInputThrottledUntilCommit() { | 409 void RenderWidgetCompositor::NotifyInputThrottledUntilCommit() { |
404 layer_tree_host_->NotifyInputThrottledUntilCommit(); | 410 layer_tree_host_->NotifyInputThrottledUntilCommit(); |
405 } | 411 } |
406 | 412 |
407 const cc::Layer* RenderWidgetCompositor::GetRootLayer() const { | 413 const cc::Layer* RenderWidgetCompositor::GetRootLayer() const { |
408 return layer_tree_host_->root_layer(); | 414 return layer_tree_host_->root_layer(); |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
693 widget_->OnSwapBuffersAborted(); | 699 widget_->OnSwapBuffersAborted(); |
694 } | 700 } |
695 | 701 |
696 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { | 702 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { |
697 cc::ContextProvider* provider = | 703 cc::ContextProvider* provider = |
698 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); | 704 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); |
699 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); | 705 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); |
700 } | 706 } |
701 | 707 |
702 } // namespace content | 708 } // namespace content |
OLD | NEW |