blob: edf56abc4a643209783886bf8b08e484c693336d [file] [log] [blame]
chaviw1d044282017-09-27 12:19:28 -07001// Definitions for SurfaceFlinger layers.
2
3syntax = "proto2";
4option optimize_for = LITE_RUNTIME;
5package android.surfaceflinger;
6
7// Contains a list of all layers.
8message LayersProto {
9 repeated LayerProto layers = 1;
Yiwei Zhang068e31b2018-02-21 13:02:45 -080010 optional SizeProto resolution = 2;
Yiwei Zhang7c64f172018-03-07 14:52:28 -080011 optional string color_mode = 3;
12 optional string color_transform = 4;
13 optional int32 global_transform = 5;
chaviw1d044282017-09-27 12:19:28 -070014}
15
16// Information about each layer.
17message LayerProto {
18 // unique id per layer.
19 optional int32 id = 1;
20 // unique name per layer.
21 optional 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 optional string type = 5;
28 optional RegionProto transparent_region = 6;
29 optional RegionProto visible_region = 7;
30 optional RegionProto damage_region = 8;
31 optional 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 optional int32 z = 10;
35 // The layer's position on the display.
36 optional PositionProto position = 11;
37 // The layer's requested position.
38 optional PositionProto requested_position = 12;
39 // The layer's size.
40 optional SizeProto size = 13;
41 // The layer's crop in it's own bounds.
42 optional RectProto crop = 14;
43 // The layer's crop in it's parent's bounds.
44 optional RectProto final_crop = 15;
45 optional bool is_opaque = 16;
46 optional bool invalidate = 17;
47 optional string dataspace = 18;
48 optional string pixel_format = 19;
49 // The layer's actual color.
50 optional ColorProto color = 20;
51 // The layer's requested color.
52 optional ColorProto requested_color = 21;
53 // Can be any combination of
54 // hidden = 0x01
55 // opaque = 0x02,
56 // secure = 0x80,
57 optional uint32 flags = 22;
58 // The layer's actual transform
59 optional TransformProto transform = 23;
60 // The layer's requested transform.
61 optional TransformProto requested_transform = 24;
62 // The parent layer. This value can be null if there is no parent.
63 optional int32 parent = 25 [default = -1];
64 // The layer that this layer has a z order relative to. This value can be null.
65 optional int32 z_order_relative_of = 26 [default = -1];
66 // This value can be null if there's nothing to draw.
67 optional ActiveBufferProto active_buffer = 27;
68 // The number of frames available.
69 optional int32 queued_frames = 28;
70 optional bool refresh_pending = 29;
Yiwei Zhang068e31b2018-02-21 13:02:45 -080071 // The layer's composer backend destination frame
72 optional RectProto hwc_frame = 30;
73 // The layer's composer backend source crop
74 optional FloatRectProto hwc_crop = 31;
75 // The layer's composer backend transform
76 optional int32 hwc_transform = 32;
77 optional int32 window_type = 33;
78 optional int32 app_id = 34;
Yiwei Zhang7c64f172018-03-07 14:52:28 -080079 // The layer's composition type
80 optional int32 hwc_composition_type = 35;
81 // If it's a buffer layer, indicate if the content is protected
82 optional bool is_protected = 36;
chaviw9885bd42018-07-10 16:57:27 -070083 // Current frame number being rendered.
84 optional uint64 curr_frame = 37;
85 // A list of barriers that the layer is waiting to update state.
86 repeated BarrierLayerProto barrier_layer = 38;
chaviw1d044282017-09-27 12:19:28 -070087}
88
89message PositionProto {
90 optional float x = 1;
91 optional float y = 2;
92}
93
94message SizeProto {
95 optional int32 w = 1;
96 optional int32 h = 2;
97}
98
99message TransformProto {
100 optional float dsdx = 1;
101 optional float dtdx = 2;
102 optional float dsdy = 3;
103 optional float dtdy = 4;
104}
105
106message RegionProto {
107 optional uint64 id = 1;
108 repeated RectProto rect = 2;
109}
110
111message RectProto {
112 optional int32 left = 1;
113 optional int32 top = 2;
114 optional int32 right = 3;
115 optional int32 bottom = 4;
116}
117
Yiwei Zhang068e31b2018-02-21 13:02:45 -0800118message FloatRectProto {
119 optional float left = 1;
120 optional float top = 2;
121 optional float right = 3;
122 optional float bottom = 4;
123}
124
chaviw1d044282017-09-27 12:19:28 -0700125message ActiveBufferProto {
126 optional uint32 width = 1;
127 optional uint32 height = 2;
128 optional uint32 stride = 3;
129 optional int32 format = 4;
130}
131
132message ColorProto {
133 optional float r = 1;
134 optional float g = 2;
135 optional float b = 3;
136 optional float a = 4;
Yiwei Zhang068e31b2018-02-21 13:02:45 -0800137}
chaviw9885bd42018-07-10 16:57:27 -0700138
139message BarrierLayerProto {
140 // layer id the barrier is waiting on.
141 optional int32 id = 1;
142 // frame number the barrier is waiting on.
143 optional uint64 frame_number = 2;
144}