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

Side by Side Diff: cc/trees/latency_info_swap_promise_monitor.cc

Issue 1292773003: Queue latency info swap promises in a separate already-active queue. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use different return value for failed draw in test, to avoid NOTREACHED() Created 5 years, 3 months 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
« no previous file with comments | « cc/layers/surface_layer_unittest.cc ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 "cc/trees/latency_info_swap_promise_monitor.h" 5 #include "cc/trees/latency_info_swap_promise_monitor.h"
6 6
7 #include "base/threading/platform_thread.h" 7 #include "base/threading/platform_thread.h"
8 #include "cc/output/latency_info_swap_promise.h" 8 #include "cc/output/latency_info_swap_promise.h"
9 #include "cc/trees/layer_tree_host.h" 9 #include "cc/trees/layer_tree_host.h"
10 #include "cc/trees/layer_tree_host_impl.h" 10 #include "cc/trees/layer_tree_host_impl.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 void LatencyInfoSwapPromiseMonitor::OnSetNeedsCommitOnMain() { 52 void LatencyInfoSwapPromiseMonitor::OnSetNeedsCommitOnMain() {
53 if (AddRenderingScheduledComponent(latency_, true /* on_main */)) { 53 if (AddRenderingScheduledComponent(latency_, true /* on_main */)) {
54 scoped_ptr<SwapPromise> swap_promise(new LatencyInfoSwapPromise(*latency_)); 54 scoped_ptr<SwapPromise> swap_promise(new LatencyInfoSwapPromise(*latency_));
55 layer_tree_host_->QueueSwapPromise(swap_promise.Pass()); 55 layer_tree_host_->QueueSwapPromise(swap_promise.Pass());
56 } 56 }
57 } 57 }
58 58
59 void LatencyInfoSwapPromiseMonitor::OnSetNeedsRedrawOnImpl() { 59 void LatencyInfoSwapPromiseMonitor::OnSetNeedsRedrawOnImpl() {
60 if (AddRenderingScheduledComponent(latency_, false /* on_main */)) { 60 if (AddRenderingScheduledComponent(latency_, false /* on_main */)) {
61 scoped_ptr<SwapPromise> swap_promise(new LatencyInfoSwapPromise(*latency_)); 61 scoped_ptr<SwapPromise> swap_promise(new LatencyInfoSwapPromise(*latency_));
62 layer_tree_host_impl_->active_tree()->QueueSwapPromise(swap_promise.Pass()); 62 // Queue a pinned swap promise on the active tree. This will allow
63 // measurement of the time to the next SwapBuffers(). The swap
64 // promise is pinned so that it is not interrupted by new incoming
65 // activations (which would otherwise break the swap promise).
66 layer_tree_host_impl_->active_tree()->QueuePinnedSwapPromise(
67 swap_promise.Pass());
63 } 68 }
64 } 69 }
65 70
66 void LatencyInfoSwapPromiseMonitor::OnForwardScrollUpdateToMainThreadOnImpl() { 71 void LatencyInfoSwapPromiseMonitor::OnForwardScrollUpdateToMainThreadOnImpl() {
67 if (AddForwardingScrollUpdateToMainComponent(latency_)) { 72 if (AddForwardingScrollUpdateToMainComponent(latency_)) {
68 int64 new_sequence_number = 0; 73 int64 new_sequence_number = 0;
69 for (ui::LatencyInfo::LatencyMap::const_iterator it = 74 for (ui::LatencyInfo::LatencyMap::const_iterator it =
70 latency_->latency_components().begin(); 75 latency_->latency_components().begin();
71 it != latency_->latency_components().end(); ++it) { 76 it != latency_->latency_components().end(); ++it) {
72 if (it->first.first == ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT) { 77 if (it->first.first == ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT) {
(...skipping 16 matching lines...) Expand all
89 *latency_, 94 *latency_,
90 ui::INPUT_EVENT_LATENCY_FORWARD_SCROLL_UPDATE_TO_MAIN_COMPONENT); 95 ui::INPUT_EVENT_LATENCY_FORWARD_SCROLL_UPDATE_TO_MAIN_COMPONENT);
91 scoped_ptr<SwapPromise> swap_promise( 96 scoped_ptr<SwapPromise> swap_promise(
92 new LatencyInfoSwapPromise(new_latency)); 97 new LatencyInfoSwapPromise(new_latency));
93 layer_tree_host_impl_->QueueSwapPromiseForMainThreadScrollUpdate( 98 layer_tree_host_impl_->QueueSwapPromiseForMainThreadScrollUpdate(
94 swap_promise.Pass()); 99 swap_promise.Pass());
95 } 100 }
96 } 101 }
97 102
98 } // namespace cc 103 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/surface_layer_unittest.cc ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698