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 module cc.mojom; | 5 module cc.mojom; |
6 | 6 |
7 // A surface ID is composed of three parts: a namespace, a local ID, and a | 7 // A surface id is composed of four parts: a gpu id, a client id, a local id, |
8 // nonce. The local part and nonce are allocated by the client using any scheme | 8 // and a nonce. The local part and nonce are allocated by the client using any |
9 // that avoids duplicates and makes IDs unguessable respectively. The namespace | 9 // scheme that avoids duplicates and makes ids unguessable respectively. The gpu |
10 // is allocated by the service and will be different for each client. | 10 // id is allocated by the service and uniquely identifies the generation of the |
11 // gpu service. The client id is allocated by the service and will be different | |
12 // for each client. | |
11 // | 13 // |
12 // The special id_namespace value 0 is equivalent to the namespace of the | 14 // The special gpu_id value 0 indicates software compositing. The special |
13 // client. This can be used to create, destroy and submit frames to | 15 // client_id value 0 is equivalent to the client id of the current client. This |
14 // surfaces before learning the namespace and to reference other surfaces | 16 // can be used to create, destroy and submit frames to surfaces before learning |
15 // owned by the same client. The actual id namespace must be used to pass | 17 // the namespace and to reference other surfaces owned by the same client. The |
16 // surface ids to other clients for them to reference. | 18 // actual client id must be used to pass surface ids to other clients for them |
19 // to reference. | |
17 struct SurfaceId { | 20 struct SurfaceId { |
18 // A service allocated ID identifying a client. | 21 // A service allocated id identifying the generation of the gpu service. |
19 uint32 id_namespace; | 22 // TODO(fsamuel): We don't need this if the display compositor always lives |
23 // in the same process as the gpu service. | |
piman
2016/07/12 20:57:19
TBH, I'm not sure that's true... This is to preven
Fady Samuel
2016/07/12 22:45:34
Well, I think I've confused myself. Really output_
| |
24 uint32 gpu_id; | |
25 | |
26 // A service allocated id identifying a client. | |
27 uint32 client_id; | |
20 | 28 |
21 // An identifier allocated by the client uniquely identifying a surface within | 29 // An identifier allocated by the client uniquely identifying a surface within |
22 // a client process. | 30 // a client process. |
23 uint32 local_id; | 31 uint32 local_id; |
24 | 32 |
25 // A cryptographically secure random int chosen to make the SurfaceId | 33 // A cryptographically secure random int chosen to make the SurfaceId |
26 // unguessable by other clients. | 34 // unguessable by other clients. |
27 uint64 nonce; | 35 uint64 nonce; |
28 }; | 36 }; |
OLD | NEW |