Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

Update output transform matrix calculation #2770

Merged
merged 1 commit into from
Mar 10, 2021

Conversation

bl4ckb0ne
Copy link
Contributor

@bl4ckb0ne bl4ckb0ne commented Mar 4, 2021

Improve transform matrix calculation in wlr_output to help the pixman rendering process.


Breaking change: the projection has been moved from wlr_output.transform_matrix to the GLES2 renderer. Compositors using wlr_output.transform_matrix only with the GLES2 renderer don't need an update.

@emersion
Copy link
Member

emersion commented Mar 8, 2021

Got correct results with this: https://l.sr.ht/zxBA.txt

@bl4ckb0ne
Copy link
Contributor Author

Runs well with rotation, output-layout and fullscreen

@bl4ckb0ne bl4ckb0ne marked this pull request as ready for review March 8, 2021 15:58
@bl4ckb0ne bl4ckb0ne changed the title WIP update output transform matrix Update output transform matrix calculation Mar 8, 2021
types/wlr_output.c Outdated Show resolved Hide resolved
@emersion emersion added the breaking Breaking change in public API label Mar 8, 2021
@emersion
Copy link
Member

emersion commented Mar 8, 2021

Can you squash these two commits, and add the motivation for this change in the commit message?

@bl4ckb0ne
Copy link
Contributor Author

Done, let me know if you want more info in the commit message.

@emersion
Copy link
Member

emersion commented Mar 8, 2021

It seems like this breaks cursors. Applied this patch to the Wayland backend and works again:

https://l.sr.ht/zCxh.txt

Can you do something similar for DRM and X11?

@bl4ckb0ne
Copy link
Contributor Author

Good catch, I'll make a fix soon.

@bl4ckb0ne
Copy link
Contributor Author

I squashed the fix into the first commit. Do you think drm_surface_blit could break too?

@emersion
Copy link
Member

emersion commented Mar 9, 2021

Do you think drm_surface_blit could break too?

Yes, I think so. That function passes the matrix to wlr_renderer_begin, which already does the wlr_matrix_projection call under the hood. We should replace the wlr_matrix_projection call with an identity matrix.

To test, use examples/screencopy-dmabuf.

Compute only the transform matrix in the output. The projection matrix
will be calculated inside the gles2 renderer when we start rendering.

The goal is to help the pixman rendering process.
@bl4ckb0ne
Copy link
Contributor Author

I pushed a fix, I also found another call to wlr_matrix_projection in gles2_blit_dmabuf.

Copy link
Member

@emersion emersion left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@emersion emersion merged commit 9601a2a into swaywm:master Mar 10, 2021
@emersion emersion mentioned this pull request Mar 12, 2021
nyorain added a commit to nyorain/wlroots that referenced this pull request Mar 20, 2021
nyorain added a commit to nyorain/wlroots that referenced this pull request Apr 11, 2021
nyorain added a commit to nyorain/wlroots that referenced this pull request Apr 22, 2021
nyorain added a commit to nyorain/wlroots that referenced this pull request Jun 20, 2021
emersion pushed a commit to nyorain/wlroots that referenced this pull request Jul 30, 2021
emersion pushed a commit to nyorain/wlroots that referenced this pull request Sep 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking Breaking change in public API
Development

Successfully merging this pull request may close these issues.

None yet

2 participants