[PATCH weston] protocol: move sub-surfaces to Wayland

Kristian Høgsberg hoegsberg at gmail.com
Fri Nov 15 21:01:26 PST 2013


On Fri, Nov 15, 2013 at 04:12:13PM +0200, ppaalanen at gmail.com wrote:
> From: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
> 
> This reverts commit 2396aec6842c709a714f3825dbad9fd88478f2e6.
> 
> This exact version of the sub-surface protocol has been copied into
> Wayland core. Therefore it must be removed from here to avoid build
> conflicts and useless duplication.
> 
> No other changes to sub-surface protocol consumers are needed, the
> identical API is now offered by libwayland-client and libwayland-server.
> 
> The commit adding sub-surfaces to Wayland is:
> Author: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
> 
>     protocol: add sub-surfaces to the core
> 
> Signed-off-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>

Yup, about time - thanks Pekka.  Both patches applied.

Kristian

> ---
>  clients/.gitignore      |   2 -
>  clients/Makefile.am     |   4 -
>  clients/window.h        |   1 -
>  protocol/Makefile.am    |   1 -
>  protocol/subsurface.xml | 244 ------------------------------------------------
>  src/.gitignore          |   3 -
>  src/Makefile.am         |   4 -
>  src/compositor.c        |   1 -
>  tests/.gitignore        |   2 -
>  tests/Makefile.am       |   6 +-
>  tests/subsurface-test.c |   1 -
>  11 files changed, 1 insertion(+), 268 deletions(-)
>  delete mode 100644 protocol/subsurface.xml
> 
> diff --git a/clients/.gitignore b/clients/.gitignore
> index 23959cc..92e1659 100644
> --- a/clients/.gitignore
> +++ b/clients/.gitignore
> @@ -27,8 +27,6 @@ weston-keyboard
>  libtoytoolkit.a
>  screenshooter-client-protocol.h
>  screenshooter-protocol.c
> -subsurface-client-protocol.h
> -subsurface-protocol.c
>  tablet-shell-client-protocol.h
>  tablet-shell-protocol.c
>  text-client-protocol.h
> diff --git a/clients/Makefile.am b/clients/Makefile.am
> index 4f9dc48..032d900 100644
> --- a/clients/Makefile.am
> +++ b/clients/Makefile.am
> @@ -97,8 +97,6 @@ libtoytoolkit_la_SOURCES =			\
>  	window.h				\
>  	text-cursor-position-protocol.c		\
>  	text-cursor-position-client-protocol.h	\
> -	subsurface-protocol.c			\
> -	subsurface-client-protocol.h		\
>  	workspaces-protocol.c			\
>  	workspaces-client-protocol.h
>  
> @@ -227,8 +225,6 @@ BUILT_SOURCES =					\
>  	desktop-shell-protocol.c		\
>  	tablet-shell-client-protocol.h		\
>  	tablet-shell-protocol.c			\
> -	subsurface-client-protocol.h		\
> -	subsurface-protocol.c			\
>  	workspaces-client-protocol.h		\
>  	workspaces-protocol.c
>  
> diff --git a/clients/window.h b/clients/window.h
> index 838ea4e..66cf985 100644
> --- a/clients/window.h
> +++ b/clients/window.h
> @@ -28,7 +28,6 @@
>  #include <cairo.h>
>  #include "../shared/config-parser.h"
>  #include "../shared/zalloc.h"
> -#include "subsurface-client-protocol.h"
>  
>  #define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0])
>  
> diff --git a/protocol/Makefile.am b/protocol/Makefile.am
> index d09d8eb..14a4b5a 100644
> --- a/protocol/Makefile.am
> +++ b/protocol/Makefile.am
> @@ -6,7 +6,6 @@ protocol_sources =				\
>  	text.xml				\
>  	input-method.xml			\
>  	workspaces.xml				\
> -	subsurface.xml				\
>  	text-cursor-position.xml		\
>  	wayland-test.xml
>  
> diff --git a/protocol/subsurface.xml b/protocol/subsurface.xml
> deleted file mode 100644
> index 9e4a658..0000000
> --- a/protocol/subsurface.xml
> +++ /dev/null
> @@ -1,244 +0,0 @@
> -<?xml version="1.0" encoding="UTF-8"?>
> -<protocol name="subsurface">
> -
> -  <copyright>
> -    Copyright © 2012-2013 Collabora, Ltd.
> -
> -    Permission to use, copy, modify, distribute, and sell this
> -    software and its documentation for any purpose is hereby granted
> -    without fee, provided that the above copyright notice appear in
> -    all copies and that both that copyright notice and this permission
> -    notice appear in supporting documentation, and that the name of
> -    the copyright holders not be used in advertising or publicity
> -    pertaining to distribution of the software without specific,
> -    written prior permission.  The copyright holders make no
> -    representations about the suitability of this software for any
> -    purpose.  It is provided "as is" without express or implied
> -    warranty.
> -
> -    THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
> -    SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
> -    FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
> -    SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
> -    WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
> -    AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
> -    ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
> -    THIS SOFTWARE.
> -  </copyright>
> -
> -  <interface name="wl_subcompositor" version="1">
> -    <description summary="sub-surface compositing">
> -      The global interface exposing sub-surface compositing capabilities.
> -      A wl_surface, that has sub-surfaces associated, is called the
> -      parent surface. Sub-surfaces can be arbitrarily nested and create
> -      a tree of sub-surfaces.
> -
> -      The root surface in a tree of sub-surfaces is the main
> -      surface. The main surface cannot be a sub-surface, because
> -      sub-surfaces must always have a parent.
> -
> -      A main surface with its sub-surfaces forms a (compound) window.
> -      For window management purposes, this set of wl_surface objects is
> -      to be considered as a single window, and it should also behave as
> -      such.
> -
> -      The aim of sub-surfaces is to offload some of the compositing work
> -      within a window from clients to the compositor. A prime example is
> -      a video player with decorations and video in separate wl_surface
> -      objects. This should allow the compositor to pass YUV video buffer
> -      processing to dedicated overlay hardware when possible.
> -    </description>
> -
> -    <request name="destroy" type="destructor">
> -      <description summary="unbind from the subcompositor interface">
> -	Informs the server that the client will not be using this
> -	protocol object anymore. This does not affect any other
> -	objects, wl_subsurface objects included.
> -      </description>
> -    </request>
> -
> -    <enum name="error">
> -      <entry name="bad_surface" value="0"
> -             summary="the to-be sub-surface is invalid"/>
> -    </enum>
> -
> -    <request name="get_subsurface">
> -      <description summary="give a surface the role sub-surface">
> -	Create a sub-surface interface for the given surface, and
> -	associate it with the given parent surface. This turns a
> -	plain wl_surface into a sub-surface.
> -
> -	The to-be sub-surface must not already have a dedicated
> -	purpose, like any shell surface type, cursor image, drag icon,
> -	or sub-surface. Otherwise a protocol error is raised.
> -      </description>
> -
> -      <arg name="id" type="new_id" interface="wl_subsurface"
> -           summary="the new subsurface object id"/>
> -      <arg name="surface" type="object" interface="wl_surface"
> -           summary="the surface to be turned into a sub-surface"/>
> -      <arg name="parent" type="object" interface="wl_surface"
> -           summary="the parent surface"/>
> -    </request>
> -  </interface>
> -
> -  <interface name="wl_subsurface" version="1">
> -    <description summary="sub-surface interface to a wl_surface">
> -      An additional interface to a wl_surface object, which has been
> -      made a sub-surface. A sub-surface has one parent surface. A
> -      sub-surface's size and position are not limited to that of the parent.
> -      Particularly, a sub-surface is not automatically clipped to its
> -      parent's area.
> -
> -      A sub-surface becomes mapped, when a non-NULL wl_buffer is applied
> -      and the parent surface is mapped. The order of which one happens
> -      first is irrelevant. A sub-surface is hidden if the parent becomes
> -      hidden, or if a NULL wl_buffer is applied. These rules apply
> -      recursively through the tree of surfaces.
> -
> -      The behaviour of wl_surface.commit request on a sub-surface
> -      depends on the sub-surface's mode. The possible modes are
> -      synchronized and desynchronized, see methods
> -      wl_subsurface.set_sync and wl_subsurface.set_desync. Synchronized
> -      mode caches the wl_surface state to be applied when the parent's
> -      state gets applied, and desynchronized mode applies the pending
> -      wl_surface state directly. A sub-surface is initially in the
> -      synchronized mode.
> -
> -      Sub-surfaces have also other kind of state, which is managed by
> -      wl_subsurface requests, as opposed to wl_surface requests. This
> -      state includes the sub-surface position relative to the parent
> -      surface (wl_subsurface.set_position), and the stacking order of
> -      the parent and its sub-surfaces (wl_subsurface.place_above and
> -      .place_below). This state is applied when the parent surface's
> -      wl_surface state is applied, regardless of the sub-surface's mode.
> -      As the exception, set_sync and set_desync are effective immediately.
> -
> -      The main surface can be thought to be always in desynchronized mode,
> -      since it does not have a parent in the sub-surfaces sense.
> -
> -      Even if a sub-surface is in desynchronized mode, it will behave as
> -      in synchronized mode, if its parent surface behaves as in
> -      synchronized mode. This rule is applied recursively throughout the
> -      tree of surfaces. This means, that one can set a sub-surface into
> -      synchronized mode, and then assume that all its child and grand-child
> -      sub-surfaces are synchronized, too, without explicitly setting them.
> -
> -      If the wl_surface associated with the wl_subsurface is destroyed, the
> -      wl_subsurface object becomes inert. Note, that destroying either object
> -      takes effect immediately. If you need to synchronize the removal
> -      of a sub-surface to the parent surface update, unmap the sub-surface
> -      first by attaching a NULL wl_buffer, update parent, and then destroy
> -      the sub-surface.
> -
> -      If the parent wl_surface object is destroyed, the sub-surface is
> -      unmapped.
> -    </description>
> -
> -    <request name="destroy" type="destructor">
> -      <description summary="remove sub-surface interface">
> -	The sub-surface interface is removed from the wl_surface object
> -	that was turned into a sub-surface with
> -	wl_subcompositor.get_subsurface request. The wl_surface's association
> -	to the parent is deleted, and the wl_surface loses its role as
> -	a sub-surface. The wl_surface is unmapped.
> -      </description>
> -    </request>
> -
> -    <enum name="error">
> -      <entry name="bad_surface" value="0"
> -             summary="wl_surface is not a sibling or the parent"/>
> -    </enum>
> -
> -    <request name="set_position">
> -      <description summary="reposition the sub-surface">
> -	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 next wl_surface.commit on the parent surface will reset
> -	the sub-surface's position to the scheduled coordinates.
> -
> -	The initial position is 0, 0.
> -      </description>
> -
> -      <arg name="x" type="int" summary="coordinate in the parent surface"/>
> -      <arg name="y" type="int" summary="coordinate in the parent surface"/>
> -    </request>
> -
> -    <request name="place_above">
> -      <description summary="restack the sub-surface">
> -	This sub-surface is taken from the stack, and put back just
> -	above the reference surface, changing the z-order of the sub-surfaces.
> -	The reference surface must be one of the sibling surfaces, or the
> -	parent surface. Using any other surface, including this sub-surface,
> -	will cause a protocol error.
> -
> -	The z-order is double-buffered state, and will be applied on the
> -	next commit of the parent surface.
> -	See wl_surface.commit and wl_subcompositor.get_subsurface.
> -
> -	A new sub-surface is initially added as the top-most in the stack
> -	of its siblings and parent.
> -      </description>
> -
> -      <arg name="sibling" type="object" interface="wl_surface"
> -           summary="the reference surface"/>
> -    </request>
> -
> -    <request name="place_below">
> -      <description summary="restack the sub-surface">
> -	The sub-surface is placed just below of the reference surface.
> -	See wl_subsurface.place_above.
> -      </description>
> -
> -      <arg name="sibling" type="object" interface="wl_surface"
> -           summary="the reference surface"/>
> -    </request>
> -
> -    <request name="set_sync">
> -      <description summary="set sub-surface to synchronized mode">
> -	Change the commit behaviour of the sub-surface to synchronized
> -	mode, also described as the parent dependant mode.
> -
> -	In synchronized mode, wl_surface.commit on a sub-surface will
> -	accumulate the committed state in a cache, but the state will
> -	not be applied and hence will not change the compositor output.
> -	The cached state is applied to the sub-surface immediately after
> -	the parent surface's state is applied. This ensures atomic
> -	updates of the parent and all its synchronized sub-surfaces.
> -	Applying the cached state will invalidate the cache, so further
> -	parent surface commits do not (re-)apply old state.
> -
> -	See wl_subsurface for the recursive effect of this mode.
> -      </description>
> -    </request>
> -
> -    <request name="set_desync">
> -      <description summary="set sub-surface to desynchronized mode">
> -	Change the commit behaviour of the sub-surface to desynchronized
> -	mode, also described as independent or freely running mode.
> -
> -	In desynchronized mode, wl_surface.commit on a sub-surface will
> -	apply the pending state directly, without caching, as happens
> -	normally with a wl_surface. Calling wl_surface.commit on the
> -	parent surface has no effect on the sub-surface's wl_surface
> -	state. This mode allows a sub-surface to be updated on its own.
> -
> -	If cached state exists when wl_surface.commit is called in
> -	desynchronized mode, the pending state is added to the cached
> -	state, and applied as whole. This invalidates the cache.
> -
> -	Note: even if a sub-surface is set to desynchronized, a parent
> -	sub-surface may override it to behave as synchronized. For details,
> -	see wl_subsurface.
> -
> -	If a surface's parent surface behaves as desynchronized, then
> -	the cached state is applied on set_desync.
> -      </description>
> -    </request>
> -
> -  </interface>
> -</protocol>
> diff --git a/src/.gitignore b/src/.gitignore
> index 539150d..723967d 100644
> --- a/src/.gitignore
> +++ b/src/.gitignore
> @@ -19,6 +19,3 @@ workspaces-protocol.c
>  workspaces-server-protocol.h
>  input-method-protocol.c
>  input-method-server-protocol.h
> -subsurface-server-protocol.h
> -subsurface-protocol.c
> -
> diff --git a/src/Makefile.am b/src/Makefile.am
> index 9925129..811f7ed 100644
> --- a/src/Makefile.am
> +++ b/src/Makefile.am
> @@ -36,8 +36,6 @@ weston_SOURCES =				\
>  	input-method-server-protocol.h		\
>  	workspaces-protocol.c			\
>  	workspaces-server-protocol.h		\
> -	subsurface-protocol.c			\
> -	subsurface-server-protocol.h		\
>  	bindings.c				\
>  	animation.c				\
>  	noop-renderer.c				\
> @@ -350,8 +348,6 @@ BUILT_SOURCES =					\
>  	input-method-server-protocol.h		\
>  	workspaces-server-protocol.h		\
>  	workspaces-protocol.c			\
> -	subsurface-server-protocol.h		\
> -	subsurface-protocol.c			\
>  	git-version.h
>  
>  CLEANFILES = $(BUILT_SOURCES)
> diff --git a/src/compositor.c b/src/compositor.c
> index c6cf682..1d6ad62 100644
> --- a/src/compositor.c
> +++ b/src/compositor.c
> @@ -53,7 +53,6 @@
>  #endif
>  
>  #include "compositor.h"
> -#include "subsurface-server-protocol.h"
>  #include "../shared/os-compatibility.h"
>  #include "git-version.h"
>  #include "version.h"
> diff --git a/tests/.gitignore b/tests/.gitignore
> index aba378c..fbeeed9 100644
> --- a/tests/.gitignore
> +++ b/tests/.gitignore
> @@ -9,5 +9,3 @@ test-text-client
>  wayland-test-client-protocol.h
>  wayland-test-protocol.c
>  wayland-test-server-protocol.h
> -subsurface-client-protocol.h
> -subsurface-protocol.c
> diff --git a/tests/Makefile.am b/tests/Makefile.am
> index 5be52c6..8e08375 100644
> --- a/tests/Makefile.am
> +++ b/tests/Makefile.am
> @@ -91,9 +91,7 @@ weston_test_client_src =		\
>  	weston-test-client-helper.c	\
>  	weston-test-client-helper.h	\
>  	wayland-test-protocol.c		\
> -	wayland-test-client-protocol.h	\
> -	subsurface-protocol.c		\
> -	subsurface-client-protocol.h
> +	wayland-test-client-protocol.h
>  weston_test_client_libs =		\
>  	$(SIMPLE_CLIENT_LIBS)		\
>  	../shared/libshared.la		\
> @@ -146,8 +144,6 @@ endif
>  EXTRA_DIST = weston-tests-env
>  
>  BUILT_SOURCES =					\
> -	subsurface-protocol.c			\
> -	subsurface-client-protocol.h		\
>  	wayland-test-protocol.c			\
>  	wayland-test-server-protocol.h		\
>  	wayland-test-client-protocol.h
> diff --git a/tests/subsurface-test.c b/tests/subsurface-test.c
> index 98e00fe..1c2641b 100644
> --- a/tests/subsurface-test.c
> +++ b/tests/subsurface-test.c
> @@ -23,7 +23,6 @@
>  #include <string.h>
>  
>  #include "weston-test-client-helper.h"
> -#include "subsurface-client-protocol.h"
>  #include <stdio.h>
>  
>  #define NUM_SUBSURFACES 3
> -- 
> 1.8.1.5
> 


More information about the wayland-devel mailing list