-
Notifications
You must be signed in to change notification settings - Fork 14
feat: remove enum corner_location
#156
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
base: main
Are you sure you want to change the base?
Conversation
0b31c53 to
283da66
Compare
03a8db9 to
ad6afda
Compare
ad6afda to
7eb77af
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like these changes actually add some LOC over the original implementation overall, I think we should scrap this bit to keep the diff lean
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know we save some LOC in fx_pass.c but I think we add more in shaders.c for a positive overall LOC diff, esp considering the glUniform1f calls in fx_pass can be oneliners now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as with shaders.h
| int corner_radius; | ||
| enum corner_location corners; | ||
| struct clipped_region clipped_region; | ||
| struct fx_corner_radii corners; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all the other options have a fradii type, why not blur_pass_options?
| static bool apply_clip_region(pixman_region32_t *clip_region, | ||
| const struct wlr_box *clipped_region_box, const struct fx_corner_fradii *corners) { | ||
| if (!wlr_box_empty(clipped_region_box)) { | ||
| float top = fmax(corners->top_left, corners->top_right); | ||
| float bottom = fmax(corners->bottom_left, corners->bottom_right); | ||
| float left = fmax(corners->top_left, corners->bottom_left); | ||
| float right = fmax(corners->top_right, corners->bottom_right); | ||
|
|
||
| pixman_region32_t user_clip_region; | ||
| pixman_region32_init_rect( | ||
| &user_clip_region, | ||
| clipped_region_box->x + (left * 0.3), | ||
| clipped_region_box->y + (top * 0.3), | ||
| fmax(clipped_region_box->width - (left + right) * 0.3, 0), | ||
| fmax(clipped_region_box->height - (top + bottom) * 0.3, 0) | ||
| ); | ||
| pixman_region32_subtract(clip_region, clip_region, &user_clip_region); | ||
| pixman_region32_fini(&user_clip_region); | ||
| return true; | ||
| } | ||
|
|
||
| return false; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
| struct fx_corner_fradii { | ||
| float top_left; | ||
| float top_right; | ||
| float bottom_right; | ||
| float bottom_left; | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fradii stuff is just needed on the scenefx side as far as I could tell, we should move it and its functions to a private header (unless I missed a case)






This MR removed the
enum corner_locationand apparently also fixes some issues with scaling.with SwayFX the changes live look like this:
transform normaltransform 90transform flipped-90Closes #137