mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 12:55:58 +01:00
wlr_scene: Introduce wlr_scene_buffer_set_filter_mode
This commit is contained in:
parent
06c0b0a204
commit
2ac31fc630
2 changed files with 20 additions and 1 deletions
|
@ -22,6 +22,7 @@
|
||||||
#include <pixman.h>
|
#include <pixman.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <wayland-server-core.h>
|
#include <wayland-server-core.h>
|
||||||
|
#include <wlr/render/wlr_renderer.h>
|
||||||
#include <wlr/types/wlr_damage_ring.h>
|
#include <wlr/types/wlr_damage_ring.h>
|
||||||
#include <wlr/types/wlr_linux_dmabuf_v1.h>
|
#include <wlr/types/wlr_linux_dmabuf_v1.h>
|
||||||
#include <wlr/util/addon.h>
|
#include <wlr/util/addon.h>
|
||||||
|
@ -168,6 +169,7 @@ struct wlr_scene_buffer {
|
||||||
// private state
|
// private state
|
||||||
|
|
||||||
float opacity;
|
float opacity;
|
||||||
|
enum wlr_scale_filter_mode filter_mode;
|
||||||
uint64_t active_outputs;
|
uint64_t active_outputs;
|
||||||
struct wlr_texture *texture;
|
struct wlr_texture *texture;
|
||||||
struct wlr_fbox src_box;
|
struct wlr_fbox src_box;
|
||||||
|
@ -423,6 +425,12 @@ void wlr_scene_buffer_set_transform(struct wlr_scene_buffer *scene_buffer,
|
||||||
void wlr_scene_buffer_set_opacity(struct wlr_scene_buffer *scene_buffer,
|
void wlr_scene_buffer_set_opacity(struct wlr_scene_buffer *scene_buffer,
|
||||||
float opacity);
|
float opacity);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the filter mode to use when scaling the buffer
|
||||||
|
*/
|
||||||
|
void wlr_scene_buffer_set_filter_mode(struct wlr_scene_buffer *scene_buffer,
|
||||||
|
enum wlr_scale_filter_mode filter_mode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calls the buffer's frame_done signal.
|
* Calls the buffer's frame_done signal.
|
||||||
*/
|
*/
|
||||||
|
@ -455,7 +463,7 @@ bool wlr_scene_output_commit(struct wlr_scene_output *scene_output);
|
||||||
* Render and populate given output state.
|
* Render and populate given output state.
|
||||||
*/
|
*/
|
||||||
bool wlr_scene_output_build_state(struct wlr_scene_output *scene_output,
|
bool wlr_scene_output_build_state(struct wlr_scene_output *scene_output,
|
||||||
struct wlr_output_state *state);
|
struct wlr_output_state *state);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Call wlr_surface_send_frame_done() on all surfaces in the scene rendered by
|
* Call wlr_surface_send_frame_done() on all surfaces in the scene rendered by
|
||||||
|
|
|
@ -816,6 +816,16 @@ void wlr_scene_buffer_set_opacity(struct wlr_scene_buffer *scene_buffer,
|
||||||
scene_node_update(&scene_buffer->node, NULL);
|
scene_node_update(&scene_buffer->node, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wlr_scene_buffer_set_filter_mode(struct wlr_scene_buffer *scene_buffer,
|
||||||
|
enum wlr_scale_filter_mode filter_mode) {
|
||||||
|
if (scene_buffer->filter_mode == filter_mode) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
scene_buffer->filter_mode = filter_mode;
|
||||||
|
scene_node_update(&scene_buffer->node, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
static struct wlr_texture *scene_buffer_get_texture(
|
static struct wlr_texture *scene_buffer_get_texture(
|
||||||
struct wlr_scene_buffer *scene_buffer, struct wlr_renderer *renderer) {
|
struct wlr_scene_buffer *scene_buffer, struct wlr_renderer *renderer) {
|
||||||
struct wlr_client_buffer *client_buffer =
|
struct wlr_client_buffer *client_buffer =
|
||||||
|
@ -1146,6 +1156,7 @@ static void scene_node_render(struct wlr_scene_node *node, const struct render_d
|
||||||
.transform = transform,
|
.transform = transform,
|
||||||
.clip = &render_region,
|
.clip = &render_region,
|
||||||
.alpha = &scene_buffer->opacity,
|
.alpha = &scene_buffer->opacity,
|
||||||
|
.filter_mode = scene_buffer->filter_mode,
|
||||||
});
|
});
|
||||||
|
|
||||||
wl_signal_emit_mutable(&scene_buffer->events.output_present, data->output);
|
wl_signal_emit_mutable(&scene_buffer->events.output_present, data->output);
|
||||||
|
|
Loading…
Reference in a new issue