protocol: Add a wl_surface request for setting buffer transformation
authorAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Tue, 27 Nov 2012 15:03:41 +0000 (17:03 +0200)
committerKristian Høgsberg <krh@bitplanet.net>
Tue, 27 Nov 2012 16:13:38 +0000 (11:13 -0500)
This request allows a client to render its contents according to the
output transform, enabling the compositor to use optimizations such as
overlays, hardware cursors, scan out of a client buffer for
fullscreen surface, etc, even if the output is rotated.

protocol/wayland.xml

index cc8fb06..0ce68ef 100644 (file)
     </event>
   </interface>
 
-  <interface name="wl_compositor" version="1">
+  <interface name="wl_compositor" version="2">
     <description summary="the compositor singleton">
       A compositor.  This object is a singleton global.  The
       compositor is in charge of combining the contents of multiple
     </event>
   </interface>
 
-  <interface name="wl_surface" version="1">
+  <interface name="wl_surface" version="2">
     <description summary="an onscreen surface">
       A surface.  This is an image that is displayed on the screen.
       It has a location, size and pixel contents.
       </description>
       <arg name="output" type="object" interface="wl_output"/>
     </event>
-  </interface>
+
+    <!-- Version 2 additions -->
+
+    <request name="set_buffer_transform" since="2">
+      <description summary="sets the buffer transformation">
+       This request sets an optional transformation on how the compositor
+       interprets the contents of the buffer attached to the surface. The
+       accepted values for the transform parameter are the values for
+       wl_output.transform.
+
+       Buffer transform is double-buffered state, see wl_surface.commit.
+
+       A newly created surface has its buffer transformation set to normal.
+
+       The purpose of this request is to allow clients to render content
+       according to the output transform, thus permiting the compositor to
+       use certain optimizations even if the display is rotated. Using
+       hardware overlays and scanning out a client buffer for fullscreen
+       surfaces are examples of such optmizations. Those optimizations are
+       highly dependent on the compositor implementation, so the use of this
+       request should be considered on a case-by-case basis.
+
+       Note that if the transform value includes 90 or 270 degree rotation,
+       the width of the buffer will become the surface height and the height
+       of the buffer will become the surface width.
+      </description>
+      <arg name="transform" type="int"/>
+    </request>
+   </interface>
 
   <interface name="wl_seat" version="1">
     <description summary="seat">