Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backend: gl: inherit image's inner properties in the gl_image_decouple function #1179

Merged
merged 3 commits into from
Feb 7, 2024

Conversation

absolutelynothelix
Copy link
Collaborator

fixes #1174.

also i'm a bit worried that has_alpha, y_inverted and auxiliary_texture are not inherited but i'm not sure if it causes any issues now or could cause any issues in the future.

backend: gl: inherit image's shader in the gl_image_decouple function

this prevents images from losing their shaders when alpha is applied

Copy link

codecov bot commented Feb 2, 2024

Codecov Report

Attention: 10 lines in your changes are missing coverage. Please review.

Comparison is base (bbc657e) 36.43% compared to head (9204426) 36.41%.
Report is 1 commits behind head on next.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             next    #1179      +/-   ##
==========================================
- Coverage   36.43%   36.41%   -0.02%     
==========================================
  Files          50       50              
  Lines       11533    11541       +8     
==========================================
+ Hits         4202     4203       +1     
- Misses       7331     7338       +7     
Files Coverage Δ
src/backend/gl/gl_common.h 30.23% <ø> (ø)
src/backend/gl/gl_common.c 25.27% <47.36%> (-0.13%) ⬇️

@yshui
Copy link
Owner

yshui commented Feb 6, 2024

@absolutelynothelix you are right about y_inverted and has_alpha

absolutelynothelix and others added 2 commits February 6, 2024 12:54
…e function

Image decouple should keep all the image properies from the source
image, so shader must be copied. And there are also some internal
properties what should be inherited but wasn't.

In particular this prevents images from losing their shaders when
alpha is applied.

Fixes yshui#1174
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Copy link
Collaborator Author

@absolutelynothelix absolutelynothelix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, builds and works for me. i left some thoughts that you can freely ignore if you don't find them reasonable.

i can't approve my own pull request but consider it approved 😄

src/backend/gl/gl_common.c Show resolved Hide resolved
src/backend/gl/gl_common.c Outdated Show resolved Hide resolved
src/backend/gl/gl_common.c Outdated Show resolved Hide resolved
@absolutelynothelix absolutelynothelix changed the title backend: gl: inherit image's shader in the gl_image_decouple function backend: gl: inherit image's inner properties in the gl_image_decouple function Feb 6, 2024
@absolutelynothelix
Copy link
Collaborator Author

if anyone gets confused by this pull request in the future: initially it was only about inheriting an image's shader in the gl_image_decouple function to fix an issue when a shader got lost if alpha was applied but it turned into a small cooperative overall improvement of this function.

Present shader optionally does dithering, but that's not needed for
decoupling.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
@yshui yshui merged commit a39cd94 into yshui:next Feb 7, 2024
16 checks passed
@absolutelynothelix absolutelynothelix deleted the inherit-shader-on-decouple branch February 7, 2024 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shaders don't apply to all windows on BSPWM
2 participants