Go to index / Go to protocols

surface_augmenter ↗

surface_augmenter
surface_augmenter

Version 12

surface composition delegation

The global interface exposing surface delegated composition capabilities is used to instantiate an interface extension for a wl_surface object. This extended interface will then allow delegated compostion of the surface contents, effectively disconnecting the direct relationship between the buffer and the surface content (adding support for solid quads and rounded corner for instance).

surface_augmenter
request destroy()
Destructor

    Destroy the surface augmenter.

    Informs the server that the client will not be using this protocol object anymore. This does not affect any other objects, augmenter objects included.

    surface_augmenter
    enum error {
        augmented_surface_exists = 0,
    }
    • augmented_surface_exists — the surface already has a augmenter object associated
    surface_augmenter
    request create_solid_color_buffer(
        id: new_id<wl_buffer>,
        color: array,
        width: int,
        height: int,
    )
    • color — quad color represented by a SkColor4f

    creates a solid color buffer

    Instantiate a buffer of the given size for the purpose of a solid color quad of a given color.

    This buffer does not require resources in the compositor, so it is immediately reusable and shareable. So it is not responsible for sending wl_buffer.release or zwp_linux_buffer_release_v1.*_release events.

    surface_augmenter
    request get_augmented_surface(
        id: new_id<augmented_surface>,
        surface: object<wl_surface>,
    )
    • id — the new augmenter interface id
    • surface — the surface

    extend surface interface for delegation

    Instantiate an interface extension for the given wl_surface to extend composition of its content. If the given wl_surface already has a augmentation object associated, the delegate_exists protocol error is raised.

    If needs to be called, this must be called before a surface role object is created.

    surface_augmenter
    request get_augmented_subsurface(
        id: new_id<augmented_sub_surface>,
        subsurface: object<wl_subsurface>,
    )
    Available since version 2
    • id — the new augmenter interface id
    • subsurface — the subsurface

    extend sub surface interface for delegation

    Instantiate an interface extension for the given wl_subsurface to extend composition of its content. If the given wl_subsurface already has a augmentation object associated, the delegate_exists protocol error is raised.

    surface_augmenter
    augmented_surface

    Version 12

    delegate composition of a wl_surface

    An additional interface to a wl_surface object, which allows the client to specify the delegated composition of the surface contents.

    This makes the surface an object only used to composite its parent surface. This means the surface will be clipped to the parent bounds, will not receive input events or display enter/leave events, etc.

    Use wl_subsurface role objects to express which parent surface this will perform delegate composition for.

    The commits to this surface is assumed to behave synchronized with its parent commits, as a synchronized wl_subsurface would.

    The compositor does not perform fine-grained damage extension calculation that is introduced by an augmented_surface moving, resizing, changing stacking, or disappearing. A client performing such operations should account for it and damage the parent non-augmented wl_surface accordingly.

    Various changes like adding or removing an augmented sub-surface, changing its position or stacking order, will not introduce extra damage on the compositor side. The parent wl_surface should account for the extra damage introduced.

    This surface, using a wl_subsurface role of its parent, cannot be stacked relative to non-augmented sub-surfaces of the parent, but can be stacked relative to other augmented children. Nor can this surface have non-augmented sub-surface children.

    A mixed tree structure of using augmented_surfaces to delegate composite wl_surfaces would look like this:

          wl_surface@1:{ augmented_surface@1,2,3 }
          /           \_____
         /                   \

    wl_surface@2: wl_surface@3: { augmented_surface@4,5 } { augmented_surface@6 }

    Every wl_surface has a list of augmented_surfaces. Assuming the wl_surface stacking order, from bottom to top, is: wl_surface@1, wl_surface@2, wl_surface@3

    Then the final composition order, from bottom to top, is: wl_surface@1, augmented_surface@1,2,3, wl_surface@2, augmented_surface@4,5, wl_surface@3, augmented_surface@6

    augmented_surface
    request destroy()
    Destructor

      remove delegated composition of the surface

      Client will no longer be able to control the delegated composition properties of this surface. This does not change the existing delegated composition behavior.

      augmented_surface
      enum error {
          bad_value = 0,
          no_surface = 1,
          bad_surface = 2,
      }
      • bad_value — negative values in radius or size
      • no_surface — the wl_surface was destroyed
      • bad_surface — incompatible surface
      augmented_surface
      request set_rounded_corners(
          top_left: fixed,
          top_right: fixed,
          bottom_right: fixed,
          bottom_left: fixed,
      )
      • top_left — top left corner
      • top_right — top right corner
      • bottom_right — bottom right corner
      • bottom_left — bottom left corner

      set the surface rounded corners

      [Deprecated]. Use set_rounded_corners_clip_bounds request below.

      Informs the server that it must apply the rounded corners mask filter that shall be applied on next commit. Use set_rounded_corners_bounds instead.

      augmented_surface
      request set_destination_size(
          width: fixed,
          height: fixed,
      )
      Available since version 2
      • width — width of the surface
      • height — height of the surface

      set the surface destination viewport size, with subpixel accuracy

      Sets the surface destination viewport size, with subpixel accuracy. This state is double-buffered, and is applied on the next wl_surface.commit.

      augmented_surface
      request set_rounded_clip_bounds(
          x: int,
          y: int,
          width: int,
          height: int,
          top_left: fixed,
          top_right: fixed,
          bottom_right: fixed,
          bottom_left: fixed,
      )
      Available since version 2
      • top_left — top left corner
      • top_right — top right corner
      • bottom_right — bottom right corner
      • bottom_left — bottom left corner

      set the surface rounded clip bounds

      [Deprecated]. Use set_rounded_corners_clip_bounds request below.

      Informs the server that it must apply the rounded clipping mask filter that shall be applied on next commit. The mask can be uniform for several surfaces and applied uniformally so that two or more surfaces visually look as a single surface with rounded corners. Please note this is can only be used on surfaces that are used as overlays, which must not have any subtrees. The rounding will be ignored if the bounds are outside of the surface.

      augmented_surface
      request set_background_color(
          color: array,
      )
      Available since version 3
      • color — overlay color represented by a SkColor4f

      sets a background color of this surface

      Sets a background color of a this surface. This information will be associated with the next buffer commit. Please note this is different from solid color buffers, which creates a new buffer instance, and rather provides additional information how the buffer should be composited. Passing empty array means the background color is reset. The default value is determined by the Wayland compositor then.

      augmented_surface
      request set_trusted_damage(
          enabled: int,
      )
      Available since version 6

        sets the trusted damage state of this surface

        [Deprecated] When set, this surface trusts all damage reported to this surface and descendant sub-surfaces is accurate, and will not try to recompute it. If not set, various changes like adding or removing a sub-surface, changing its position or stacking order, can cause full damage on this surface.

        The initial state is disabled.

        augmented_surface
        request set_rounded_corners_clip_bounds(
            x: fixed,
            y: fixed,
            width: fixed,
            height: fixed,
            top_left: fixed,
            top_right: fixed,
            bottom_right: fixed,
            bottom_left: fixed,
        )
        Available since version 7
        • top_left — top left corner
        • top_right — top right corner
        • bottom_right — bottom right corner
        • bottom_left — bottom left corner

        set the surface rounded corners clip bounds

        Informs the server that it must apply the rounded clipping mask filter that shall be applied on next commit. The mask can be uniform for several surfaces and applied uniformally so that two or more surfaces visually look as a single surface with rounded corners.

        Since version 9, the bounds will be placed with its origin (top left corner pixel) at the location x, y of the surface local coordinate system. On version 8 or before, it is placed with its root surface coordinates, but this is deperecated.

        Please note this is can only be used on surfaces that are used as overlays, which must not have any subtrees. The rounding will be ignored if the bounds are outside of the surface.

        augmented_surface
        request set_clip_rect(
            x: fixed,
            y: fixed,
            width: fixed,
            height: fixed,
        )
        Available since version 8
        • x — x coordinate in the surface local coordinates
        • y — y coordinate in the surface local coordinates
        • width — width of the clip rect
        • height — height of the clip rect

        sets a subsurface clip rect on surface local coordinates

        This schedules a clip rect to be applied when drawing this sub-surface. The clip will be placed with its origin (top left corner pixel) at the location x, y of the surface local coordinate system. The coordinates are not restricted to the surface area. Negative x and y values are allowed.

        If all of x, y, width and height are -1.0, the clip rect is unset instead.

        Initially, surfaces have no clip set. This state is double-buffered, and is applied on the next wl_surface.commit.

        augmented_surface
        request set_frame_trace_id(
            id_hi: uint,
            id_lo: uint,
        )
        Available since version 11
        • id_hi — high 32 bits of the trace ID
        • id_lo — low 32 bits of the trace ID

        sets a trace ID for tracking frame submission flow

        This sets a trace ID to connect the frame submission trace event flow at the client and the server side. This state is double-buffered, and is applied on the next wl_surface.commit.

        surface_augmenter
        augmented_sub_surface

        Version 5

        delegate composition of a wl_subsurface

        An additional interface to a wl_subsurface object, which allows the client to specify the delegated composition of the surface contents.

        augmented_sub_surface
        request destroy()
        Destructor

          remove delegated composition of the surface

          The associated wl_surface's augmenter is removed. The change is applied on the next wl_surface.commit.

          augmented_sub_surface
          request set_position(
              x: fixed,
              y: fixed,
          )
          • x — x coordinate in the parent surface
          • y — y coordinate in the parent surface

          sets a subsurface position with subpixel accuracy

          This schedules a sub-surface position change. The sub-surface will be moved so that its origin (top left corner pixel) will be at the location x, y of the parent surface coordinate system. The coordinates are not restricted to the parent surface area. Negative values are allowed.

          The scheduled coordinates will take effect whenever the state of the parent surface is applied. When this happens depends on whether the parent surface is in synchronized mode or not. See wl_subsurface.set_sync and wl_subsurface.set_desync for details.

          If more than one set_position request is invoked by the client before the commit of the parent surface, the position of a new request always replaces the scheduled position from any previous request.

          The initial position is 0, 0. This state is double-buffered, and is applied on the next wl_surface.commit.

          augmented_sub_surface
          request set_clip_rect(
              x: fixed,
              y: fixed,
              width: fixed,
              height: fixed,
          )
          Available since version 4
          • x — x coordinate in the parent surface
          • y — y coordinate in the parent surface
          • width — width of the clip rect
          • height — height of the clip rect

          sets a subsurface clip rect with subpixel accuracy

          [Deprecated] Use set_clip_rect on augmented_surface instead. This schedules a clip rect to be applied when drawing this sub-surface. The clip will be placed with its origin (top left corner pixel) at the location x, y of the parent surface coordinate system. The coordinates are not restricted to the parent surface area. Negative x and y values are allowed.

          If all of x, y, width and height are -1.0, the clip rect is unset instead.

          Initially, surfaces have no clip set. This state is double-buffered, and is applied on the next wl_surface.commit.

          augmented_sub_surface
          request set_transform(
              matrix: array,
          )
          Available since version 5
          • matrix — size 6 affine matrix, or size 0 for identity matrix

          sets a subsurface transform as an affine matrix

          This schedules a transform to be applied when drawing this sub-surface. This transform does not apply to any child surfaces of this sub-surface.

          The matrix should be passed as an array of 6 floats in column major order. An empty array can be sent to set the transform to the identity matrix.

          The initial transform is identity. This state is double-buffered, and is applied on the next wl_surface.commit.

          augmented_sub_surface
          enum error {
              invalid_size = 0,
          }
          • invalid_size — array sent with invalid dimensions