Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: cc/output/latency_info_swap_promise.cc

Issue 1013463003: Update from https://crrev.com/320931 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/output/latency_info_swap_promise.h ('k') | cc/output/overlay_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/output/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(
11 cc::SwapPromise::DidNotSwapReason reason) { 11 cc::SwapPromise::DidNotSwapReason reason) {
12 switch (reason) { 12 switch (reason) {
13 case cc::SwapPromise::DID_NOT_SWAP_UNKNOWN: 13 case cc::SwapPromise::DID_NOT_SWAP_UNKNOWN:
14 case cc::SwapPromise::SWAP_FAILS: 14 case cc::SwapPromise::SWAP_FAILS:
15 return ui::INPUT_EVENT_LATENCY_TERMINATED_SWAP_FAILED_COMPONENT; 15 return ui::INPUT_EVENT_LATENCY_TERMINATED_SWAP_FAILED_COMPONENT;
16 case cc::SwapPromise::COMMIT_FAILS: 16 case cc::SwapPromise::COMMIT_FAILS:
17 return ui::INPUT_EVENT_LATENCY_TERMINATED_COMMIT_FAILED_COMPONENT; 17 return ui::INPUT_EVENT_LATENCY_TERMINATED_COMMIT_FAILED_COMPONENT;
18 case cc::SwapPromise::COMMIT_NO_UPDATE: 18 case cc::SwapPromise::COMMIT_NO_UPDATE:
19 return ui::INPUT_EVENT_LATENCY_TERMINATED_COMMIT_NO_UPDATE_COMPONENT; 19 return ui::INPUT_EVENT_LATENCY_TERMINATED_COMMIT_NO_UPDATE_COMPONENT;
20 }
21 NOTREACHED() << "Unhandled DidNotSwapReason.";
22 return ui::INPUT_EVENT_LATENCY_TERMINATED_SWAP_FAILED_COMPONENT;
23 } 20 }
21 NOTREACHED() << "Unhandled DidNotSwapReason.";
22 return ui::INPUT_EVENT_LATENCY_TERMINATED_SWAP_FAILED_COMPONENT;
23 }
24 } // namespace 24 } // namespace
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(CompositorFrameMetadata* metadata) {
36 DCHECK(!latency_.terminated); 36 DCHECK(!latency_.terminated);
37 metadata->latency_info.push_back(latency_); 37 metadata->latency_info.push_back(latency_);
38 } 38 }
39 39
40 void LatencyInfoSwapPromise::DidNotSwap(DidNotSwapReason reason) { 40 void LatencyInfoSwapPromise::DidNotSwap(DidNotSwapReason reason) {
41 latency_.AddLatencyNumber(DidNotSwapReasonToLatencyComponentType(reason), 41 latency_.AddLatencyNumber(DidNotSwapReasonToLatencyComponentType(reason), 0,
42 0, 0); 42 0);
43 // TODO(miletus): Turn this back on once per-event LatencyInfo tracking 43 // TODO(miletus): Turn this back on once per-event LatencyInfo tracking
44 // is enabled in GPU side. 44 // is enabled in GPU side.
45 // DCHECK(latency_.terminated); 45 // DCHECK(latency_.terminated);
46 } 46 }
47 47
48 int64 LatencyInfoSwapPromise::TraceId() const { 48 int64 LatencyInfoSwapPromise::TraceId() const {
49 return latency_.trace_id; 49 return latency_.trace_id;
50 } 50 }
51 51
52 } // namespace cc 52 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/latency_info_swap_promise.h ('k') | cc/output/overlay_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698