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