OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "cc/output/forced_redraw_swap_promise.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 #include "base/trace_event/trace_event.h" |
| 9 |
| 10 namespace cc { |
| 11 |
| 12 ForcedRedrawSwapPromise::ForcedRedrawSwapPromise(const ui::LatencyInfo& latency) |
| 13 : latency_(latency) { |
| 14 } |
| 15 |
| 16 ForcedRedrawSwapPromise::~ForcedRedrawSwapPromise() = default; |
| 17 |
| 18 void ForcedRedrawSwapPromise::DidSwap(CompositorFrameMetadata* metadata) { |
| 19 DCHECK(!latency_.terminated()); |
| 20 metadata->latency_info.push_back(latency_); |
| 21 } |
| 22 |
| 23 bool ForcedRedrawSwapPromise::DidNotSwap(DidNotSwapReason reason) { |
| 24 return reason == DidNotSwapReason::SWAP_FAILS; |
| 25 } |
| 26 |
| 27 int64_t ForcedRedrawSwapPromise::TraceId() const { |
| 28 return latency_.trace_id(); |
| 29 } |
| 30 |
| 31 } // namespace cc |
OLD | NEW |