blob: 6675aae797a27d06db6089b924d6d46cfdd9479d [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;
Yiwei Zhang068e31b2018-02-21 13:02:45 -080010 optional SizeProto resolution = 2;
chaviw1d044282017-09-27 12:19:28 -070011}
12
13// Information about each layer.
14message LayerProto {
15 // unique id per layer.
16 optional int32 id = 1;
17 // unique name per layer.
18 optional string name = 2;
19 // list of children this layer may have. May be empty.
20 repeated int32 children = 3;
21 // list of layers that are z order relative to this layer.
22 repeated int32 relatives = 4;
23 // The type of layer, ex Color, Layer
24 optional string type = 5;
25 optional RegionProto transparent_region = 6;
26 optional RegionProto visible_region = 7;
27 optional RegionProto damage_region = 8;
28 optional uint32 layer_stack = 9;
29 // The layer's z order. Can be z order in layer stack, relative to parent,
30 // or relative to another layer specified in zOrderRelative.
31 optional int32 z = 10;
32 // The layer's position on the display.
33 optional PositionProto position = 11;
34 // The layer's requested position.
35 optional PositionProto requested_position = 12;
36 // The layer's size.
37 optional SizeProto size = 13;
38 // The layer's crop in it's own bounds.
39 optional RectProto crop = 14;
40 // The layer's crop in it's parent's bounds.
41 optional RectProto final_crop = 15;
42 optional bool is_opaque = 16;
43 optional bool invalidate = 17;
44 optional string dataspace = 18;
45 optional string pixel_format = 19;
46 // The layer's actual color.
47 optional ColorProto color = 20;
48 // The layer's requested color.
49 optional ColorProto requested_color = 21;
50 // Can be any combination of
51 // hidden = 0x01
52 // opaque = 0x02,
53 // secure = 0x80,
54 optional uint32 flags = 22;
55 // The layer's actual transform
56 optional TransformProto transform = 23;
57 // The layer's requested transform.
58 optional TransformProto requested_transform = 24;
59 // The parent layer. This value can be null if there is no parent.
60 optional int32 parent = 25 [default = -1];
61 // The layer that this layer has a z order relative to. This value can be null.
62 optional int32 z_order_relative_of = 26 [default = -1];
63 // This value can be null if there's nothing to draw.
64 optional ActiveBufferProto active_buffer = 27;
65 // The number of frames available.
66 optional int32 queued_frames = 28;
67 optional bool refresh_pending = 29;
Yiwei Zhang068e31b2018-02-21 13:02:45 -080068 // The layer's composer backend destination frame
69 optional RectProto hwc_frame = 30;
70 // The layer's composer backend source crop
71 optional FloatRectProto hwc_crop = 31;
72 // The layer's composer backend transform
73 optional int32 hwc_transform = 32;
74 optional int32 window_type = 33;
75 optional int32 app_id = 34;
chaviw1d044282017-09-27 12:19:28 -070076}
77
78message PositionProto {
79 optional float x = 1;
80 optional float y = 2;
81}
82
83message SizeProto {
84 optional int32 w = 1;
85 optional int32 h = 2;
86}
87
88message TransformProto {
89 optional float dsdx = 1;
90 optional float dtdx = 2;
91 optional float dsdy = 3;
92 optional float dtdy = 4;
93}
94
95message RegionProto {
96 optional uint64 id = 1;
97 repeated RectProto rect = 2;
98}
99
100message RectProto {
101 optional int32 left = 1;
102 optional int32 top = 2;
103 optional int32 right = 3;
104 optional int32 bottom = 4;
105}
106
Yiwei Zhang068e31b2018-02-21 13:02:45 -0800107message FloatRectProto {
108 optional float left = 1;
109 optional float top = 2;
110 optional float right = 3;
111 optional float bottom = 4;
112}
113
chaviw1d044282017-09-27 12:19:28 -0700114message ActiveBufferProto {
115 optional uint32 width = 1;
116 optional uint32 height = 2;
117 optional uint32 stride = 3;
118 optional int32 format = 4;
119}
120
121message ColorProto {
122 optional float r = 1;
123 optional float g = 2;
124 optional float b = 3;
125 optional float a = 4;
Yiwei Zhang068e31b2018-02-21 13:02:45 -0800126}