Home | History | Annotate | Download | only in layerproto
      1 // Definitions for SurfaceFlinger layers.
      2 
      3 syntax = "proto2";
      4 option optimize_for = LITE_RUNTIME;
      5 package android.surfaceflinger;
      6 
      7 // Contains a list of all layers.
      8 message LayersProto {
      9   repeated LayerProto layers = 1;
     10   optional SizeProto resolution = 2;
     11   optional string color_mode = 3;
     12   optional string color_transform = 4;
     13   optional int32 global_transform = 5;
     14 }
     15 
     16 // Information about each layer.
     17 message 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;
     71   // 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;
     79   // 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;
     83 }
     84 
     85 message PositionProto {
     86   optional float x = 1;
     87   optional float y = 2;
     88 }
     89 
     90 message SizeProto {
     91   optional int32 w = 1;
     92   optional int32 h = 2;
     93 }
     94 
     95 message TransformProto {
     96   optional float dsdx = 1;
     97   optional float dtdx = 2;
     98   optional float dsdy = 3;
     99   optional float dtdy = 4;
    100 }
    101 
    102 message RegionProto {
    103   optional uint64 id = 1;
    104   repeated RectProto rect = 2;
    105 }
    106 
    107 message RectProto {
    108   optional int32 left   = 1;
    109   optional int32 top    = 2;
    110   optional int32 right  = 3;
    111   optional int32 bottom = 4;
    112 }
    113 
    114 message FloatRectProto {
    115   optional float left = 1;
    116   optional float top = 2;
    117   optional float right = 3;
    118   optional float bottom = 4;
    119 }
    120 
    121 message ActiveBufferProto {
    122   optional uint32 width = 1;
    123   optional uint32 height = 2;
    124   optional uint32 stride = 3;
    125   optional int32 format = 4;
    126 }
    127 
    128 message ColorProto {
    129   optional float r = 1;
    130   optional float g = 2;
    131   optional float b = 3;
    132   optional float a = 4;
    133 }
    134