blob: a0fb0a063d60e6186592b314b1dfa8ac87a7f91a [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;
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080010 SizeProto resolution = 2;
11 string color_mode = 3;
12 string color_transform = 4;
13 int32 global_transform = 5;
chaviw1d044282017-09-27 12:19:28 -070014}
15
16// Information about each layer.
17message LayerProto {
18 // unique id per layer.
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080019 int32 id = 1;
chaviw1d044282017-09-27 12:19:28 -070020 // unique name per layer.
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080021 string name = 2;
chaviw1d044282017-09-27 12:19:28 -070022 // 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
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080027 string type = 5;
28 RegionProto transparent_region = 6;
29 RegionProto visible_region = 7;
30 RegionProto damage_region = 8;
31 uint32 layer_stack = 9;
chaviw1d044282017-09-27 12:19:28 -070032 // The layer's z order. Can be z order in layer stack, relative to parent,
33 // or relative to another layer specified in zOrderRelative.
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080034 int32 z = 10;
chaviw1d044282017-09-27 12:19:28 -070035 // The layer's position on the display.
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080036 PositionProto position = 11;
chaviw1d044282017-09-27 12:19:28 -070037 // The layer's requested position.
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080038 PositionProto requested_position = 12;
chaviw1d044282017-09-27 12:19:28 -070039 // The layer's size.
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080040 SizeProto size = 13;
chaviw1d044282017-09-27 12:19:28 -070041 // The layer's crop in it's own bounds.
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080042 RectProto crop = 14;
chaviw1d044282017-09-27 12:19:28 -070043 // The layer's crop in it's parent's bounds.
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080044 RectProto final_crop = 15 [deprecated=true];
45 bool is_opaque = 16;
46 bool invalidate = 17;
47 string dataspace = 18;
48 string pixel_format = 19;
chaviw1d044282017-09-27 12:19:28 -070049 // The layer's actual color.
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080050 ColorProto color = 20;
chaviw1d044282017-09-27 12:19:28 -070051 // The layer's requested color.
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080052 ColorProto requested_color = 21;
chaviw1d044282017-09-27 12:19:28 -070053 // Can be any combination of
54 // hidden = 0x01
55 // opaque = 0x02,
56 // secure = 0x80,
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080057 uint32 flags = 22;
chaviw1d044282017-09-27 12:19:28 -070058 // The layer's actual transform
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080059 TransformProto transform = 23;
chaviw1d044282017-09-27 12:19:28 -070060 // The layer's requested transform.
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080061 TransformProto requested_transform = 24;
chaviw1d044282017-09-27 12:19:28 -070062 // The parent layer. This value can be null if there is no parent.
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080063 int32 parent = 25;
chaviw1d044282017-09-27 12:19:28 -070064 // The layer that this layer has a z order relative to. This value can be null.
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080065 int32 z_order_relative_of = 26;
chaviw1d044282017-09-27 12:19:28 -070066 // This value can be null if there's nothing to draw.
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080067 ActiveBufferProto active_buffer = 27;
chaviw1d044282017-09-27 12:19:28 -070068 // The number of frames available.
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080069 int32 queued_frames = 28;
70 bool refresh_pending = 29;
Yiwei Zhang7124ad32018-02-21 13:02:45 -080071 // The layer's composer backend destination frame
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080072 RectProto hwc_frame = 30;
Yiwei Zhang7124ad32018-02-21 13:02:45 -080073 // The layer's composer backend source crop
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080074 FloatRectProto hwc_crop = 31;
Yiwei Zhang7124ad32018-02-21 13:02:45 -080075 // The layer's composer backend transform
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080076 int32 hwc_transform = 32;
77 int32 window_type = 33 [deprecated=true];
78 int32 app_id = 34 [deprecated=true];
Yiwei Zhang60d1a192018-03-07 14:52:28 -080079 // The layer's composition type
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080080 int32 hwc_composition_type = 35;
Yiwei Zhang60d1a192018-03-07 14:52:28 -080081 // If it's a buffer layer, indicate if the content is protected
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080082 bool is_protected = 36;
chaviwadc40c22018-07-10 16:57:27 -070083 // Current frame number being rendered.
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080084 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.
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080088 TransformProto buffer_transform = 39;
89 int32 effective_scaling_mode = 40;
Lucas Dupin1b6531c2018-07-05 17:18:21 -070090 // Layer's corner radius.
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080091 float corner_radius = 41;
Evan Rosky1f6d6d52018-12-06 10:47:26 -080092 // Metadata map. May be empty.
93 map<int32, bytes> metadata = 42;
Vishnu Nair4351ad52019-02-11 14:13:02 -080094
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -080095 TransformProto effective_transform = 43;
96 FloatRectProto source_bounds = 44;
97 FloatRectProto bounds = 45;
98 FloatRectProto screen_bounds = 46;
chaviw1d044282017-09-27 12:19:28 -070099}
100
101message PositionProto {
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -0800102 float x = 1;
103 float y = 2;
chaviw1d044282017-09-27 12:19:28 -0700104}
105
106message SizeProto {
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -0800107 int32 w = 1;
108 int32 h = 2;
chaviw1d044282017-09-27 12:19:28 -0700109}
110
111message TransformProto {
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -0800112 float dsdx = 1;
113 float dtdx = 2;
114 float dsdy = 3;
115 float dtdy = 4;
Nataniel Borges797b0e42019-02-15 14:11:58 -0800116 int32 type = 5;
chaviw1d044282017-09-27 12:19:28 -0700117}
118
119message RegionProto {
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -0800120 uint64 id = 1;
chaviw1d044282017-09-27 12:19:28 -0700121 repeated RectProto rect = 2;
122}
123
124message RectProto {
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -0800125 int32 left = 1;
126 int32 top = 2;
127 int32 right = 3;
128 int32 bottom = 4;
chaviw1d044282017-09-27 12:19:28 -0700129}
130
Yiwei Zhang7124ad32018-02-21 13:02:45 -0800131message FloatRectProto {
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -0800132 float left = 1;
133 float top = 2;
134 float right = 3;
135 float bottom = 4;
Yiwei Zhang7124ad32018-02-21 13:02:45 -0800136}
137
chaviw1d044282017-09-27 12:19:28 -0700138message ActiveBufferProto {
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -0800139 uint32 width = 1;
140 uint32 height = 2;
141 uint32 stride = 3;
142 int32 format = 4;
chaviw1d044282017-09-27 12:19:28 -0700143}
144
145message ColorProto {
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -0800146 float r = 1;
147 float g = 2;
148 float b = 3;
149 float a = 4;
Yiwei Zhang7124ad32018-02-21 13:02:45 -0800150}
chaviwadc40c22018-07-10 16:57:27 -0700151
152message BarrierLayerProto {
153 // layer id the barrier is waiting on.
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -0800154 int32 id = 1;
chaviwadc40c22018-07-10 16:57:27 -0700155 // frame number the barrier is waiting on.
Nataniel Borgesdcc0bab2019-02-15 13:22:03 -0800156 uint64 frame_number = 2;
chaviwadc40c22018-07-10 16:57:27 -0700157}