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

Side by Side Diff: cc/base/swap_promise.h

Issue 240163005: Deliver IPC messages together with SwapCompositorFrame (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
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 #ifndef CC_BASE_SWAP_PROMISE_H_ 5 #ifndef CC_BASE_SWAP_PROMISE_H_
6 #define CC_BASE_SWAP_PROMISE_H_ 6 #define CC_BASE_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 {
11 11
12 const unsigned int kMaxQueuedSwapPromiseNumber = 100;
13
14 // When a change to the compositor's state/invalidation/whatever happens, a 12 // When a change to the compositor's state/invalidation/whatever happens, a
15 // Swap Promise can be inserted into LayerTreeHost/LayerTreeImpl, to track 13 // Swap Promise can be inserted into LayerTreeHost/LayerTreeImpl, to track
16 // whether the compositor's reply to the new state/invaliadtion/whatever is 14 // whether the compositor's reply to the new state/invaliadtion/whatever is
17 // completed in the compositor, i.e. the compositor knows it has been sent 15 // completed in the compositor, i.e. the compositor knows it has been sent
18 // to its output or not. 16 // to its output or not.
19 // 17 //
20 // If the new compositor state is sent to the output, SwapPromise::DidSwap() 18 // If the new compositor state is sent to the output, SwapPromise::DidSwap()
21 // will be called, and if the compositor fails to send its new state to the 19 // will be called, and if the compositor fails to send its new state to the
22 // output, SwapPromise::DidNotSwap() will be called. 20 // output, SwapPromise::DidNotSwap() will be called.
23 // 21 //
(...skipping 10 matching lines...) Expand all
34 enum DidNotSwapReason { 32 enum DidNotSwapReason {
35 DID_NOT_SWAP_UNKNOWN, 33 DID_NOT_SWAP_UNKNOWN,
36 SWAP_FAILS, 34 SWAP_FAILS,
37 COMMIT_FAILS, 35 COMMIT_FAILS,
38 SWAP_PROMISE_LIST_OVERFLOW, 36 SWAP_PROMISE_LIST_OVERFLOW,
39 }; 37 };
40 38
41 SwapPromise() {} 39 SwapPromise() {}
42 virtual ~SwapPromise() {} 40 virtual ~SwapPromise() {}
43 41
44 virtual void DidSwap(CompositorFrameMetadata* metadata) = 0; 42 virtual void DidSwap(int source_frame_number,
43 CompositorFrameMetadata* metadata) = 0;
45 virtual void DidNotSwap(DidNotSwapReason reason) = 0; 44 virtual void DidNotSwap(DidNotSwapReason reason) = 0;
46 }; 45 };
47 46
48 } // namespace cc 47 } // namespace cc
49 48
50 #endif // CC_BASE_SWAP_PROMISE_H_ 49 #endif // CC_BASE_SWAP_PROMISE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698