OLD | NEW |
---|---|
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 #ifndef CC_OUTPUT_SWAP_PROMISE_H_ | 5 #ifndef CC_OUTPUT_SWAP_PROMISE_H_ |
6 #define CC_OUTPUT_SWAP_PROMISE_H_ | 6 #define CC_OUTPUT_SWAP_PROMISE_H_ |
7 | 7 |
8 #include "cc/output/compositor_frame_metadata.h" | 8 #include "cc/output/compositor_frame_metadata.h" |
9 | 9 |
10 namespace cc { | 10 namespace cc { |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
54 virtual void DidActivate() = 0; | 54 virtual void DidActivate() = 0; |
55 virtual void DidSwap(CompositorFrameMetadata* metadata) = 0; | 55 virtual void DidSwap(CompositorFrameMetadata* metadata) = 0; |
56 virtual void DidNotSwap(DidNotSwapReason reason) = 0; | 56 virtual void DidNotSwap(DidNotSwapReason reason) = 0; |
57 // This is called when the main thread starts a (blocking) commit | 57 // This is called when the main thread starts a (blocking) commit |
58 virtual void OnCommit() {} | 58 virtual void OnCommit() {} |
59 | 59 |
60 // A non-zero trace id identifies a trace flow object that is embedded in the | 60 // A non-zero trace id identifies a trace flow object that is embedded in the |
61 // swap promise. This can be used for registering additional flow steps to | 61 // swap promise. This can be used for registering additional flow steps to |
62 // visualize the object's path through the system. | 62 // visualize the object's path through the system. |
63 virtual int64 TraceId() const = 0; | 63 virtual int64 TraceId() const = 0; |
64 | |
65 static std::string DidNotSwapReasonToString(DidNotSwapReason reason) { | |
Sami
2015/08/18 11:19:18
Is this used anywhere?
nit: this could just be a
Tobias Sargeant
2015/08/18 13:39:52
It isn't. It was useful during debugging the unitt
| |
66 switch (reason) { | |
67 case SWAP_FAILS: | |
68 return "SWAP_FAILS"; | |
69 case COMMIT_FAILS: | |
70 return "COMMIT_FAILS"; | |
71 case COMMIT_NO_UPDATE: | |
72 return "COMMIT_NO_UPDATE"; | |
73 case ACTIVATION_FAILS: | |
74 return "ACTIVATION_FAILS"; | |
75 default: | |
76 NOTREACHED(); | |
77 return ""; | |
78 } | |
79 } | |
64 }; | 80 }; |
65 | 81 |
66 } // namespace cc | 82 } // namespace cc |
67 | 83 |
68 #endif // CC_OUTPUT_SWAP_PROMISE_H_ | 84 #endif // CC_OUTPUT_SWAP_PROMISE_H_ |
OLD | NEW |