OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/scheduler/commit_earlyout_reason.h" | 5 #include "cc/scheduler/commit_earlyout_reason.h" |
6 | 6 |
7 #include "cc/proto/commit_earlyout_reason.pb.h" | 7 #include "cc/proto/commit_earlyout_reason.pb.h" |
8 | 8 |
9 namespace cc { | 9 namespace cc { |
10 | 10 |
11 CommitEarlyOutReason CommitEarlyOutReasonFromProtobuf( | 11 CommitEarlyOutReason CommitEarlyOutReasonFromProtobuf( |
12 const proto::CommitEarlyOutReason& proto) { | 12 const proto::CommitEarlyOutReason& proto) { |
13 switch (proto.reason()) { | 13 switch (proto.reason()) { |
14 case proto::CommitEarlyOutReason::ABORTED_OUTPUT_SURFACE_LOST: | 14 case proto::CommitEarlyOutReason::ABORTED_COMPOSITOR_FRAME_SINK_LOST: |
15 return CommitEarlyOutReason::ABORTED_OUTPUT_SURFACE_LOST; | 15 return CommitEarlyOutReason::ABORTED_COMPOSITOR_FRAME_SINK_LOST; |
16 case proto::CommitEarlyOutReason::ABORTED_NOT_VISIBLE: | 16 case proto::CommitEarlyOutReason::ABORTED_NOT_VISIBLE: |
17 return CommitEarlyOutReason::ABORTED_NOT_VISIBLE; | 17 return CommitEarlyOutReason::ABORTED_NOT_VISIBLE; |
18 case proto::CommitEarlyOutReason::ABORTED_DEFERRED_COMMIT: | 18 case proto::CommitEarlyOutReason::ABORTED_DEFERRED_COMMIT: |
19 return CommitEarlyOutReason::ABORTED_DEFERRED_COMMIT; | 19 return CommitEarlyOutReason::ABORTED_DEFERRED_COMMIT; |
20 case proto::CommitEarlyOutReason::FINISHED_NO_UPDATES: | 20 case proto::CommitEarlyOutReason::FINISHED_NO_UPDATES: |
21 return CommitEarlyOutReason::FINISHED_NO_UPDATES; | 21 return CommitEarlyOutReason::FINISHED_NO_UPDATES; |
22 } | 22 } |
23 NOTREACHED(); | 23 NOTREACHED(); |
24 return CommitEarlyOutReason::ABORTED_OUTPUT_SURFACE_LOST; | 24 return CommitEarlyOutReason::ABORTED_COMPOSITOR_FRAME_SINK_LOST; |
25 } | 25 } |
26 | 26 |
27 void CommitEarlyOutReasonToProtobuf(CommitEarlyOutReason reason, | 27 void CommitEarlyOutReasonToProtobuf(CommitEarlyOutReason reason, |
28 proto::CommitEarlyOutReason* proto) { | 28 proto::CommitEarlyOutReason* proto) { |
29 switch (reason) { | 29 switch (reason) { |
30 case CommitEarlyOutReason::ABORTED_OUTPUT_SURFACE_LOST: | 30 case CommitEarlyOutReason::ABORTED_COMPOSITOR_FRAME_SINK_LOST: |
31 proto->set_reason( | 31 proto->set_reason( |
32 proto::CommitEarlyOutReason::ABORTED_OUTPUT_SURFACE_LOST); | 32 proto::CommitEarlyOutReason::ABORTED_COMPOSITOR_FRAME_SINK_LOST); |
33 return; | 33 return; |
34 case CommitEarlyOutReason::ABORTED_NOT_VISIBLE: | 34 case CommitEarlyOutReason::ABORTED_NOT_VISIBLE: |
35 proto->set_reason(proto::CommitEarlyOutReason::ABORTED_NOT_VISIBLE); | 35 proto->set_reason(proto::CommitEarlyOutReason::ABORTED_NOT_VISIBLE); |
36 return; | 36 return; |
37 case CommitEarlyOutReason::ABORTED_DEFERRED_COMMIT: | 37 case CommitEarlyOutReason::ABORTED_DEFERRED_COMMIT: |
38 proto->set_reason(proto::CommitEarlyOutReason::ABORTED_DEFERRED_COMMIT); | 38 proto->set_reason(proto::CommitEarlyOutReason::ABORTED_DEFERRED_COMMIT); |
39 return; | 39 return; |
40 case CommitEarlyOutReason::FINISHED_NO_UPDATES: | 40 case CommitEarlyOutReason::FINISHED_NO_UPDATES: |
41 proto->set_reason(proto::CommitEarlyOutReason::FINISHED_NO_UPDATES); | 41 proto->set_reason(proto::CommitEarlyOutReason::FINISHED_NO_UPDATES); |
42 return; | 42 return; |
43 } | 43 } |
44 NOTREACHED(); | 44 NOTREACHED(); |
45 } | 45 } |
46 | 46 |
47 } // namespace cc | 47 } // namespace cc |
OLD | NEW |