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