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 16 matching lines...) Expand all Loading... |
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(CompositorFrameMetadata* metadata) { |
36 DCHECK(!latency_.terminated); | 36 DCHECK(!latency_.terminated); |
37 // TODO(miletus): Append the |latency_| into metadata's LatencyInfo list | 37 metadata->latency_info.push_back(latency_); |
38 // once we remove LatencyInfo merge in GPU side. | |
39 metadata->latency_info.MergeWith(latency_); | |
40 } | 38 } |
41 | 39 |
42 void LatencyInfoSwapPromise::DidNotSwap(DidNotSwapReason reason) { | 40 void LatencyInfoSwapPromise::DidNotSwap(DidNotSwapReason reason) { |
43 latency_.AddLatencyNumber(DidNotSwapReasonToLatencyComponentType(reason), | 41 latency_.AddLatencyNumber(DidNotSwapReasonToLatencyComponentType(reason), |
44 0, 0); | 42 0, 0); |
45 // TODO(miletus): Turn this back on once per-event LatencyInfo tracking | 43 // TODO(miletus): Turn this back on once per-event LatencyInfo tracking |
46 // is enabled in GPU side. | 44 // is enabled in GPU side. |
47 // DCHECK(latency_.terminated); | 45 // DCHECK(latency_.terminated); |
48 } | 46 } |
49 | 47 |
50 } // namespace cc | 48 } // namespace cc |
OLD | NEW |