1// Definitions for SurfaceFlinger layers. 2 3syntax = "proto3"; 4option 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// Must match definition in the IComposerClient HAL 13enum HwcCompositionType { 14 // Invalid composition type 15 INVALID = 0; 16 // Layer was composited by the client into the client target buffer 17 CLIENT = 1; 18 // Layer was composited by the device through hardware overlays 19 DEVICE = 2; 20 // Layer was composited by the device using a color 21 SOLID_COLOR = 3; 22 // Similar to DEVICE, but the layer position may have been asynchronously set 23 // through setCursorPosition 24 CURSOR = 4; 25 // Layer was composited by the device via a sideband stream. 26 SIDEBAND = 5; 27} 28 29// Information about each layer. 30message LayerProto { 31 // unique id per layer. 32 int32 id = 1; 33 // unique name per layer. 34 string name = 2; 35 // list of children this layer may have. May be empty. 36 repeated int32 children = 3; 37 // list of layers that are z order relative to this layer. 38 repeated int32 relatives = 4; 39 // The type of layer, ex Color, Layer 40 string type = 5; 41 RegionProto transparent_region = 6; 42 RegionProto visible_region = 7; 43 RegionProto damage_region = 8; 44 uint32 layer_stack = 9; 45 // The layer's z order. Can be z order in layer stack, relative to parent, 46 // or relative to another layer specified in zOrderRelative. 47 int32 z = 10; 48 // The layer's position on the display. 49 PositionProto position = 11; 50 // The layer's requested position. 51 PositionProto requested_position = 12; 52 // The layer's size. 53 SizeProto size = 13; 54 // The layer's crop in it's own bounds. 55 RectProto crop = 14; 56 // The layer's crop in it's parent's bounds. 57 RectProto final_crop = 15 [deprecated=true]; 58 bool is_opaque = 16; 59 bool invalidate = 17; 60 string dataspace = 18; 61 string pixel_format = 19; 62 // The layer's actual color. 63 ColorProto color = 20; 64 // The layer's requested color. 65 ColorProto requested_color = 21; 66 // Can be any combination of 67 // hidden = 0x01 68 // opaque = 0x02, 69 // secure = 0x80, 70 uint32 flags = 22; 71 // The layer's actual transform 72 TransformProto transform = 23; 73 // The layer's requested transform. 74 TransformProto requested_transform = 24; 75 // The parent layer. This value can be null if there is no parent. 76 int32 parent = 25; 77 // The layer that this layer has a z order relative to. This value can be null. 78 int32 z_order_relative_of = 26; 79 // This value can be null if there's nothing to draw. 80 ActiveBufferProto active_buffer = 27; 81 // The number of frames available. 82 int32 queued_frames = 28; 83 bool refresh_pending = 29; 84 // The layer's composer backend destination frame 85 RectProto hwc_frame = 30; 86 // The layer's composer backend source crop 87 FloatRectProto hwc_crop = 31; 88 // The layer's composer backend transform 89 int32 hwc_transform = 32; 90 int32 window_type = 33 [deprecated=true]; 91 int32 app_id = 34 [deprecated=true]; 92 // The layer's composition type 93 HwcCompositionType hwc_composition_type = 35; 94 // If it's a buffer layer, indicate if the content is protected 95 bool is_protected = 36; 96 // Current frame number being rendered. 97 uint64 curr_frame = 37; 98 // A list of barriers that the layer is waiting to update state. 99 repeated BarrierLayerProto barrier_layer = 38; 100 // If active_buffer is not null, record its transform. 101 TransformProto buffer_transform = 39; 102 int32 effective_scaling_mode = 40; 103 // Layer's corner radius. 104 float corner_radius = 41; 105 // Metadata map. May be empty. 106 map<int32, bytes> metadata = 42; 107 108 TransformProto effective_transform = 43; 109 FloatRectProto source_bounds = 44; 110 FloatRectProto bounds = 45; 111 FloatRectProto screen_bounds = 46; 112 113 InputWindowInfoProto input_window_info = 47; 114 115 // Crop used to draw the rounded corner. 116 FloatRectProto corner_radius_crop = 48; 117 118 // length of the shadow to draw around the layer, it may be set on the 119 // layer or set by a parent layer. 120 float shadow_radius = 49; 121 ColorTransformProto color_transform = 50; 122 123 bool is_relative_of = 51; 124 // Layer's background blur radius in pixels. 125 int32 background_blur_radius = 52; 126 127 uint32 owner_uid = 53; 128 129 // Regions of a layer, where blur should be applied. 130 repeated BlurRegion blur_regions = 54; 131 132 bool is_trusted_overlay = 55; 133} 134 135message PositionProto { 136 float x = 1; 137 float y = 2; 138} 139 140message SizeProto { 141 int32 w = 1; 142 int32 h = 2; 143} 144 145message TransformProto { 146 float dsdx = 1; 147 float dtdx = 2; 148 float dsdy = 3; 149 float dtdy = 4; 150 int32 type = 5; 151} 152 153message RegionProto { 154 reserved 1; // Previously: uint64 id 155 repeated RectProto rect = 2; 156} 157 158message RectProto { 159 int32 left = 1; 160 int32 top = 2; 161 int32 right = 3; 162 int32 bottom = 4; 163} 164 165message FloatRectProto { 166 float left = 1; 167 float top = 2; 168 float right = 3; 169 float bottom = 4; 170} 171 172message ActiveBufferProto { 173 uint32 width = 1; 174 uint32 height = 2; 175 uint32 stride = 3; 176 int32 format = 4; 177} 178 179message ColorProto { 180 float r = 1; 181 float g = 2; 182 float b = 3; 183 float a = 4; 184} 185 186message BarrierLayerProto { 187 // layer id the barrier is waiting on. 188 int32 id = 1; 189 // frame number the barrier is waiting on. 190 uint64 frame_number = 2; 191} 192 193message InputWindowInfoProto { 194 uint32 layout_params_flags = 1; 195 uint32 layout_params_type = 2; 196 RectProto frame = 3; 197 RegionProto touchable_region = 4; 198 199 uint32 surface_inset = 5; 200 bool visible = 6; 201 bool can_receive_keys = 7 [deprecated=true]; 202 bool focusable = 8; 203 bool has_wallpaper = 9; 204 205 float global_scale_factor = 10; 206 float window_x_scale = 11 [deprecated=true]; 207 float window_y_scale = 12 [deprecated=true]; 208 209 uint32 crop_layer_id = 13; 210 bool replace_touchable_region_with_crop = 14; 211 RectProto touchable_region_crop = 15; 212 TransformProto transform = 16; 213} 214 215message ColorTransformProto { 216 // This will be a 4x4 matrix of float values 217 repeated float val = 1; 218} 219 220message BlurRegion { 221 uint32 blur_radius = 1; 222 uint32 corner_radius_tl = 2; 223 uint32 corner_radius_tr = 3; 224 uint32 corner_radius_bl = 4; 225 float corner_radius_br = 5; 226 float alpha = 6; 227 int32 left = 7; 228 int32 top = 8; 229 int32 right = 9; 230 int32 bottom = 10; 231}