| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "cc/output/compositor_frame_metadata.h" | 10 #include "cc/output/compositor_frame_metadata.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 COMMIT_FAILS, | 48 COMMIT_FAILS, |
| 49 COMMIT_NO_UPDATE, | 49 COMMIT_NO_UPDATE, |
| 50 ACTIVATION_FAILS, | 50 ACTIVATION_FAILS, |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 SwapPromise() {} | 53 SwapPromise() {} |
| 54 virtual ~SwapPromise() {} | 54 virtual ~SwapPromise() {} |
| 55 | 55 |
| 56 virtual void DidActivate() = 0; | 56 virtual void DidActivate() = 0; |
| 57 virtual void DidSwap(CompositorFrameMetadata* metadata) = 0; | 57 virtual void DidSwap(CompositorFrameMetadata* metadata) = 0; |
| 58 virtual void DidNotSwap(DidNotSwapReason reason) = 0; | 58 // Returns true if this promise should remain active (should not be broken by |
| 59 // the owner). |
| 60 virtual bool DidNotSwap(DidNotSwapReason reason) = 0; |
| 59 // This is called when the main thread starts a (blocking) commit | 61 // This is called when the main thread starts a (blocking) commit |
| 60 virtual void OnCommit() {} | 62 virtual void OnCommit() {} |
| 61 | 63 |
| 62 // A non-zero trace id identifies a trace flow object that is embedded in the | 64 // A non-zero trace id identifies a trace flow object that is embedded in the |
| 63 // swap promise. This can be used for registering additional flow steps to | 65 // swap promise. This can be used for registering additional flow steps to |
| 64 // visualize the object's path through the system. | 66 // visualize the object's path through the system. |
| 65 virtual int64_t TraceId() const = 0; | 67 virtual int64_t TraceId() const = 0; |
| 66 }; | 68 }; |
| 67 | 69 |
| 68 } // namespace cc | 70 } // namespace cc |
| 69 | 71 |
| 70 #endif // CC_OUTPUT_SWAP_PROMISE_H_ | 72 #endif // CC_OUTPUT_SWAP_PROMISE_H_ |
| OLD | NEW |