When the picture is cropped, it looks terribly blurry compared to how it should look. It's like it's blurring or JPEG-ing.
I compared wf-background and awww, and the result is very noticeable on wallpapers, especially those that do not match the screen size. However, awww cannot be used normally, because when you click on the desktop, the wf-background wallpaper appears again.
If you are worried that solving the problem will make the wf-shell more heavy on weak computers and laptops, then it would be better to make a separate "optimization" setting with true on default.
Example on the same wallpaper file, with very "high" (height > width) image:
awww:

wf-background:
UPD 1
|
static GLuint create_texture() |
|
{ |
|
GLuint tex; |
|
|
|
glGenTextures(1, &tex); |
|
glBindTexture(GL_TEXTURE_2D, tex); |
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); |
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); |
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); |
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); |
|
glBindTexture(GL_TEXTURE_2D, 0); |
|
|
|
return tex; |
|
} |
I've read the code, and so far I have suspicions about GL_LINEAR, but I don't think GL_NEAREST will make it better, and maybe the pictures will be very pixelated and "ladder" (It can be fixed with antialiasing but it will be slow and hard for laptops)... I'm not even sure if GL_LINEAR is the problem - it shouldn't spoil the pictures SO badly...
UPD 2
I have a very strong suspicion that integer division by float is happening somewhere, which is why the result becomes an integer, not a float, although it should have been a float. And because of this, the picture becomes much more pixelated than it was before (this effect is observed)
There is a type conversion here:
|
double source_width = (double)source->get_width(); |
|
double source_height = (double)source->get_height(); |
But... There is not? I'm not sure, but maybe auto is the problem?
|
auto width_difference = screen_width - source_width; |
|
auto height_difference = screen_height - source_height; |
And there is errors may accumulate due to a large number of operations with loss of accuracy:
|
adjustments->scale_x = 1.0; |
|
adjustments->scale_y = (screen_height / screen_width) * (source_width / source_height); |
|
adjustments->x = 0.0; |
|
adjustments->y = (screen_height - source_height * (screen_width / source_width)) * |
|
adjustments->scale_y * 0.5 * (1.0 / screen_height); |
|
} else |
|
{ |
|
adjustments->scale_x = (screen_width / screen_height) * (source_height / source_width); |
|
adjustments->scale_y = 1.0; |
|
adjustments->x = (screen_width - source_width * (screen_height / source_height)) * |
|
adjustments->scale_x * 0.5 * (1.0 / screen_width); |
|
adjustments->y = 0.0; |
|
} |
|
} else /* "preserve_aspect" */ |
|
{ |
|
auto width_difference = screen_width / source_width; |
|
auto height_difference = screen_height / source_height; |
|
if (width_difference > height_difference) |
|
{ |
|
adjustments->scale_x = (screen_width / screen_height) * (source_height / source_width); |
|
adjustments->scale_y = 1.0; |
|
adjustments->x = (screen_width - source_width * (screen_height / source_height)) * |
|
adjustments->scale_x * 0.5 * (1.0 / screen_width); |
|
adjustments->y = 0.0; |
|
} else |
|
{ |
|
adjustments->scale_x = 1.0; |
|
adjustments->scale_y = (screen_height / screen_width) * (source_width / source_height); |
|
adjustments->x = 0.0; |
|
adjustments->y = (screen_height - source_height * (screen_width / source_width)) * |
|
adjustments->scale_y * 0.5 * (1.0 / screen_height); |
When the picture is cropped, it looks terribly blurry compared to how it should look. It's like it's blurring or JPEG-ing.
I compared
wf-backgroundandawww, and the result is very noticeable on wallpapers, especially those that do not match the screen size. However,awwwcannot be used normally, because when you click on the desktop, thewf-backgroundwallpaper appears again.If you are worried that solving the problem will make the
wf-shellmore heavy on weak computers and laptops, then it would be better to make a separate "optimization" setting withtrueon default.Example on the same wallpaper file, with very "high" (height > width) image:
awww:

wf-background:
UPD 1
wf-shell/src/util/background-gl.cpp
Lines 266 to 279 in c045b66
I've read the code, and so far I have suspicions about
GL_LINEAR, but I don't thinkGL_NEARESTwill make it better, and maybe the pictures will be very pixelated and "ladder" (It can be fixed with antialiasing but it will be slow and hard for laptops)... I'm not even sure ifGL_LINEARis the problem - it shouldn't spoil the pictures SO badly...UPD 2
I have a very strong suspicion that
integerdivision byfloatis happening somewhere, which is why the result becomes aninteger, not afloat, although it should have been afloat. And because of this, the picture becomes much more pixelated than it was before (this effect is observed)There is a type conversion here:
wf-shell/src/util/background-gl.cpp
Lines 152 to 153 in c045b66
But... There is not? I'm not sure, but maybe
autois the problem?wf-shell/src/util/background-gl.cpp
Lines 166 to 167 in c045b66
And there is errors may accumulate due to a large number of operations with loss of accuracy:
wf-shell/src/util/background-gl.cpp
Lines 170 to 200 in c045b66