layers.proto 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. // Definitions for SurfaceFlinger layers.
  2. syntax = "proto3";
  3. option optimize_for = LITE_RUNTIME;
  4. package android.surfaceflinger;
  5. // Contains a list of all layers.
  6. message LayersProto {
  7. repeated LayerProto layers = 1;
  8. SizeProto resolution = 2;
  9. string color_mode = 3;
  10. string color_transform = 4;
  11. int32 global_transform = 5;
  12. }
  13. // Information about each layer.
  14. message LayerProto {
  15. // unique id per layer.
  16. int32 id = 1;
  17. // unique name per layer.
  18. string name = 2;
  19. // list of children this layer may have. May be empty.
  20. repeated int32 children = 3;
  21. // list of layers that are z order relative to this layer.
  22. repeated int32 relatives = 4;
  23. // The type of layer, ex Color, Layer
  24. string type = 5;
  25. RegionProto transparent_region = 6;
  26. RegionProto visible_region = 7;
  27. RegionProto damage_region = 8;
  28. uint32 layer_stack = 9;
  29. // The layer's z order. Can be z order in layer stack, relative to parent,
  30. // or relative to another layer specified in zOrderRelative.
  31. int32 z = 10;
  32. // The layer's position on the display.
  33. PositionProto position = 11;
  34. // The layer's requested position.
  35. PositionProto requested_position = 12;
  36. // The layer's size.
  37. SizeProto size = 13;
  38. // The layer's crop in it's own bounds.
  39. RectProto crop = 14;
  40. // The layer's crop in it's parent's bounds.
  41. RectProto final_crop = 15 [deprecated=true];
  42. bool is_opaque = 16;
  43. bool invalidate = 17;
  44. string dataspace = 18;
  45. string pixel_format = 19;
  46. // The layer's actual color.
  47. ColorProto color = 20;
  48. // The layer's requested color.
  49. ColorProto requested_color = 21;
  50. // Can be any combination of
  51. // hidden = 0x01
  52. // opaque = 0x02,
  53. // secure = 0x80,
  54. uint32 flags = 22;
  55. // The layer's actual transform
  56. TransformProto transform = 23;
  57. // The layer's requested transform.
  58. TransformProto requested_transform = 24;
  59. // The parent layer. This value can be null if there is no parent.
  60. int32 parent = 25;
  61. // The layer that this layer has a z order relative to. This value can be null.
  62. int32 z_order_relative_of = 26;
  63. // This value can be null if there's nothing to draw.
  64. ActiveBufferProto active_buffer = 27;
  65. // The number of frames available.
  66. int32 queued_frames = 28;
  67. bool refresh_pending = 29;
  68. // The layer's composer backend destination frame
  69. RectProto hwc_frame = 30;
  70. // The layer's composer backend source crop
  71. FloatRectProto hwc_crop = 31;
  72. // The layer's composer backend transform
  73. int32 hwc_transform = 32;
  74. int32 window_type = 33 [deprecated=true];
  75. int32 app_id = 34 [deprecated=true];
  76. // The layer's composition type
  77. int32 hwc_composition_type = 35;
  78. // If it's a buffer layer, indicate if the content is protected
  79. bool is_protected = 36;
  80. // Current frame number being rendered.
  81. uint64 curr_frame = 37;
  82. // A list of barriers that the layer is waiting to update state.
  83. repeated BarrierLayerProto barrier_layer = 38;
  84. // If active_buffer is not null, record its transform.
  85. TransformProto buffer_transform = 39;
  86. int32 effective_scaling_mode = 40;
  87. // Layer's corner radius.
  88. float corner_radius = 41;
  89. // Metadata map. May be empty.
  90. map<int32, bytes> metadata = 42;
  91. TransformProto effective_transform = 43;
  92. FloatRectProto source_bounds = 44;
  93. FloatRectProto bounds = 45;
  94. FloatRectProto screen_bounds = 46;
  95. InputWindowInfoProto input_window_info = 47;
  96. }
  97. message PositionProto {
  98. float x = 1;
  99. float y = 2;
  100. }
  101. message SizeProto {
  102. int32 w = 1;
  103. int32 h = 2;
  104. }
  105. message TransformProto {
  106. float dsdx = 1;
  107. float dtdx = 2;
  108. float dsdy = 3;
  109. float dtdy = 4;
  110. int32 type = 5;
  111. }
  112. message RegionProto {
  113. reserved 1; // Previously: uint64 id
  114. repeated RectProto rect = 2;
  115. }
  116. message RectProto {
  117. int32 left = 1;
  118. int32 top = 2;
  119. int32 right = 3;
  120. int32 bottom = 4;
  121. }
  122. message FloatRectProto {
  123. float left = 1;
  124. float top = 2;
  125. float right = 3;
  126. float bottom = 4;
  127. }
  128. message ActiveBufferProto {
  129. uint32 width = 1;
  130. uint32 height = 2;
  131. uint32 stride = 3;
  132. int32 format = 4;
  133. }
  134. message ColorProto {
  135. float r = 1;
  136. float g = 2;
  137. float b = 3;
  138. float a = 4;
  139. }
  140. message BarrierLayerProto {
  141. // layer id the barrier is waiting on.
  142. int32 id = 1;
  143. // frame number the barrier is waiting on.
  144. uint64 frame_number = 2;
  145. }
  146. message InputWindowInfoProto {
  147. uint32 layout_params_flags = 1;
  148. uint32 layout_params_type = 2;
  149. RectProto frame = 3;
  150. RegionProto touchable_region = 4;
  151. uint32 surface_inset = 5;
  152. bool visible = 6;
  153. bool can_receive_keys = 7;
  154. bool has_focus = 8;
  155. bool has_wallpaper = 9;
  156. float global_scale_factor = 10;
  157. float window_x_scale = 11;
  158. float window_y_scale = 12;
  159. uint32 crop_layer_id = 13;
  160. bool replace_touchable_region_with_crop = 14;
  161. RectProto touchable_region_crop = 15;
  162. }