yshui / picom

A lightweight compositor for X11
Other
3.92k stars 576 forks source link

backend: decompose mask into source and target mask #1257

Closed yshui closed 1 month ago

yshui commented 1 month ago

When trying to add source image transformation (e.g. scaling), I realized it's ambiguous whether the mask should be applied before or after the transformation. And after further thought, I decided it would be better to have two separate masks, one for the source, which would be in the source's coordinate system (i.e. before any transformation); and one for the target.

And due to how we currently use the mask, I made the source mask an image, and the target mask a region. Nothing is stopping us from making both a combination of an image and a region, but we won't be using that capability anyway.

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 55.86854% with 94 lines in your changes are missing coverage. Please review.

Project coverage is 41.04%. Comparing base (4b04a53) to head (92c7641).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/yshui/picom/pull/1257/graphs/tree.svg?width=650&height=150&src=pr&token=NRSegi0Gze&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yuxuan+Shui)](https://app.codecov.io/gh/yshui/picom/pull/1257?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yuxuan+Shui) ```diff @@ Coverage Diff @@ ## next #1257 +/- ## ========================================== - Coverage 41.21% 41.04% -0.18% ========================================== Files 59 59 Lines 12303 12267 -36 ========================================== - Hits 5071 5035 -36 Misses 7232 7232 ``` | [Files](https://app.codecov.io/gh/yshui/picom/pull/1257?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yuxuan+Shui) | Coverage Δ | | |---|---|---| | [src/region.h](https://app.codecov.io/gh/yshui/picom/pull/1257?src=pr&el=tree&filepath=src%2Fregion.h&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yuxuan+Shui#diff-c3JjL3JlZ2lvbi5o) | `42.10% <100.00%> (-7.90%)` | :arrow_down: | | [src/renderer/damage.c](https://app.codecov.io/gh/yshui/picom/pull/1257?src=pr&el=tree&filepath=src%2Frenderer%2Fdamage.c&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yuxuan+Shui#diff-c3JjL3JlbmRlcmVyL2RhbWFnZS5j) | `90.39% <100.00%> (-1.28%)` | :arrow_down: | | [src/win.c](https://app.codecov.io/gh/yshui/picom/pull/1257?src=pr&el=tree&filepath=src%2Fwin.c&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yuxuan+Shui#diff-c3JjL3dpbi5j) | `72.44% <ø> (-0.03%)` | :arrow_down: | | [src/win.h](https://app.codecov.io/gh/yshui/picom/pull/1257?src=pr&el=tree&filepath=src%2Fwin.h&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yuxuan+Shui#diff-c3JjL3dpbi5o) | `100.00% <100.00%> (ø)` | | | [src/backend/gl/gl\_common.h](https://app.codecov.io/gh/yshui/picom/pull/1257?src=pr&el=tree&filepath=src%2Fbackend%2Fgl%2Fgl_common.h&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yuxuan+Shui#diff-c3JjL2JhY2tlbmQvZ2wvZ2xfY29tbW9uLmg=) | `5.35% <0.00%> (ø)` | | | [src/backend/dummy/dummy.c](https://app.codecov.io/gh/yshui/picom/pull/1257?src=pr&el=tree&filepath=src%2Fbackend%2Fdummy%2Fdummy.c&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yuxuan+Shui#diff-c3JjL2JhY2tlbmQvZHVtbXkvZHVtbXkuYw==) | `70.83% <66.66%> (ø)` | | | [src/backend/backend.c](https://app.codecov.io/gh/yshui/picom/pull/1257?src=pr&el=tree&filepath=src%2Fbackend%2Fbackend.c&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yuxuan+Shui#diff-c3JjL2JhY2tlbmQvYmFja2VuZC5j) | `30.43% <33.33%> (ø)` | | | [src/renderer/renderer.c](https://app.codecov.io/gh/yshui/picom/pull/1257?src=pr&el=tree&filepath=src%2Frenderer%2Frenderer.c&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yuxuan+Shui#diff-c3JjL3JlbmRlcmVyL3JlbmRlcmVyLmM=) | `64.61% <79.06%> (+0.91%)` | :arrow_up: | | [src/backend/gl/blur.c](https://app.codecov.io/gh/yshui/picom/pull/1257?src=pr&el=tree&filepath=src%2Fbackend%2Fgl%2Fblur.c&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yuxuan+Shui#diff-c3JjL2JhY2tlbmQvZ2wvYmx1ci5j) | `0.00% <0.00%> (ø)` | | | [src/backend/gl/gl\_common.c](https://app.codecov.io/gh/yshui/picom/pull/1257?src=pr&el=tree&filepath=src%2Fbackend%2Fgl%2Fgl_common.c&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yuxuan+Shui#diff-c3JjL2JhY2tlbmQvZ2wvZ2xfY29tbW9uLmM=) | `29.46% <0.00%> (-0.05%)` | :arrow_down: | | ... and [2 more](https://app.codecov.io/gh/yshui/picom/pull/1257?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yuxuan+Shui) | | ... and [3 files with indirect coverage changes](https://app.codecov.io/gh/yshui/picom/pull/1257/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yuxuan+Shui)