blob: c141ee3cab4fc7c4b2cf9f4d677490c37e376bbe [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;
Yiwei Zhang60d1a192018-03-07 14:52:28 -080011 optional string color_mode = 3;
12 optional string color_transform = 4;
13 optional int32 global_transform = 5;
chaviw1d044282017-09-27 12:19:28 -070014}
15
16// Information about each layer.
17message LayerProto {
18 // unique id per layer.
19 optional int32 id = 1;
20 // unique name per layer.
21 optional string name = 2;
22 // list of children this layer may have. May be empty.
23 repeated int32 children = 3;
24 // list of layers that are z order relative to this layer.
25 repeated int32 relatives = 4;
26 // The type of layer, ex Color, Layer
27 optional string type = 5;
28 optional RegionProto transparent_region = 6;
29 optional RegionProto visible_region = 7;
30 optional RegionProto damage_region = 8;
31 optional uint32 layer_stack = 9;
32 // The layer's z order. Can be z order in layer stack, relative to parent,
33 // or relative to another layer specified in zOrderRelative.
34 optional int32 z = 10;
35 // The layer's position on the display.
36 optional PositionProto position = 11;
37 // The layer's requested position.
38 optional PositionProto requested_position = 12;
39 // The layer's size.
40 optional SizeProto size = 13;
41 // The layer's crop in it's own bounds.
42 optional RectProto crop = 14;
43 // The layer's crop in it's parent's bounds.
Vishnu Nairdcce0e22018-08-23 08:35:19 -070044 optional RectProto final_crop = 15 [deprecated=true];
chaviw1d044282017-09-27 12:19:28 -070045 optional bool is_opaque = 16;
46 optional bool invalidate = 17;
47 optional string dataspace = 18;
48 optional string pixel_format = 19;
49 // The layer's actual color.
50 optional ColorProto color = 20;
51 // The layer's requested color.
52 optional ColorProto requested_color = 21;
53 // Can be any combination of
54 // hidden = 0x01
55 // opaque = 0x02,
56 // secure = 0x80,
57 optional uint32 flags = 22;
58 // The layer's actual transform
59 optional TransformProto transform = 23;
60 // The layer's requested transform.
61 optional TransformProto requested_transform = 24;
62 // The parent layer. This value can be null if there is no parent.
63 optional int32 parent = 25 [default = -1];
64 // The layer that this layer has a z order relative to. This value can be null.
65 optional int32 z_order_relative_of = 26 [default = -1];
66 // This value can be null if there's nothing to draw.
67 optional ActiveBufferProto active_buffer = 27;
68 // The number of frames available.
69 optional int32 queued_frames = 28;
70 optional bool refresh_pending = 29;
Yiwei Zhang7124ad32018-02-21 13:02:45 -080071 // The layer's composer backend destination frame
72 optional RectProto hwc_frame = 30;
73 // The layer's composer backend source crop
74 optional FloatRectProto hwc_crop = 31;
75 // The layer's composer backend transform
76 optional int32 hwc_transform = 32;
rongliucfb187b2018-03-14 12:26:23 -070077 optional int32 window_type = 33;
78 optional int32 app_id = 34;
Yiwei Zhang60d1a192018-03-07 14:52:28 -080079 // The layer's composition type
80 optional int32 hwc_composition_type = 35;
81 // If it's a buffer layer, indicate if the content is protected
82 optional bool is_protected = 36;
chaviwadc40c22018-07-10 16:57:27 -070083 // Current frame number being rendered.
Vishnu Nair9978b932018-08-22 09:11:49 -070084 optional uint64 curr_frame = 37;
chaviwadc40c22018-07-10 16:57:27 -070085 // A list of barriers that the layer is waiting to update state.
Vishnu Nair9978b932018-08-22 09:11:49 -070086 repeated BarrierLayerProto barrier_layer = 38;
87 // If active_buffer is not null, record its transform.
88 optional TransformProto buffer_transform = 39;
Vishnu Nairf2deb822018-11-12 17:53:48 -080089 optional int32 effective_scaling_mode = 40;
chaviw1d044282017-09-27 12:19:28 -070090}
91
92message PositionProto {
93 optional float x = 1;
94 optional float y = 2;
95}
96
97message SizeProto {
98 optional int32 w = 1;
99 optional int32 h = 2;
100}
101
102message TransformProto {
103 optional float dsdx = 1;
104 optional float dtdx = 2;
105 optional float dsdy = 3;
106 optional float dtdy = 4;
107}
108
109message RegionProto {
110 optional uint64 id = 1;
111 repeated RectProto rect = 2;
112}
113
114message RectProto {
115 optional int32 left = 1;
116 optional int32 top = 2;
117 optional int32 right = 3;
118 optional int32 bottom = 4;
119}
120
Yiwei Zhang7124ad32018-02-21 13:02:45 -0800121message FloatRectProto {
122 optional float left = 1;
123 optional float top = 2;
124 optional float right = 3;
125 optional float bottom = 4;
126}
127
chaviw1d044282017-09-27 12:19:28 -0700128message ActiveBufferProto {
129 optional uint32 width = 1;
130 optional uint32 height = 2;
131 optional uint32 stride = 3;
132 optional int32 format = 4;
133}
134
135message ColorProto {
136 optional float r = 1;
137 optional float g = 2;
138 optional float b = 3;
139 optional float a = 4;
Yiwei Zhang7124ad32018-02-21 13:02:45 -0800140}
chaviwadc40c22018-07-10 16:57:27 -0700141
142message BarrierLayerProto {
143 // layer id the barrier is waiting on.
144 optional int32 id = 1;
145 // frame number the barrier is waiting on.
146 optional uint64 frame_number = 2;
147}