| 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/base/latency_info_swap_promise.h" | 5 #include "cc/base/latency_info_swap_promise.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 | 8 |
| 9 namespace { | 9 namespace { |
| 10 ui::LatencyComponentType DidNotSwapReasonToLatencyComponentType( | 10 ui::LatencyComponentType DidNotSwapReasonToLatencyComponentType( |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 namespace cc { | 26 namespace cc { |
| 27 | 27 |
| 28 LatencyInfoSwapPromise::LatencyInfoSwapPromise(const ui::LatencyInfo& latency) | 28 LatencyInfoSwapPromise::LatencyInfoSwapPromise(const ui::LatencyInfo& latency) |
| 29 : latency_(latency) { | 29 : latency_(latency) { |
| 30 } | 30 } |
| 31 | 31 |
| 32 LatencyInfoSwapPromise::~LatencyInfoSwapPromise() { | 32 LatencyInfoSwapPromise::~LatencyInfoSwapPromise() { |
| 33 } | 33 } |
| 34 | 34 |
| 35 void LatencyInfoSwapPromise::DidSwap(CompositorFrameMetadata* metadata) { | 35 void LatencyInfoSwapPromise::DidSwap(int source_frame_number, |
| 36 CompositorFrameMetadata* metadata) { |
| 36 DCHECK(!latency_.terminated); | 37 DCHECK(!latency_.terminated); |
| 37 metadata->latency_info.push_back(latency_); | 38 metadata->latency_info.push_back(latency_); |
| 38 } | 39 } |
| 39 | 40 |
| 40 void LatencyInfoSwapPromise::DidNotSwap(DidNotSwapReason reason) { | 41 void LatencyInfoSwapPromise::DidNotSwap(DidNotSwapReason reason) { |
| 41 latency_.AddLatencyNumber(DidNotSwapReasonToLatencyComponentType(reason), | 42 latency_.AddLatencyNumber(DidNotSwapReasonToLatencyComponentType(reason), |
| 42 0, 0); | 43 0, 0); |
| 43 // TODO(miletus): Turn this back on once per-event LatencyInfo tracking | 44 // TODO(miletus): Turn this back on once per-event LatencyInfo tracking |
| 44 // is enabled in GPU side. | 45 // is enabled in GPU side. |
| 45 // DCHECK(latency_.terminated); | 46 // DCHECK(latency_.terminated); |
| 46 } | 47 } |
| 47 | 48 |
| 48 } // namespace cc | 49 } // namespace cc |
| OLD | NEW |