mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-02 07:23:52 -04:00
render/pixman: fix bilinear filtering to match gles2 renderer
Before this patch the pixman renderer would use "constant padding" for bilinear scaling which meant that the edges would either be dark or turn transparent. The effect was most obvious when trying to scale a single row buffer to a height like 100. The center would have the desired color but the edges to both sides would fade into transparency. We now use PIXMAN_REPEAT_PAD which clamps out-of-bound pixels and seems to match the behavior of the gles2 renderer.
This commit is contained in:
parent
e22084f639
commit
c66a910753
1 changed files with 1 additions and 0 deletions
|
|
@ -159,6 +159,7 @@ static void render_pass_add_texture(struct wlr_render_pass *wlr_pass,
|
||||||
|
|
||||||
switch (options->filter_mode) {
|
switch (options->filter_mode) {
|
||||||
case WLR_SCALE_FILTER_BILINEAR:
|
case WLR_SCALE_FILTER_BILINEAR:
|
||||||
|
pixman_image_set_repeat(texture->image, PIXMAN_REPEAT_PAD);
|
||||||
pixman_image_set_filter(texture->image, PIXMAN_FILTER_BILINEAR, NULL, 0);
|
pixman_image_set_filter(texture->image, PIXMAN_FILTER_BILINEAR, NULL, 0);
|
||||||
break;
|
break;
|
||||||
case WLR_SCALE_FILTER_NEAREST:
|
case WLR_SCALE_FILTER_NEAREST:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue