Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1026)

Side by Side Diff: content/renderer/gpu/render_widget_compositor.cc

Issue 81533002: Use LatencyInfoSwapPromise to track LatencyInfo through compositor (Closed) Base URL: http://git.chromium.org/chromium/src.git@swap_promise_2
Patch Set: fix typo Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/switches.h" 21 #include "cc/base/switches.h"
21 #include "cc/debug/layer_tree_debug_state.h" 22 #include "cc/debug/layer_tree_debug_state.h"
22 #include "cc/debug/micro_benchmark.h" 23 #include "cc/debug/micro_benchmark.h"
23 #include "cc/layers/layer.h" 24 #include "cc/layers/layer.h"
24 #include "cc/trees/layer_tree_host.h" 25 #include "cc/trees/layer_tree_host.h"
25 #include "content/common/gpu/client/context_provider_command_buffer.h" 26 #include "content/common/gpu/client/context_provider_command_buffer.h"
26 #include "content/public/common/content_switches.h" 27 #include "content/public/common/content_switches.h"
27 #include "content/renderer/gpu/input_handler_manager.h" 28 #include "content/renderer/gpu/input_handler_manager.h"
28 #include "content/renderer/render_thread_impl.h" 29 #include "content/renderer/render_thread_impl.h"
29 #include "third_party/WebKit/public/platform/WebSize.h" 30 #include "third_party/WebKit/public/platform/WebSize.h"
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 layer_tree_host_->SetNeedsRedrawRect(damage_rect); 385 layer_tree_host_->SetNeedsRedrawRect(damage_rect);
385 } 386 }
386 387
387 void RenderWidgetCompositor::SetNeedsForcedRedraw() { 388 void RenderWidgetCompositor::SetNeedsForcedRedraw() {
388 layer_tree_host_->SetNextCommitForcesRedraw(); 389 layer_tree_host_->SetNextCommitForcesRedraw();
389 setNeedsAnimate(); 390 setNeedsAnimate();
390 } 391 }
391 392
392 void RenderWidgetCompositor::SetLatencyInfo( 393 void RenderWidgetCompositor::SetLatencyInfo(
393 const ui::LatencyInfo& latency_info) { 394 const ui::LatencyInfo& latency_info) {
394 layer_tree_host_->SetLatencyInfo(latency_info); 395 scoped_ptr<cc::SwapPromise> swap_promise(
396 new cc::LatencyInfoSwapPromise(latency_info));
397 layer_tree_host_->QueueSwapPromise(swap_promise.Pass());
395 } 398 }
396 399
397 int RenderWidgetCompositor::GetLayerTreeId() const { 400 int RenderWidgetCompositor::GetLayerTreeId() const {
398 return layer_tree_host_->id(); 401 return layer_tree_host_->id();
399 } 402 }
400 403
401 void RenderWidgetCompositor::NotifyInputThrottledUntilCommit() { 404 void RenderWidgetCompositor::NotifyInputThrottledUntilCommit() {
402 layer_tree_host_->NotifyInputThrottledUntilCommit(); 405 layer_tree_host_->NotifyInputThrottledUntilCommit();
403 } 406 }
404 407
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
660 widget_->OnSwapBuffersAborted(); 663 widget_->OnSwapBuffersAborted();
661 } 664 }
662 665
663 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { 666 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() {
664 cc::ContextProvider* provider = 667 cc::ContextProvider* provider =
665 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); 668 RenderThreadImpl::current()->SharedMainThreadContextProvider().get();
666 provider->Context3d()->rateLimitOffscreenContextCHROMIUM(); 669 provider->Context3d()->rateLimitOffscreenContextCHROMIUM();
667 } 670 }
668 671
669 } // namespace content 672 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_android.cc ('k') | ui/compositor/compositor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698