alpha-modifier-v1: implement protocol

Implement the alpha-modifier-v1 protocol, which allows clients to
offload alpha blending operations to the compositor.

wlroots' scene graph code takes care of updating the opacity of
wlr_scene_buffers with an associated wp_alpha_modifier_surface_v1.

(cherry picked from commit a2a5e8f4632374b4b322c0520b7e30e35e0d753a)
This commit is contained in:
tesselslate 2024-11-04 21:03:34 -05:00 committed by Isaac Freund
parent f0798f7536
commit be0e372fbc
No known key found for this signature in database
GPG Key ID: 86DED400DDFD7A11

View File

@ -86,6 +86,8 @@ foreign_toplevel_manager: *wlr.ForeignToplevelManagerV1,
tearing_control_manager: *wlr.TearingControlManagerV1, tearing_control_manager: *wlr.TearingControlManagerV1,
alpha_modifier: *wlr.AlphaModifierV1,
input_manager: InputManager, input_manager: InputManager,
root: Root, root: Root,
config: Config, config: Config,
@ -163,6 +165,8 @@ pub fn init(server: *Server, runtime_xwayland: bool) !void {
.tearing_control_manager = try wlr.TearingControlManagerV1.create(wl_server, 1), .tearing_control_manager = try wlr.TearingControlManagerV1.create(wl_server, 1),
.alpha_modifier = try wlr.AlphaModifierV1.create(wl_server),
.config = try Config.init(), .config = try Config.init(),
.root = undefined, .root = undefined,
@ -321,7 +325,8 @@ fn allowlist(server: *Server, global: *const wl.Global) bool {
global == server.input_manager.tablet_manager.global or global == server.input_manager.tablet_manager.global or
global == server.input_manager.pointer_gestures.global or global == server.input_manager.pointer_gestures.global or
global == server.idle_inhibit_manager.wlr_manager.global or global == server.idle_inhibit_manager.wlr_manager.global or
global == server.tearing_control_manager.global; global == server.tearing_control_manager.global or
global == server.alpha_modifier.global;
} }
/// Returns true if the global is blocked for security contexts /// Returns true if the global is blocked for security contexts