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 ForcedRedrawSwapPromise::~ForcedRedrawSwapPromise() = default; |
| 16 |
| 17 void ForcedRedrawSwapPromise::DidSwap(CompositorFrameMetadata* metadata) { |
| 18 DCHECK(!latency_.terminated()); |
| 19 metadata->latency_info.push_back(latency_); |
| 20 } |
| 21 |
| 22 SwapPromise::DidNotSwapAction ForcedRedrawSwapPromise::DidNotSwap( |
| 23 DidNotSwapReason reason) { |
| 24 return reason == DidNotSwapReason::SWAP_FAILS |
| 25 ? DidNotSwapAction::KEEP_ACTIVE |
| 26 : DidNotSwapAction::DEFAULT_ACTION; |
| 27 } |
| 28 |
| 29 int64_t ForcedRedrawSwapPromise::TraceId() const { |
| 30 return latency_.trace_id(); |
| 31 } |
| 32 |
| 33 } // namespace cc |
OLD | NEW |