blob: d27dc9b2eacbf9f14ada914fd867af95a1d6d85a [file] [log] [blame]
chaviw1d044282017-09-27 12:19:28 -07001// Definitions for SurfaceFlinger layers.
2
3syntax = "proto2";
4option optimize_for = LITE_RUNTIME;
5package android.surfaceflinger;
6
7// Contains a list of all layers.
8message LayersProto {
9 repeated LayerProto layers = 1;
10}
11
12// Information about each layer.
13message LayerProto {
14 // unique id per layer.
15 optional int32 id = 1;
16 // unique name per layer.
17 optional string name = 2;
18 // list of children this layer may have. May be empty.
19 repeated int32 children = 3;
20 // list of layers that are z order relative to this layer.
21 repeated int32 relatives = 4;
22 // The type of layer, ex Color, Layer
23 optional string type = 5;
24 optional RegionProto transparent_region = 6;
25 optional RegionProto visible_region = 7;
26 optional RegionProto damage_region = 8;
27 optional uint32 layer_stack = 9;
28 // The layer's z order. Can be z order in layer stack, relative to parent,
29 // or relative to another layer specified in zOrderRelative.
30 optional int32 z = 10;
31 // The layer's position on the display.
32 optional PositionProto position = 11;
33 // The layer's requested position.
34 optional PositionProto requested_position = 12;
35 // The layer's size.
36 optional SizeProto size = 13;
37 // The layer's crop in it's own bounds.
38 optional RectProto crop = 14;
39 // The layer's crop in it's parent's bounds.
40 optional RectProto final_crop = 15;
41 optional bool is_opaque = 16;
42 optional bool invalidate = 17;
43 optional string dataspace = 18;
44 optional string pixel_format = 19;
45 // The layer's actual color.
46 optional ColorProto color = 20;
47 // The layer's requested color.
48 optional ColorProto requested_color = 21;
49 // Can be any combination of
50 // hidden = 0x01
51 // opaque = 0x02,
52 // secure = 0x80,
53 optional uint32 flags = 22;
54 // The layer's actual transform
55 optional TransformProto transform = 23;
56 // The layer's requested transform.
57 optional TransformProto requested_transform = 24;
58 // The parent layer. This value can be null if there is no parent.
59 optional int32 parent = 25 [default = -1];
60 // The layer that this layer has a z order relative to. This value can be null.
61 optional int32 z_order_relative_of = 26 [default = -1];
62 // This value can be null if there's nothing to draw.
63 optional ActiveBufferProto active_buffer = 27;
64 // The number of frames available.
65 optional int32 queued_frames = 28;
66 optional bool refresh_pending = 29;
67}
68
69message PositionProto {
70 optional float x = 1;
71 optional float y = 2;
72}
73
74message SizeProto {
75 optional int32 w = 1;
76 optional int32 h = 2;
77}
78
79message TransformProto {
80 optional float dsdx = 1;
81 optional float dtdx = 2;
82 optional float dsdy = 3;
83 optional float dtdy = 4;
84}
85
86message RegionProto {
87 optional uint64 id = 1;
88 repeated RectProto rect = 2;
89}
90
91message RectProto {
92 optional int32 left = 1;
93 optional int32 top = 2;
94 optional int32 right = 3;
95 optional int32 bottom = 4;
96}
97
98message ActiveBufferProto {
99 optional uint32 width = 1;
100 optional uint32 height = 2;
101 optional uint32 stride = 3;
102 optional int32 format = 4;
103}
104
105message ColorProto {
106 optional float r = 1;
107 optional float g = 2;
108 optional float b = 3;
109 optional float a = 4;
110}