| 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; | 
| chaviw | 1d04428 | 2017-09-27 12:19:28 -0700 | [diff] [blame] | 97 | } | 
 | 98 |  | 
 | 99 | message PositionProto { | 
| Nataniel Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 100 |   float x = 1; | 
 | 101 |   float y = 2; | 
| chaviw | 1d04428 | 2017-09-27 12:19:28 -0700 | [diff] [blame] | 102 | } | 
 | 103 |  | 
 | 104 | message SizeProto { | 
| Nataniel Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 105 |   int32 w = 1; | 
 | 106 |   int32 h = 2; | 
| chaviw | 1d04428 | 2017-09-27 12:19:28 -0700 | [diff] [blame] | 107 | } | 
 | 108 |  | 
 | 109 | message TransformProto { | 
| Nataniel Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 110 |   float dsdx = 1; | 
 | 111 |   float dtdx = 2; | 
 | 112 |   float dsdy = 3; | 
 | 113 |   float dtdy = 4; | 
| Nataniel Borges | 797b0e4 | 2019-02-15 14:11:58 -0800 | [diff] [blame] | 114 |   int32 type = 5; | 
| chaviw | 1d04428 | 2017-09-27 12:19:28 -0700 | [diff] [blame] | 115 | } | 
 | 116 |  | 
 | 117 | message RegionProto { | 
| Nataniel Borges | 1c0d91c | 2019-02-15 15:29:39 -0800 | [diff] [blame] | 118 |   reserved 1;  // Previously: uint64 id | 
| chaviw | 1d04428 | 2017-09-27 12:19:28 -0700 | [diff] [blame] | 119 |   repeated RectProto rect = 2; | 
 | 120 | } | 
 | 121 |  | 
 | 122 | message RectProto { | 
| Nataniel Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 123 |   int32 left   = 1; | 
 | 124 |   int32 top    = 2; | 
 | 125 |   int32 right  = 3; | 
 | 126 |   int32 bottom = 4; | 
| chaviw | 1d04428 | 2017-09-27 12:19:28 -0700 | [diff] [blame] | 127 | } | 
 | 128 |  | 
| Yiwei Zhang | 7124ad3 | 2018-02-21 13:02:45 -0800 | [diff] [blame] | 129 | message FloatRectProto { | 
| Nataniel Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 130 |   float left = 1; | 
 | 131 |   float top = 2; | 
 | 132 |   float right = 3; | 
 | 133 |   float bottom = 4; | 
| Yiwei Zhang | 7124ad3 | 2018-02-21 13:02:45 -0800 | [diff] [blame] | 134 | } | 
 | 135 |  | 
| chaviw | 1d04428 | 2017-09-27 12:19:28 -0700 | [diff] [blame] | 136 | message ActiveBufferProto { | 
| Nataniel Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 137 |   uint32 width = 1; | 
 | 138 |   uint32 height = 2; | 
 | 139 |   uint32 stride = 3; | 
 | 140 |   int32 format = 4; | 
| chaviw | 1d04428 | 2017-09-27 12:19:28 -0700 | [diff] [blame] | 141 | } | 
 | 142 |  | 
 | 143 | message ColorProto { | 
| Nataniel Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 144 |   float r = 1; | 
 | 145 |   float g = 2; | 
 | 146 |   float b = 3; | 
 | 147 |   float a = 4; | 
| Yiwei Zhang | 7124ad3 | 2018-02-21 13:02:45 -0800 | [diff] [blame] | 148 | } | 
| chaviw | adc40c2 | 2018-07-10 16:57:27 -0700 | [diff] [blame] | 149 |  | 
 | 150 | message BarrierLayerProto { | 
 | 151 |   // layer id the barrier is waiting on. | 
| Nataniel Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 152 |   int32 id = 1; | 
| chaviw | adc40c2 | 2018-07-10 16:57:27 -0700 | [diff] [blame] | 153 |   // frame number the barrier is waiting on. | 
| Nataniel Borges | dcc0bab | 2019-02-15 13:22:03 -0800 | [diff] [blame] | 154 |   uint64 frame_number = 2; | 
| chaviw | adc40c2 | 2018-07-10 16:57:27 -0700 | [diff] [blame] | 155 | } | 
| Vishnu Nair | 9245d3b | 2019-03-22 13:38:56 -0700 | [diff] [blame] | 156 |  | 
 | 157 | message InputWindowInfoProto { | 
 | 158 |     uint32 layout_params_flags = 1; | 
 | 159 |     uint32 layout_params_type = 2; | 
 | 160 |     RectProto frame = 3; | 
 | 161 |     RegionProto touchable_region = 4; | 
 | 162 |  | 
 | 163 |     uint32 surface_inset = 5; | 
 | 164 |     bool visible = 6; | 
 | 165 |     bool can_receive_keys = 7; | 
 | 166 |     bool has_focus = 8; | 
 | 167 |     bool has_wallpaper = 9; | 
 | 168 |  | 
 | 169 |     float global_scale_factor = 10; | 
 | 170 |     float window_x_scale = 11; | 
 | 171 |     float window_y_scale = 12; | 
 | 172 |  | 
 | 173 |     uint32 crop_layer_id = 13; | 
 | 174 |     bool replace_touchable_region_with_crop = 14; | 
 | 175 |     RectProto touchable_region_crop = 15; | 
 | 176 | } |