summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/layerproto/layers.proto
blob: dddc677715b6ff82bbbf8abf91f9d9bec67fad59 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
// Definitions for SurfaceFlinger layers.

syntax = "proto3";
option optimize_for = LITE_RUNTIME;
package android.surfaceflinger;

// Contains a list of all layers.
message LayersProto {
  repeated LayerProto layers = 1;
}

// Must match definition in the IComposerClient HAL
enum HwcCompositionType {
    // Invalid composition type
    INVALID = 0;
    // Layer was composited by the client into the client target buffer
    CLIENT = 1;
    // Layer was composited by the device through hardware overlays
    DEVICE = 2;
    // Layer was composited by the device using a color
    SOLID_COLOR = 3;
    // Similar to DEVICE, but the layer position may have been asynchronously set
    // through setCursorPosition
    CURSOR = 4;
    // Layer was composited by the device via a sideband stream.
    SIDEBAND = 5;
}

// Information about each layer.
message LayerProto {
  // unique id per layer.
  int32 id = 1;
  // unique name per layer.
  string name = 2;
  // list of children this layer may have. May be empty.
  repeated int32 children = 3;
  // list of layers that are z order relative to this layer.
  repeated int32 relatives = 4;
  // The type of layer, ex Color, Layer
  string type = 5;
  RegionProto transparent_region = 6;
  RegionProto visible_region = 7;
  RegionProto damage_region = 8;
  uint32 layer_stack = 9;
  // The layer's z order. Can be z order in layer stack, relative to parent,
  // or relative to another layer specified in zOrderRelative.
  int32 z = 10;
  // The layer's position on the display.
  PositionProto position = 11;
  // The layer's requested position.
  PositionProto requested_position = 12;
  // The layer's size.
  SizeProto size = 13;
  // The layer's crop in it's own bounds.
  RectProto crop = 14;
  // The layer's crop in it's parent's bounds.
  RectProto final_crop = 15 [deprecated=true];
  bool is_opaque = 16;
  bool invalidate = 17;
  string dataspace = 18;
  string pixel_format = 19;
  // The layer's actual color.
  ColorProto color = 20;
  // The layer's requested color.
  ColorProto requested_color = 21;
  // Can be any combination of
  //    hidden = 0x01
  //    opaque = 0x02,
  //    secure = 0x80,
  uint32 flags = 22;
  // The layer's actual transform
  TransformProto transform = 23;
  // The layer's requested transform.
  TransformProto requested_transform = 24;
  // The parent layer. This value can be null if there is no parent.
  int32 parent = 25;
  // The layer that this layer has a z order relative to. This value can be null.
  int32 z_order_relative_of = 26;
  // This value can be null if there's nothing to draw.
  ActiveBufferProto active_buffer = 27;
  // The number of frames available.
  int32 queued_frames = 28;
  bool refresh_pending = 29;
  // The layer's composer backend destination frame
  RectProto hwc_frame = 30;
  // The layer's composer backend source crop
  FloatRectProto hwc_crop = 31;
  // The layer's composer backend transform
  int32 hwc_transform = 32;
  int32 window_type = 33 [deprecated=true];
  int32 app_id = 34 [deprecated=true];
  // The layer's composition type
  HwcCompositionType hwc_composition_type = 35;
  // If it's a buffer layer, indicate if the content is protected
  bool is_protected = 36;
  // Current frame number being rendered.
  uint64 curr_frame = 37;
  // A list of barriers that the layer is waiting to update state.
  repeated BarrierLayerProto barrier_layer = 38;
  // If active_buffer is not null, record its transform.
  TransformProto buffer_transform = 39;
  int32 effective_scaling_mode = 40;
  // Layer's corner radius.
  float corner_radius = 41;
  // Metadata map. May be empty.
  map<int32, bytes> metadata = 42;

  TransformProto effective_transform = 43;
  FloatRectProto source_bounds = 44;
  FloatRectProto bounds = 45;
  FloatRectProto screen_bounds = 46;

  InputWindowInfoProto input_window_info = 47;

  // Crop used to draw the rounded corner.
  FloatRectProto corner_radius_crop = 48;

  // length of the shadow to draw around the layer, it may be set on the
  // layer or set by a parent layer.
  float shadow_radius = 49;
  ColorTransformProto color_transform = 50;

  bool is_relative_of = 51;
  // Layer's background blur radius in pixels.
  int32 background_blur_radius = 52;

  uint32 owner_uid = 53;

  // Regions of a layer, where blur should be applied.
  repeated BlurRegion blur_regions = 54;

  bool is_trusted_overlay = 55;
}

message PositionProto {
  float x = 1;
  float y = 2;
}

message SizeProto {
  int32 w = 1;
  int32 h = 2;
}

message TransformProto {
  float dsdx = 1;
  float dtdx = 2;
  float dsdy = 3;
  float dtdy = 4;
  int32 type = 5;
}

message RegionProto {
  reserved 1;  // Previously: uint64 id
  repeated RectProto rect = 2;
}

message RectProto {
  int32 left   = 1;
  int32 top    = 2;
  int32 right  = 3;
  int32 bottom = 4;
}

message FloatRectProto {
  float left = 1;
  float top = 2;
  float right = 3;
  float bottom = 4;
}

message ActiveBufferProto {
  uint32 width = 1;
  uint32 height = 2;
  uint32 stride = 3;
  int32 format = 4;
}

message ColorProto {
  float r = 1;
  float g = 2;
  float b = 3;
  float a = 4;
}

message BarrierLayerProto {
  // layer id the barrier is waiting on.
  int32 id = 1;
  // frame number the barrier is waiting on.
  uint64 frame_number = 2;
}

message InputWindowInfoProto {
    uint32 layout_params_flags = 1;
    uint32 layout_params_type = 2;
    RectProto frame = 3;
    RegionProto touchable_region = 4;

    uint32 surface_inset = 5;
    bool visible = 6;
    bool can_receive_keys = 7  [deprecated=true];
    bool focusable = 8;
    bool has_wallpaper = 9;

    float global_scale_factor = 10;
    float window_x_scale = 11 [deprecated=true];
    float window_y_scale = 12 [deprecated=true];

    uint32 crop_layer_id = 13;
    bool replace_touchable_region_with_crop = 14;
    RectProto touchable_region_crop = 15;
    TransformProto transform = 16;
}

message ColorTransformProto {
  // This will be a 4x4 matrix of float values
  repeated float val = 1;
}

message BlurRegion {
    uint32 blur_radius = 1;
    uint32 corner_radius_tl = 2;
    uint32 corner_radius_tr = 3;
    uint32 corner_radius_bl = 4;
    float corner_radius_br = 5;
    float alpha = 6;
    int32 left = 7;
    int32 top = 8;
    int32 right = 9;
    int32 bottom = 10;
}