撕裂控制协议

对于游戏或绘图板等用例,通过使用异步页面翻转(page flip)接受撕裂以降低延迟是有意义的。该全局对象是一个工厂接口,允许客户端通知其 surface 内容适合哪种类型的呈现。

像 EGL 或 Vulkan 这样自行管理 buffer 队列和 wl_surface 提交的图形 API,很可能会在内部使用此扩展。如果客户端正在为 wl_surface 使用这样的 API,则不应直接在该 surface 上使用此扩展,以避免引发 tearing_control_exists 协议错误。

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

destroy()
销毁撕裂控制工厂对象

销毁此撕裂控制工厂对象。其他对象,包括由此工厂创建的 wp_tearing_control_v1 对象,不受此请求的影响。

get_tearing_control(id: new_id<wp_tearing_control_v1>, surface: object<wl_surface>)
参数
类型
描述
idnew_id<wp_tearing_control_v1>
surfaceobject<wl_surface>
为撕裂控制扩展 surface 接口

为给定的 wl_surface 实例化一个接口扩展,以请求用于呈现的异步页面翻转。

如果给定的 wl_surface 已经关联了 wp_tearing_control_v1 对象,则引发 tearing_control_exists 协议错误。

参数
描述
tearing_control_exists0
surface 已经关联了撕裂对象

每 surface 撕裂控制接口

对 wl_surface 对象的一个附加接口,允许客户端向合成器(compositor)提示 surface 上的内容是否适合使用撕裂进行呈现。 默认的呈现提示是 vsync。有关更多详细信息,请参阅 presentation_hint。

如果关联的 wl_surface 被销毁,此对象将变得惰性(inert)并且应当被销毁。

set_presentation_hint(hint: uint<wp_tearing_control_v1.presentation_hint>)
设置呈现提示

设置关联 wl_surface 的呈现提示。此状态是双缓冲的,请参阅 wl_surface.commit。

合成器可以自由地根据各种条件(如硬件功能、surface 状态和用户偏好)动态遵守或忽略此提示。

destroy()
销毁撕裂控制对象

销毁此 surface 撕裂对象并将呈现提示恢复为 vsync。该更改将在下一次 wl_surface.commit 时应用。

presentation_hint { vsync, async } 
参数
描述
vsync0
无撕裂呈现

此 surface 的内容旨在与垂直消隐周期(vertical blanking period)同步。这不应导致可见的撕裂,并且可能会导致 surface 提交被呈现之前的延迟。

async1
异步呈现

此 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_tearing_control_manager_v1
x
x
x
1
1
1
1
1
x
x
x
x
x
1
1
x
x
1

Copyright © 2021 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 许可。