surface alpha 修饰符管理器

该接口允许客户端为 surface 上的 alpha 值设置一个系数,这可用于将此类操作卸载(offload)给 compositor,而 compositor 也可以进而将其卸载给 KMS。

警告!此文件中描述的协议目前处于测试阶段。向后兼容的更改可能会与相应的接口版本增加一起添加。向后不兼容的更改只能通过创建该扩展的一个新主要版本来完成。

destroy()
销毁 alpha 修饰符管理器对象

销毁 alpha 修饰符管理器。这不会销毁使用该管理器创建的对象。

get_surface(id: new_id<wp_alpha_modifier_surface_v1>, surface: object<wl_surface>)
参数
类型
描述
idnew_id<wp_alpha_modifier_surface_v1>
surfaceobject<wl_surface>
创建一个新的 alpha 修饰符 surface 对象

创建一个与给定的 wl_surface 关联的新的 alpha 修饰符 surface 对象。如果该 wl_surface 已经关联了这样一个对象,则会引发 already_constructed 错误。

参数
描述
already_constructed0
wl_surface 已经有一个 alpha 修饰符对象

surface 的 alpha 修饰符对象

该接口允许客户端为 surface 上的 alpha 值设置一个系数,这可用于将此类操作卸载给 compositor。默认系数为 UINT32_MAX。

此对象必须在关联的 wl_surface 之前销毁。一旦 wl_surface 被销毁,对此对象的所有请求都将引发 no_surface 错误。

destroy()
销毁 alpha 修饰符对象

这将销毁该对象,且等同于将值设置为 UINT32_MAX 的 set_multiplier,具有与 set_multiplier 相同的双缓冲语义。

set_multiplier(factor: uint)
参数
类型
描述
factoruint
指定 alpha 乘数

设置 surface 的 alpha 乘数。alpha 乘数是双缓冲状态,详情请参阅 wl_surface.commit。

此系数应用于 compositor 的混合空间(blending space),作为在处理 wl_surface 的每像素 alpha 值之后的一个额外步骤。因此,除非在其他扩展中指定了混合空间,否则该系数的确切含义是未定义的。

即使附加到 wl_surface 的 buffer 没有 alpha 通道,此乘数也会被应用;在这种情况下,将使用 1 作为 alpha 值。

零表示完全透明,UINT32_MAX 表示完全不透明。

error { no_surface } 
参数
描述
no_surface0
wl_surface 已被销毁

合成器支持

Cage
Cage
0.2.0
COSMIC
COSMIC
1.0.0~beta.8
GameScope
GameScope
3.15.14
Hyprland
Hyprland
0.52.1
Jay
1.12.0
KWin
KWin
6.6
Labwc
Labwc
0.9.2
Louvre
Louvre
2.14.1
Mir
Mir
2.26
Muffin
Muffin
6.6.0
Mutter
Mutter
49.2
niri
niri
25.11
phoc
phoc
0.52
river
river
0.3.13
Sway
Sway
1.11
Treeland
Treeland
0.8.0
Wayfire
Wayfire
0.9.0
Weston
Weston
14.0.2
wp_alpha_modifier_v1
x
1
x
1
1
1
1
x
x
x
x
x
1
1
1
1
x
x

Copyright © 2024 Xaver Hugl

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Footer

© 2026 Wayland Explorer

本网站与 Wayland 官方项目无任何关联。网站所有内容均根据 Wayland 协议 XML 文件自动生成。

本网站使用的 Visual Studio Code - Codicons 遵循 CC BY 4.0 许可。