chaviw | 1d04428 | 2017-09-27 12:19:28 -0700 | [diff] [blame] | 1 | // Definitions for SurfaceFlinger layers. |
| 2 | |
Nataniel Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 3 | syntax = "proto3"; |
chaviw | 1d04428 | 2017-09-27 12:19:28 -0700 | [diff] [blame] | 4 | option optimize_for = LITE_RUNTIME; |
| 5 | package android.surfaceflinger; |
| 6 | |
| 7 | // Contains a list of all layers. |
| 8 | message LayersProto { |
| 9 | repeated LayerProto layers = 1; |
| 10 | } |
| 11 | |
| 12 | // Information about each layer. |
| 13 | message LayerProto { |
| 14 | // unique id per layer. |
Nataniel Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 15 | int32 id = 1; |
chaviw | 1d04428 | 2017-09-27 12:19:28 -0700 | [diff] [blame] | 16 | // unique name per layer. |
Nataniel Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 17 | string name = 2; |
chaviw | 1d04428 | 2017-09-27 12:19:28 -0700 | [diff] [blame] | 18 | // 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 Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 23 | string type = 5; |
| 24 | RegionProto transparent_region = 6; |
| 25 | RegionProto visible_region = 7; |
| 26 | RegionProto damage_region = 8; |
| 27 | uint32 layer_stack = 9; |
chaviw | 1d04428 | 2017-09-27 12:19:28 -0700 | [diff] [blame] | 28 | // 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 Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 30 | int32 z = 10; |
chaviw | 1d04428 | 2017-09-27 12:19:28 -0700 | [diff] [blame] | 31 | // The layer's position on the display. |
Nataniel Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 32 | PositionProto position = 11; |
chaviw | 1d04428 | 2017-09-27 12:19:28 -0700 | [diff] [blame] | 33 | // The layer's requested position. |
Nataniel Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 34 | PositionProto requested_position = 12; |
chaviw | 1d04428 | 2017-09-27 12:19:28 -0700 | [diff] [blame] | 35 | // The layer's size. |
Nataniel Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 36 | SizeProto size = 13; |
chaviw | 1d04428 | 2017-09-27 12:19:28 -0700 | [diff] [blame] | 37 | // The layer's crop in it's own bounds. |
Nataniel Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 38 | RectProto crop = 14; |
chaviw | 1d04428 | 2017-09-27 12:19:28 -0700 | [diff] [blame] | 39 | // The layer's crop in it's parent's bounds. |
Nataniel Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 40 | RectProto final_crop = 15 [deprecated=true]; |
| 41 | bool is_opaque = 16; |
| 42 | bool invalidate = 17; |
| 43 | string dataspace = 18; |
| 44 | string pixel_format = 19; |
chaviw | 1d04428 | 2017-09-27 12:19:28 -0700 | [diff] [blame] | 45 | // The layer's actual color. |
Nataniel Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 46 | ColorProto color = 20; |
chaviw | 1d04428 | 2017-09-27 12:19:28 -0700 | [diff] [blame] | 47 | // The layer's requested color. |
Nataniel Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 48 | ColorProto requested_color = 21; |
chaviw | 1d04428 | 2017-09-27 12:19:28 -0700 | [diff] [blame] | 49 | // Can be any combination of |
| 50 | // hidden = 0x01 |
| 51 | // opaque = 0x02, |
| 52 | // secure = 0x80, |
Nataniel Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 53 | uint32 flags = 22; |
chaviw | 1d04428 | 2017-09-27 12:19:28 -0700 | [diff] [blame] | 54 | // The layer's actual transform |
Nataniel Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 55 | TransformProto transform = 23; |
chaviw | 1d04428 | 2017-09-27 12:19:28 -0700 | [diff] [blame] | 56 | // The layer's requested transform. |
Nataniel Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 57 | TransformProto requested_transform = 24; |
chaviw | 1d04428 | 2017-09-27 12:19:28 -0700 | [diff] [blame] | 58 | // The parent layer. This value can be null if there is no parent. |
Nataniel Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 59 | int32 parent = 25; |
chaviw | 1d04428 | 2017-09-27 12:19:28 -0700 | [diff] [blame] | 60 | // The layer that this layer has a z order relative to. This value can be null. |
Nataniel Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 61 | int32 z_order_relative_of = 26; |
chaviw | 1d04428 | 2017-09-27 12:19:28 -0700 | [diff] [blame] | 62 | // This value can be null if there's nothing to draw. |
Nataniel Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 63 | ActiveBufferProto active_buffer = 27; |
chaviw | 1d04428 | 2017-09-27 12:19:28 -0700 | [diff] [blame] | 64 | // The number of frames available. |
Nataniel Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 65 | int32 queued_frames = 28; |
| 66 | bool refresh_pending = 29; |
Yiwei Zhang | 7124ad3 | 2018-02-21 13:02:45 -0800 | [diff] [blame] | 67 | // The layer's composer backend destination frame |
Nataniel Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 68 | RectProto hwc_frame = 30; |
Yiwei Zhang | 7124ad3 | 2018-02-21 13:02:45 -0800 | [diff] [blame] | 69 | // The layer's composer backend source crop |
Nataniel Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 70 | FloatRectProto hwc_crop = 31; |
Yiwei Zhang | 7124ad3 | 2018-02-21 13:02:45 -0800 | [diff] [blame] | 71 | // The layer's composer backend transform |
Nataniel Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 72 | int32 hwc_transform = 32; |
| 73 | int32 window_type = 33 [deprecated=true]; |
| 74 | int32 app_id = 34 [deprecated=true]; |
Yiwei Zhang | 60d1a19 | 2018-03-07 14:52:28 -0800 | [diff] [blame] | 75 | // The layer's composition type |
Nataniel Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 76 | int32 hwc_composition_type = 35; |
Yiwei Zhang | 60d1a19 | 2018-03-07 14:52:28 -0800 | [diff] [blame] | 77 | // If it's a buffer layer, indicate if the content is protected |
Nataniel Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 78 | bool is_protected = 36; |
chaviw | adc40c2 | 2018-07-10 16:57:27 -0700 | [diff] [blame] | 79 | // Current frame number being rendered. |
Nataniel Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 80 | uint64 curr_frame = 37; |
chaviw | adc40c2 | 2018-07-10 16:57:27 -0700 | [diff] [blame] | 81 | // A list of barriers that the layer is waiting to update state. |
Vishnu Nair | 9978b93 | 2018-08-22 09:11:49 -0700 | [diff] [blame] | 82 | repeated BarrierLayerProto barrier_layer = 38; |
| 83 | // If active_buffer is not null, record its transform. |
Nataniel Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 84 | TransformProto buffer_transform = 39; |
| 85 | int32 effective_scaling_mode = 40; |
Lucas Dupin | 1b6531c | 2018-07-05 17:18:21 -0700 | [diff] [blame] | 86 | // Layer's corner radius. |
Nataniel Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 87 | float corner_radius = 41; |
Evan Rosky | 1f6d6d5 | 2018-12-06 10:47:26 -0800 | [diff] [blame] | 88 | // Metadata map. May be empty. |
| 89 | map<int32, bytes> metadata = 42; |
Vishnu Nair | 4351ad5 | 2019-02-11 14:13:02 -0800 | [diff] [blame] | 90 | |
Nataniel Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 91 | TransformProto effective_transform = 43; |
| 92 | FloatRectProto source_bounds = 44; |
| 93 | FloatRectProto bounds = 45; |
| 94 | FloatRectProto screen_bounds = 46; |
Vishnu Nair | 9245d3b | 2019-03-22 13:38:56 -0700 | [diff] [blame] | 95 | |
| 96 | InputWindowInfoProto input_window_info = 47; |
Vishnu Nair | 95a1ed4 | 2019-12-06 12:25:11 -0800 | [diff] [blame] | 97 | |
| 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; |
chaviw | 1d04428 | 2017-09-27 12:19:28 -0700 | [diff] [blame] | 104 | } |
| 105 | |
| 106 | message PositionProto { |
Nataniel Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 107 | float x = 1; |
| 108 | float y = 2; |
chaviw | 1d04428 | 2017-09-27 12:19:28 -0700 | [diff] [blame] | 109 | } |
| 110 | |
| 111 | message SizeProto { |
Nataniel Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 112 | int32 w = 1; |
| 113 | int32 h = 2; |
chaviw | 1d04428 | 2017-09-27 12:19:28 -0700 | [diff] [blame] | 114 | } |
| 115 | |
| 116 | message TransformProto { |
Nataniel Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 117 | float dsdx = 1; |
| 118 | float dtdx = 2; |
| 119 | float dsdy = 3; |
| 120 | float dtdy = 4; |
Nataniel Borges | 797b0e4 | 2019-02-15 14:11:58 -0800 | [diff] [blame] | 121 | int32 type = 5; |
chaviw | 1d04428 | 2017-09-27 12:19:28 -0700 | [diff] [blame] | 122 | } |
| 123 | |
| 124 | message RegionProto { |
Nataniel Borges | 1c0d91c | 2019-02-15 15:29:39 -0800 | [diff] [blame] | 125 | reserved 1; // Previously: uint64 id |
chaviw | 1d04428 | 2017-09-27 12:19:28 -0700 | [diff] [blame] | 126 | repeated RectProto rect = 2; |
| 127 | } |
| 128 | |
| 129 | message RectProto { |
Nataniel Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 130 | int32 left = 1; |
| 131 | int32 top = 2; |
| 132 | int32 right = 3; |
| 133 | int32 bottom = 4; |
chaviw | 1d04428 | 2017-09-27 12:19:28 -0700 | [diff] [blame] | 134 | } |
| 135 | |
Yiwei Zhang | 7124ad3 | 2018-02-21 13:02:45 -0800 | [diff] [blame] | 136 | message FloatRectProto { |
Nataniel Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 137 | float left = 1; |
| 138 | float top = 2; |
| 139 | float right = 3; |
| 140 | float bottom = 4; |
Yiwei Zhang | 7124ad3 | 2018-02-21 13:02:45 -0800 | [diff] [blame] | 141 | } |
| 142 | |
chaviw | 1d04428 | 2017-09-27 12:19:28 -0700 | [diff] [blame] | 143 | message ActiveBufferProto { |
Nataniel Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 144 | uint32 width = 1; |
| 145 | uint32 height = 2; |
| 146 | uint32 stride = 3; |
| 147 | int32 format = 4; |
chaviw | 1d04428 | 2017-09-27 12:19:28 -0700 | [diff] [blame] | 148 | } |
| 149 | |
| 150 | message ColorProto { |
Nataniel Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 151 | float r = 1; |
| 152 | float g = 2; |
| 153 | float b = 3; |
| 154 | float a = 4; |
Yiwei Zhang | 7124ad3 | 2018-02-21 13:02:45 -0800 | [diff] [blame] | 155 | } |
chaviw | adc40c2 | 2018-07-10 16:57:27 -0700 | [diff] [blame] | 156 | |
| 157 | message BarrierLayerProto { |
| 158 | // layer id the barrier is waiting on. |
Nataniel Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 159 | int32 id = 1; |
chaviw | adc40c2 | 2018-07-10 16:57:27 -0700 | [diff] [blame] | 160 | // frame number the barrier is waiting on. |
Nataniel Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 161 | uint64 frame_number = 2; |
chaviw | adc40c2 | 2018-07-10 16:57:27 -0700 | [diff] [blame] | 162 | } |
Vishnu Nair | 9245d3b | 2019-03-22 13:38:56 -0700 | [diff] [blame] | 163 | |
| 164 | message InputWindowInfoProto { |
| 165 | uint32 layout_params_flags = 1; |
| 166 | uint32 layout_params_type = 2; |
| 167 | RectProto frame = 3; |
| 168 | RegionProto touchable_region = 4; |
| 169 | |
| 170 | uint32 surface_inset = 5; |
| 171 | bool visible = 6; |
| 172 | bool can_receive_keys = 7; |
| 173 | bool has_focus = 8; |
| 174 | bool has_wallpaper = 9; |
| 175 | |
| 176 | float global_scale_factor = 10; |
| 177 | float window_x_scale = 11; |
| 178 | float window_y_scale = 12; |
| 179 | |
| 180 | uint32 crop_layer_id = 13; |
| 181 | bool replace_touchable_region_with_crop = 14; |
| 182 | RectProto touchable_region_crop = 15; |
| 183 | } |