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" | |
21 #include "cc/base/switches.h" | 20 #include "cc/base/switches.h" |
22 #include "cc/debug/layer_tree_debug_state.h" | 21 #include "cc/debug/layer_tree_debug_state.h" |
23 #include "cc/debug/micro_benchmark.h" | 22 #include "cc/debug/micro_benchmark.h" |
24 #include "cc/layers/layer.h" | 23 #include "cc/layers/layer.h" |
25 #include "cc/trees/layer_tree_host.h" | 24 #include "cc/trees/layer_tree_host.h" |
26 #include "content/common/gpu/client/context_provider_command_buffer.h" | 25 #include "content/common/gpu/client/context_provider_command_buffer.h" |
27 #include "content/public/common/content_switches.h" | 26 #include "content/public/common/content_switches.h" |
28 #include "content/renderer/gpu/input_handler_manager.h" | 27 #include "content/renderer/gpu/input_handler_manager.h" |
29 #include "content/renderer/render_thread_impl.h" | 28 #include "content/renderer/render_thread_impl.h" |
30 #include "third_party/WebKit/public/platform/WebSize.h" | 29 #include "third_party/WebKit/public/platform/WebSize.h" |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 layer_tree_host_->SetNeedsRedrawRect(damage_rect); | 384 layer_tree_host_->SetNeedsRedrawRect(damage_rect); |
386 } | 385 } |
387 | 386 |
388 void RenderWidgetCompositor::SetNeedsForcedRedraw() { | 387 void RenderWidgetCompositor::SetNeedsForcedRedraw() { |
389 layer_tree_host_->SetNextCommitForcesRedraw(); | 388 layer_tree_host_->SetNextCommitForcesRedraw(); |
390 setNeedsAnimate(); | 389 setNeedsAnimate(); |
391 } | 390 } |
392 | 391 |
393 void RenderWidgetCompositor::SetLatencyInfo( | 392 void RenderWidgetCompositor::SetLatencyInfo( |
394 const ui::LatencyInfo& latency_info) { | 393 const ui::LatencyInfo& latency_info) { |
395 scoped_ptr<cc::SwapPromise> swap_promise( | 394 layer_tree_host_->SetLatencyInfo(latency_info); |
396 new cc::LatencyInfoSwapPromise(latency_info)); | |
397 layer_tree_host_->QueueSwapPromise(swap_promise.Pass()); | |
398 } | 395 } |
399 | 396 |
400 int RenderWidgetCompositor::GetLayerTreeId() const { | 397 int RenderWidgetCompositor::GetLayerTreeId() const { |
401 return layer_tree_host_->id(); | 398 return layer_tree_host_->id(); |
402 } | 399 } |
403 | 400 |
404 void RenderWidgetCompositor::NotifyInputThrottledUntilCommit() { | 401 void RenderWidgetCompositor::NotifyInputThrottledUntilCommit() { |
405 layer_tree_host_->NotifyInputThrottledUntilCommit(); | 402 layer_tree_host_->NotifyInputThrottledUntilCommit(); |
406 } | 403 } |
407 | 404 |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
663 widget_->OnSwapBuffersAborted(); | 660 widget_->OnSwapBuffersAborted(); |
664 } | 661 } |
665 | 662 |
666 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { | 663 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { |
667 cc::ContextProvider* provider = | 664 cc::ContextProvider* provider = |
668 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); | 665 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); |
669 provider->Context3d()->rateLimitOffscreenContextCHROMIUM(); | 666 provider->Context3d()->rateLimitOffscreenContextCHROMIUM(); |
670 } | 667 } |
671 | 668 |
672 } // namespace content | 669 } // namespace content |
OLD | NEW |