blob: 77c6675b7fc63b8e1e71c98f54c5d95edb399a2a [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;
chaviw1d044282017-09-27 12:19:28 -070083}
84
85message PositionProto {
86 optional float x = 1;
87 optional float y = 2;
88}
89
90message SizeProto {
91 optional int32 w = 1;
92 optional int32 h = 2;
93}
94
95message TransformProto {
96 optional float dsdx = 1;
97 optional float dtdx = 2;
98 optional float dsdy = 3;
99 optional float dtdy = 4;
100}
101
102message RegionProto {
103 optional uint64 id = 1;
104 repeated RectProto rect = 2;
105}
106
107message RectProto {
108 optional int32 left = 1;
109 optional int32 top = 2;
110 optional int32 right = 3;
111 optional int32 bottom = 4;
112}
113
Yiwei Zhang068e31b2018-02-21 13:02:45 -0800114message FloatRectProto {
115 optional float left = 1;
116 optional float top = 2;
117 optional float right = 3;
118 optional float bottom = 4;
119}
120
chaviw1d044282017-09-27 12:19:28 -0700121message ActiveBufferProto {
122 optional uint32 width = 1;
123 optional uint32 height = 2;
124 optional uint32 stride = 3;
125 optional int32 format = 4;
126}
127
128message ColorProto {
129 optional float r = 1;
130 optional float g = 2;
131 optional float b = 3;
132 optional float a = 4;
Yiwei Zhang068e31b2018-02-21 13:02:45 -0800133}