| 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/output/latency_info_swap_promise.h" | 5 #include "cc/output/latency_info_swap_promise.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 void LatencyInfoSwapPromise::WillSwap(CompositorFrameMetadata* metadata) { | 38 void LatencyInfoSwapPromise::WillSwap(CompositorFrameMetadata* metadata) { |
| 39 DCHECK(!latency_.terminated()); | 39 DCHECK(!latency_.terminated()); |
| 40 metadata->latency_info.push_back(latency_); | 40 metadata->latency_info.push_back(latency_); |
| 41 } | 41 } |
| 42 | 42 |
| 43 void LatencyInfoSwapPromise::DidSwap() {} | 43 void LatencyInfoSwapPromise::DidSwap() {} |
| 44 | 44 |
| 45 SwapPromise::DidNotSwapAction LatencyInfoSwapPromise::DidNotSwap( | 45 SwapPromise::DidNotSwapAction LatencyInfoSwapPromise::DidNotSwap( |
| 46 DidNotSwapReason reason) { | 46 DidNotSwapReason reason) { |
| 47 latency_.AddLatencyNumber(DidNotSwapReasonToLatencyComponentType(reason), 0, | 47 latency_.AddLatencyNumber(DidNotSwapReasonToLatencyComponentType(reason), 0); |
| 48 0); | |
| 49 // TODO(miletus): Turn this back on once per-event LatencyInfo tracking | 48 // TODO(miletus): Turn this back on once per-event LatencyInfo tracking |
| 50 // is enabled in GPU side. | 49 // is enabled in GPU side. |
| 51 // DCHECK(latency_.terminated); | 50 // DCHECK(latency_.terminated); |
| 52 return DidNotSwapAction::BREAK_PROMISE; | 51 return DidNotSwapAction::BREAK_PROMISE; |
| 53 } | 52 } |
| 54 | 53 |
| 55 int64_t LatencyInfoSwapPromise::TraceId() const { | 54 int64_t LatencyInfoSwapPromise::TraceId() const { |
| 56 return latency_.trace_id(); | 55 return latency_.trace_id(); |
| 57 } | 56 } |
| 58 | 57 |
| 59 // Trace the original LatencyInfo of a LatencyInfoSwapPromise | 58 // Trace the original LatencyInfo of a LatencyInfoSwapPromise |
| 60 void LatencyInfoSwapPromise::OnCommit() { | 59 void LatencyInfoSwapPromise::OnCommit() { |
| 61 TRACE_EVENT_WITH_FLOW1("input,benchmark", | 60 TRACE_EVENT_WITH_FLOW1("input,benchmark", |
| 62 "LatencyInfo.Flow", | 61 "LatencyInfo.Flow", |
| 63 TRACE_ID_DONT_MANGLE(TraceId()), | 62 TRACE_ID_DONT_MANGLE(TraceId()), |
| 64 TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, | 63 TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, |
| 65 "step", "HandleInputEventMainCommit"); | 64 "step", "HandleInputEventMainCommit"); |
| 66 } | 65 } |
| 67 | 66 |
| 68 } // namespace cc | 67 } // namespace cc |
| OLD | NEW |