blob: e232f055fc89248ce65def4d014fd6088d910637 [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 Zhang7124ad32018-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 Zhang7124ad32018-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;
chaviw1d044282017-09-27 12:19:28 -070074}
75
76message PositionProto {
77 optional float x = 1;
78 optional float y = 2;
79}
80
81message SizeProto {
82 optional int32 w = 1;
83 optional int32 h = 2;
84}
85
86message TransformProto {
87 optional float dsdx = 1;
88 optional float dtdx = 2;
89 optional float dsdy = 3;
90 optional float dtdy = 4;
91}
92
93message RegionProto {
94 optional uint64 id = 1;
95 repeated RectProto rect = 2;
96}
97
98message RectProto {
99 optional int32 left = 1;
100 optional int32 top = 2;
101 optional int32 right = 3;
102 optional int32 bottom = 4;
103}
104
Yiwei Zhang7124ad32018-02-21 13:02:45 -0800105message FloatRectProto {
106 optional float left = 1;
107 optional float top = 2;
108 optional float right = 3;
109 optional float bottom = 4;
110}
111
chaviw1d044282017-09-27 12:19:28 -0700112message ActiveBufferProto {
113 optional uint32 width = 1;
114 optional uint32 height = 2;
115 optional uint32 stride = 3;
116 optional int32 format = 4;
117}
118
119message ColorProto {
120 optional float r = 1;
121 optional float g = 2;
122 optional float b = 3;
123 optional float a = 4;
Yiwei Zhang7124ad32018-02-21 13:02:45 -0800124}