blob: f9346d8737043cf4d74bdfd86a5418f98c53e4bc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CC_SCHEDULER_COMMIT_EARLYOUT_REASON_H_
#define CC_SCHEDULER_COMMIT_EARLYOUT_REASON_H_
#include "base/logging.h"
#include "cc/base/cc_export.h"
namespace cc {
namespace proto {
class CommitEarlyOutReason;
}
enum class CommitEarlyOutReason {
ABORTED_OUTPUT_SURFACE_LOST,
ABORTED_NOT_VISIBLE,
ABORTED_DEFERRED_COMMIT,
FINISHED_NO_UPDATES,
};
// Please update the To/From Protobuf methods for any updates made to
// CommitEarlyOutReason enum.
CC_EXPORT CommitEarlyOutReason
CommitEarlyOutReasonFromProtobuf(const proto::CommitEarlyOutReason& proto);
CC_EXPORT void CommitEarlyOutReasonToProtobuf(
CommitEarlyOutReason reason,
proto::CommitEarlyOutReason* proto);
inline const char* CommitEarlyOutReasonToString(CommitEarlyOutReason reason) {
switch (reason) {
case CommitEarlyOutReason::ABORTED_OUTPUT_SURFACE_LOST:
return "CommitEarlyOutReason::ABORTED_OUTPUT_SURFACE_LOST";
case CommitEarlyOutReason::ABORTED_NOT_VISIBLE:
return "CommitEarlyOutReason::ABORTED_NOT_VISIBLE";
case CommitEarlyOutReason::ABORTED_DEFERRED_COMMIT:
return "CommitEarlyOutReason::ABORTED_DEFERRED_COMMIT";
case CommitEarlyOutReason::FINISHED_NO_UPDATES:
return "CommitEarlyOutReason::FINISHED_NO_UPDATES";
}
NOTREACHED();
return "???";
}
inline bool CommitEarlyOutHandledCommit(CommitEarlyOutReason reason) {
return reason == CommitEarlyOutReason::FINISHED_NO_UPDATES;
}
} // namespace cc
#endif // CC_SCHEDULER_COMMIT_EARLYOUT_REASON_H_
|