| OLD | NEW |
| 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 <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/threading/platform_thread.h" | 9 #include "base/threading/platform_thread.h" |
| 10 #include "cc/output/latency_info_swap_promise.h" | 10 #include "cc/output/latency_info_swap_promise.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 latency_info->trace_id()); | 35 latency_info->trace_id()); |
| 36 return true; | 36 return true; |
| 37 } | 37 } |
| 38 | 38 |
| 39 } // namespace | 39 } // namespace |
| 40 | 40 |
| 41 namespace cc { | 41 namespace cc { |
| 42 | 42 |
| 43 LatencyInfoSwapPromiseMonitor::LatencyInfoSwapPromiseMonitor( | 43 LatencyInfoSwapPromiseMonitor::LatencyInfoSwapPromiseMonitor( |
| 44 ui::LatencyInfo* latency, | 44 ui::LatencyInfo* latency, |
| 45 LayerTreeHost* layer_tree_host, | 45 LayerTreeHostInterface* layer_tree_host, |
| 46 LayerTreeHostImpl* layer_tree_host_impl) | 46 LayerTreeHostImpl* layer_tree_host_impl) |
| 47 : SwapPromiseMonitor(layer_tree_host, layer_tree_host_impl), | 47 : SwapPromiseMonitor(layer_tree_host, layer_tree_host_impl), |
| 48 latency_(latency) { | 48 latency_(latency) {} |
| 49 } | |
| 50 | 49 |
| 51 LatencyInfoSwapPromiseMonitor::~LatencyInfoSwapPromiseMonitor() { | 50 LatencyInfoSwapPromiseMonitor::~LatencyInfoSwapPromiseMonitor() { |
| 52 } | 51 } |
| 53 | 52 |
| 54 void LatencyInfoSwapPromiseMonitor::OnSetNeedsCommitOnMain() { | 53 void LatencyInfoSwapPromiseMonitor::OnSetNeedsCommitOnMain() { |
| 55 if (AddRenderingScheduledComponent(latency_, true /* on_main */)) { | 54 if (AddRenderingScheduledComponent(latency_, true /* on_main */)) { |
| 56 std::unique_ptr<SwapPromise> swap_promise( | 55 std::unique_ptr<SwapPromise> swap_promise( |
| 57 new LatencyInfoSwapPromise(*latency_)); | 56 new LatencyInfoSwapPromise(*latency_)); |
| 58 layer_tree_host_->QueueSwapPromise(std::move(swap_promise)); | 57 layer_tree_host_->QueueSwapPromise(std::move(swap_promise)); |
| 59 } | 58 } |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 *latency_, | 97 *latency_, |
| 99 ui::INPUT_EVENT_LATENCY_FORWARD_SCROLL_UPDATE_TO_MAIN_COMPONENT); | 98 ui::INPUT_EVENT_LATENCY_FORWARD_SCROLL_UPDATE_TO_MAIN_COMPONENT); |
| 100 std::unique_ptr<SwapPromise> swap_promise( | 99 std::unique_ptr<SwapPromise> swap_promise( |
| 101 new LatencyInfoSwapPromise(new_latency)); | 100 new LatencyInfoSwapPromise(new_latency)); |
| 102 layer_tree_host_impl_->QueueSwapPromiseForMainThreadScrollUpdate( | 101 layer_tree_host_impl_->QueueSwapPromiseForMainThreadScrollUpdate( |
| 103 std::move(swap_promise)); | 102 std::move(swap_promise)); |
| 104 } | 103 } |
| 105 } | 104 } |
| 106 | 105 |
| 107 } // namespace cc | 106 } // namespace cc |
| OLD | NEW |