Its main purpose is to reroute surface size updates through SurfaceItem
so it can invalidate quads cache. Not all SurfaceItems currently discard
them when needed. When proper item transform support lands,
setDestinationSize() could also change the surface scale instead.
The wayland spec is not quite clear about the transforms, but the buffer
transform indicates a transform from wl_surface to wl_buffer or compositor
global coordinate space to composited buffer.
On the other hand, SurfaceItem assumes that the order is vice versa.
The render transform is applied first, after that, the texture is
flipped implicitly by opengl.
So in order to undo these transforms, we need to flip the image
vertically first, then undo the render target transform.
`flip-y | rotate-N` transforms are equivalent to `flip-x | rotate-N`.
However, it is not intuitive to express transforms that flip the y axis
via flip-x transforms. This change adds convenience aliases to improve
code readability and keep code intuitive, which is going to be needed in
order to drop TextureTransforms flags.
Return the resulting value immediately than use moveLeft(),moveRight().
It makes no difference for QRectF, but it might be nicer for QRect which
would need to recompute the right and bottom coordinates twice.
I wanted to do this refactoring for a while but didn't do it due to the
lack of test coverage.
These can be useful in case a QRect needs to be mapped. One could
convert the QRect into a QRectF and then back to QRect, but given that
these conversion helpers are present in rendering hot paths, it would
be great to be more efficient and also potentially loosing precision
because of floating point arithmetic.
Instead of checking for fullscreen windows and deciding whether or not to schedule repaints
based on that, check if the active window is refreshing fast enough to be reasonable for vrr.
For automatic mode, vrr is also enabled with the active window instead of the direct scanout
candidate.
BUG: 478680
BUG: 477199
When returning back from direct scanout to compositing, the whole frame
has to be repainted because the most recent buffer in the EGL swapchain
contains outdated contents now.
This change works around it by purging the DamageJournal when scanning
out a buffer. However, a nicer solution would be to assign a unique
sequence number to every frame and use that to index the entries in the
DamageJournal. It's a nicer design. With such absolute frame numbers,
the DamageJournal could properly detect discontinueties.
Given the final release is in close proximity, this change doesn't go
after such a refactoring.