1// Definitions for SurfaceFlinger layers. 2 3syntax = "proto3"; 4option optimize_for = LITE_RUNTIME; 5 6import "protos/surfaceflinger/udc/common.proto"; 7 8package android.surfaceflinger; 9 10// Contains a list of all layers. 11message LayersProto { 12 repeated LayerProto layers = 1; 13} 14 15// Must match definition in the IComposerClient HAL 16enum HwcCompositionType { 17 // Invalid composition type 18 INVALID = 0; 19 // Layer was composited by the client into the client target buffer 20 CLIENT = 1; 21 // Layer was composited by the device through hardware overlays 22 DEVICE = 2; 23 // Layer was composited by the device using a color 24 SOLID_COLOR = 3; 25 // Similar to DEVICE, but the layer position may have been asynchronously set 26 // through setCursorPosition 27 CURSOR = 4; 28 // Layer was composited by the device via a sideband stream 29 SIDEBAND = 5; 30 // Layer was composited by hardware optimized for display decoration 31 DISPLAY_DECORATION = 6; 32} 33 34// Information about each layer. 35message LayerProto { 36 // unique id per layer. 37 int32 id = 1; 38 // unique name per layer. 39 string name = 2; 40 // list of children this layer may have. May be empty. 41 repeated int32 children = 3; 42 // list of layers that are z order relative to this layer. 43 repeated int32 relatives = 4; 44 // The type of layer, ex Color, Layer 45 string type = 5; 46 RegionProto transparent_region = 6; 47 RegionProto visible_region = 7; 48 RegionProto damage_region = 8; 49 uint32 layer_stack = 9; 50 // The layer's z order. Can be z order in layer stack, relative to parent, 51 // or relative to another layer specified in zOrderRelative. 52 int32 z = 10; 53 // The layer's position on the display. 54 PositionProto position = 11; 55 // The layer's requested position. 56 PositionProto requested_position = 12; 57 // The layer's size. 58 SizeProto size = 13; 59 // The layer's crop in it's own bounds. 60 RectProto crop = 14; 61 // The layer's crop in it's parent's bounds. 62 RectProto final_crop = 15 [deprecated=true]; 63 bool is_opaque = 16; 64 bool invalidate = 17; 65 string dataspace = 18; 66 string pixel_format = 19; 67 // The layer's actual color. 68 ColorProto color = 20; 69 // The layer's requested color. 70 ColorProto requested_color = 21; 71 // Can be any combination of 72 // hidden = 0x01 73 // opaque = 0x02, 74 // secure = 0x80, 75 uint32 flags = 22; 76 // The layer's actual transform 77 TransformProto transform = 23; 78 // The layer's requested transform. 79 TransformProto requested_transform = 24; 80 // The parent layer. This value can be null if there is no parent. 81 int32 parent = 25; 82 // The layer that this layer has a z order relative to. This value can be null. 83 int32 z_order_relative_of = 26; 84 // This value can be null if there's nothing to draw. 85 ActiveBufferProto active_buffer = 27; 86 // The number of frames available. 87 int32 queued_frames = 28; 88 bool refresh_pending = 29; 89 // The layer's composer backend destination frame 90 RectProto hwc_frame = 30; 91 // The layer's composer backend source crop 92 FloatRectProto hwc_crop = 31; 93 // The layer's composer backend transform 94 int32 hwc_transform = 32; 95 int32 window_type = 33 [deprecated=true]; 96 int32 app_id = 34 [deprecated=true]; 97 // The layer's composition type 98 HwcCompositionType hwc_composition_type = 35; 99 // If it's a buffer layer, indicate if the content is protected 100 bool is_protected = 36; 101 // Current frame number being rendered. 102 uint64 curr_frame = 37; 103 // A list of barriers that the layer is waiting to update state. 104 repeated BarrierLayerProto barrier_layer = 38; 105 // If active_buffer is not null, record its transform. 106 TransformProto buffer_transform = 39; 107 int32 effective_scaling_mode = 40; 108 // Layer's corner radius. 109 float corner_radius = 41; 110 // Metadata map. May be empty. 111 map<int32, bytes> metadata = 42; 112 113 TransformProto effective_transform = 43; 114 FloatRectProto source_bounds = 44; 115 FloatRectProto bounds = 45; 116 FloatRectProto screen_bounds = 46; 117 118 InputWindowInfoProto input_window_info = 47; 119 120 // Crop used to draw the rounded corner. 121 FloatRectProto corner_radius_crop = 48; 122 123 // length of the shadow to draw around the layer, it may be set on the 124 // layer or set by a parent layer. 125 float shadow_radius = 49; 126 ColorTransformProto color_transform = 50; 127 128 bool is_relative_of = 51; 129 // Layer's background blur radius in pixels. 130 int32 background_blur_radius = 52; 131 132 uint32 owner_uid = 53; 133 134 // Regions of a layer, where blur should be applied. 135 repeated BlurRegion blur_regions = 54; 136 137 bool is_trusted_overlay = 55; 138 139 // Corner radius explicitly set on layer rather than inherited 140 float requested_corner_radius = 56; 141 142 RectProto destination_frame = 57; 143 144 uint32 original_id = 58; 145} 146 147message PositionProto { 148 float x = 1; 149 float y = 2; 150} 151 152message FloatRectProto { 153 float left = 1; 154 float top = 2; 155 float right = 3; 156 float bottom = 4; 157} 158 159message ActiveBufferProto { 160 uint32 width = 1; 161 uint32 height = 2; 162 uint32 stride = 3; 163 int32 format = 4; 164 uint64 usage = 5; 165} 166 167message BarrierLayerProto { 168 // layer id the barrier is waiting on. 169 int32 id = 1; 170 // frame number the barrier is waiting on. 171 uint64 frame_number = 2; 172} 173 174