blob: 23df1bbd2c43031c4688cc9e51e30b16c59314e6 [file] [log] [blame]
chaviw1d044282017-09-27 12:19:28 -07001// Definitions for SurfaceFlinger layers.
2
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -08003syntax = "proto3";
chaviw1d044282017-09-27 12:19:28 -07004option 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.
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080015 int32 id = 1;
chaviw1d044282017-09-27 12:19:28 -070016 // unique name per layer.
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080017 string name = 2;
chaviw1d044282017-09-27 12:19:28 -070018 // 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
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080023 string type = 5;
24 RegionProto transparent_region = 6;
25 RegionProto visible_region = 7;
26 RegionProto damage_region = 8;
27 uint32 layer_stack = 9;
chaviw1d044282017-09-27 12:19:28 -070028 // The layer's z order. Can be z order in layer stack, relative to parent,
29 // or relative to another layer specified in zOrderRelative.
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080030 int32 z = 10;
chaviw1d044282017-09-27 12:19:28 -070031 // The layer's position on the display.
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080032 PositionProto position = 11;
chaviw1d044282017-09-27 12:19:28 -070033 // The layer's requested position.
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080034 PositionProto requested_position = 12;
chaviw1d044282017-09-27 12:19:28 -070035 // The layer's size.
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080036 SizeProto size = 13;
chaviw1d044282017-09-27 12:19:28 -070037 // The layer's crop in it's own bounds.
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080038 RectProto crop = 14;
chaviw1d044282017-09-27 12:19:28 -070039 // The layer's crop in it's parent's bounds.
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080040 RectProto final_crop = 15 [deprecated=true];
41 bool is_opaque = 16;
42 bool invalidate = 17;
43 string dataspace = 18;
44 string pixel_format = 19;
chaviw1d044282017-09-27 12:19:28 -070045 // The layer's actual color.
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080046 ColorProto color = 20;
chaviw1d044282017-09-27 12:19:28 -070047 // The layer's requested color.
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080048 ColorProto requested_color = 21;
chaviw1d044282017-09-27 12:19:28 -070049 // Can be any combination of
50 // hidden = 0x01
51 // opaque = 0x02,
52 // secure = 0x80,
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080053 uint32 flags = 22;
chaviw1d044282017-09-27 12:19:28 -070054 // The layer's actual transform
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080055 TransformProto transform = 23;
chaviw1d044282017-09-27 12:19:28 -070056 // The layer's requested transform.
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080057 TransformProto requested_transform = 24;
chaviw1d044282017-09-27 12:19:28 -070058 // The parent layer. This value can be null if there is no parent.
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080059 int32 parent = 25;
chaviw1d044282017-09-27 12:19:28 -070060 // The layer that this layer has a z order relative to. This value can be null.
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080061 int32 z_order_relative_of = 26;
chaviw1d044282017-09-27 12:19:28 -070062 // This value can be null if there's nothing to draw.
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080063 ActiveBufferProto active_buffer = 27;
chaviw1d044282017-09-27 12:19:28 -070064 // The number of frames available.
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080065 int32 queued_frames = 28;
66 bool refresh_pending = 29;
Yiwei Zhang7124ad32018-02-21 13:02:45 -080067 // The layer's composer backend destination frame
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080068 RectProto hwc_frame = 30;
Yiwei Zhang7124ad32018-02-21 13:02:45 -080069 // The layer's composer backend source crop
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080070 FloatRectProto hwc_crop = 31;
Yiwei Zhang7124ad32018-02-21 13:02:45 -080071 // The layer's composer backend transform
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080072 int32 hwc_transform = 32;
73 int32 window_type = 33 [deprecated=true];
74 int32 app_id = 34 [deprecated=true];
Yiwei Zhang60d1a192018-03-07 14:52:28 -080075 // The layer's composition type
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080076 int32 hwc_composition_type = 35;
Yiwei Zhang60d1a192018-03-07 14:52:28 -080077 // If it's a buffer layer, indicate if the content is protected
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080078 bool is_protected = 36;
chaviwadc40c22018-07-10 16:57:27 -070079 // Current frame number being rendered.
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080080 uint64 curr_frame = 37;
chaviwadc40c22018-07-10 16:57:27 -070081 // A list of barriers that the layer is waiting to update state.
Vishnu Nair9978b932018-08-22 09:11:49 -070082 repeated BarrierLayerProto barrier_layer = 38;
83 // If active_buffer is not null, record its transform.
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080084 TransformProto buffer_transform = 39;
85 int32 effective_scaling_mode = 40;
Lucas Dupin1b6531c2018-07-05 17:18:21 -070086 // Layer's corner radius.
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080087 float corner_radius = 41;
Evan Rosky1f6d6d52018-12-06 10:47:26 -080088 // Metadata map. May be empty.
89 map<int32, bytes> metadata = 42;
Vishnu Nair4351ad52019-02-11 14:13:02 -080090
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080091 TransformProto effective_transform = 43;
92 FloatRectProto source_bounds = 44;
93 FloatRectProto bounds = 45;
94 FloatRectProto screen_bounds = 46;
Vishnu Nair9245d3b2019-03-22 13:38:56 -070095
96 InputWindowInfoProto input_window_info = 47;
Vishnu Nair95a1ed42019-12-06 12:25:11 -080097
98 // Crop used to draw the rounded corner.
99 FloatRectProto corner_radius_crop = 48;
100
101 // length of the shadow to draw around the layer, it may be set on the
102 // layer or set by a parent layer.
103 float shadow_radius = 49;
chaviwddeae262020-01-06 10:31:23 -0800104 ColorTransformProto color_transform = 50;
chaviw1d044282017-09-27 12:19:28 -0700105}
106
107message PositionProto {
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -0800108 float x = 1;
109 float y = 2;
chaviw1d044282017-09-27 12:19:28 -0700110}
111
112message SizeProto {
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -0800113 int32 w = 1;
114 int32 h = 2;
chaviw1d044282017-09-27 12:19:28 -0700115}
116
117message TransformProto {
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -0800118 float dsdx = 1;
119 float dtdx = 2;
120 float dsdy = 3;
121 float dtdy = 4;
Nataniel Borges797b0e42019-02-15 14:11:58 -0800122 int32 type = 5;
chaviw1d044282017-09-27 12:19:28 -0700123}
124
125message RegionProto {
Nataniel Borges1c0d91c2019-02-15 15:29:39 -0800126 reserved 1; // Previously: uint64 id
chaviw1d044282017-09-27 12:19:28 -0700127 repeated RectProto rect = 2;
128}
129
130message RectProto {
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -0800131 int32 left = 1;
132 int32 top = 2;
133 int32 right = 3;
134 int32 bottom = 4;
chaviw1d044282017-09-27 12:19:28 -0700135}
136
Yiwei Zhang7124ad32018-02-21 13:02:45 -0800137message FloatRectProto {
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -0800138 float left = 1;
139 float top = 2;
140 float right = 3;
141 float bottom = 4;
Yiwei Zhang7124ad32018-02-21 13:02:45 -0800142}
143
chaviw1d044282017-09-27 12:19:28 -0700144message ActiveBufferProto {
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -0800145 uint32 width = 1;
146 uint32 height = 2;
147 uint32 stride = 3;
148 int32 format = 4;
chaviw1d044282017-09-27 12:19:28 -0700149}
150
151message ColorProto {
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -0800152 float r = 1;
153 float g = 2;
154 float b = 3;
155 float a = 4;
Yiwei Zhang7124ad32018-02-21 13:02:45 -0800156}
chaviwadc40c22018-07-10 16:57:27 -0700157
158message BarrierLayerProto {
159 // layer id the barrier is waiting on.
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -0800160 int32 id = 1;
chaviwadc40c22018-07-10 16:57:27 -0700161 // frame number the barrier is waiting on.
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -0800162 uint64 frame_number = 2;
chaviwadc40c22018-07-10 16:57:27 -0700163}
Vishnu Nair9245d3b2019-03-22 13:38:56 -0700164
165message InputWindowInfoProto {
166 uint32 layout_params_flags = 1;
167 uint32 layout_params_type = 2;
168 RectProto frame = 3;
169 RegionProto touchable_region = 4;
170
171 uint32 surface_inset = 5;
172 bool visible = 6;
173 bool can_receive_keys = 7;
174 bool has_focus = 8;
175 bool has_wallpaper = 9;
176
177 float global_scale_factor = 10;
178 float window_x_scale = 11;
179 float window_y_scale = 12;
180
181 uint32 crop_layer_id = 13;
182 bool replace_touchable_region_with_crop = 14;
183 RectProto touchable_region_crop = 15;
184}
chaviwddeae262020-01-06 10:31:23 -0800185
186message ColorTransformProto {
187 // This will be a 4x4 matrix of float values
188 repeated float val = 1;
189}