add wtz-blender tizen protocol 75/295375/4
authorChangyeon Lee <cyeon.lee@samsung.com>
Wed, 5 Jul 2023 10:40:05 +0000 (19:40 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Thu, 6 Jul 2023 07:54:16 +0000 (16:54 +0900)
This protocol provides set of interfaces used to control the
alpha compositing of surface contents, base on a Chromium
alpha-compositing-unstable-v1 and wayland-protocols wp_blender
(development phase).

Although both protocols provide an interface to equation,
this protocol does not provide it because current display-server
of tizen only supports premultiplied alpha blending.

Change-Id: I94b13c0226d9c95a410734a11124f32fcb1d371d

Makefile.am
protocol/tizen/wtz-blender.xml [new file with mode: 0644]

index 58f6e76..e20f79d 100644 (file)
@@ -408,6 +408,23 @@ librelative_pointer_unstable_v1_client_la_SOURCES = protocol/unstable/relative-p
 librelative_pointer_unstable_v1_client_la_CFLAGS  = @WAYLAND_CLIENT_CFLAGS@
 librelative_pointer_unstable_v1_client_la_LIBADD  = @WAYLAND_CLIENT_LIBS@
 
+### wtz_blender
+protocol_LTLIBRARIES += \
+        libwtz-blender-server.la \
+        libwtz-blender-client.la
+pkgconfig_DATA += \
+        src/wtz-blender-server.pc \
+        src/wtz-blender-client.pc
+protocolinclude_HEADERS += \
+        protocol/tizen/wtz-blender-server-protocol.h \
+        protocol/tizen/wtz-blender-client-protocol.h
+libwtz_blender_server_la_SOURCES = protocol/tizen/wtz-blender-protocol.c
+libwtz_blender_server_la_CFLAGS  = @WAYLAND_SERVER_CFLAGS@
+libwtz_blender_server_la_LIBADD  = @WAYLAND_SERVER_LIBS@
+libwtz_blender_client_la_SOURCES = protocol/tizen/wtz-blender-protocol.c
+libwtz_blender_client_la_CFLAGS  = @WAYLAND_CLIENT_CFLAGS@
+libwtz_blender_client_la_LIBADD  = @WAYLAND_CLIENT_LIBS@
+
 ### wtz_foreign
 protocol_LTLIBRARIES += \
                libwtz-foreign-server.la \
diff --git a/protocol/tizen/wtz-blender.xml b/protocol/tizen/wtz-blender.xml
new file mode 100644 (file)
index 0000000..b418c99
--- /dev/null
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<protocol name="wtz_blender">
+
+  <copyright>
+    Copyright 2023 Samsung Electronics co., Ltd. All Rights Reserved.
+
+    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>
+
+  <description summary="surface blending">
+    This protocol allows clients to have more control over alpha compositing
+    of surface contents.
+  </description>
+
+  <interface name="wtz_blender" version="1">
+    <description summary="surface binding">
+        A global allows clients to create wtz_blend objects.
+    </description>
+
+    <enum name="error">
+      <entry name="blend_exists" value="1"
+        summary="blend object already exists for this surface"/>
+    </enum>
+
+    <request name="destroy" type="destructor">
+      <description summary="destroy the blender">
+        Destroy the blender object.
+      </description>
+    </request>
+
+    <request name="get_blend">
+      <description summary="create a blend object for a surface">
+        Create a blend object for a surface.
+
+        If the wl_surface already has a blend object associated, the
+        blend_exists protocol error is raised.
+      </description>
+      <arg name="id" type="new_id" interface="wtz_blend"
+        summary="the new blend object"/>
+      <arg name="surface" type="object" interface="wl_surface"
+        summary="the surface to associate the blend object to"/>
+    </request>
+  </interface>
+
+  <interface name="wtz_blend" version="1">
+    <description summary="advanced surface blending">
+      A surface extension interface for setting a global alpha value applied
+      to the whole surface.
+
+      When the blend object is created its its alpha value is UINT32_MAX
+      (ie, opaque).
+
+      Use of this interface has no effect on the surface's opaque region
+      as set by wl_surface.set_opaque_region. Clients must make sure to set
+      their opaque region correctly to prevent repaint artifacts.
+
+      The blend object must be destroyed before the wl_surface, otherwise the
+      defunct protocol error is raised.
+    </description>
+
+    <enum name="error">
+      <entry name="defunct" value="1" summary="surface destroyed before blend"/>
+    </enum>
+
+    <request name="destroy" type="destructor">
+      <description summary="destroy the blend object">
+        Destroy the blend object.
+
+        On the next wl_surface.commit, the blend object state is withdrawn.
+      </description>
+    </request>
+
+    <request name="set_alpha">
+      <description summary="set the alpha value">
+        Set the alpha value applied to the whole surface for compositing. This
+        alpha value is applied as an additional step after the processing of
+        per-pixel alpha values for the wl_surface.
+
+        Zero means completely transparent, UINT32_MAX means completely opaque.
+
+        The alpha value is double-buffered state, and will be applied on the
+        next wl_surface.commit.
+      </description>
+      <arg name="value" type="uint" summary="alpha value"/>
+    </request>
+  </interface>
+
+</protocol>