Commits on Source (8)
-
Clip dirty rects to surface rects in surface coordinate space. Dispatch vertices in surface coordinates and let the graphics hardware handle the transformations. Clipping in global coordinate space implies a useless roundtrip on the CPU to get the clipped polygons back in surface coordinates for the buffer transformation. Clipping in surface coordinate space prevents that. This might seem counter-intuitive at first because in surface space it's the dirty rects that are clipped to axis-aligned surface rects, while it's the opposite in global space. The projection matrix now combines the view and the output transforms. Signed-off-by: Loïc Molinari <loic.molinari@gmail.com>
54bce80c -
The clipper transforms dirty rects to surface space before clipping. Each dirty rect is transformed by the same matrix for each surface rect. This change decouples the transformation and the clipping code to transform and compute the bounding box of dirty rects just once. Signed-off-by: Loïc Molinari <loic.molinari@gmail.com>
a4d31fa8 -
Let the graphics hardware handle the transformation from surface position to texture coordinates. Paint nodes now have a single vertex position attribute from which texture coordinates are derived. A new vertex shader variant handles the transformation. Signed-off-by: Loïc Molinari <loic.molinari@gmail.com>
bcd04e0f -
Move vertex clipper back to single-precision floating point intermediates. Since positions are sent down the graphics hardware as single-precision values, this prevents useless conversions between single and double precision values and lets compilers fit twice as much data into vector registers. It also removes a copy by letting the clipper store vertices directly into the vertex buffer. This is mostly reverting the conversion to double-precision that happened along with the switch to the weston_coord struct for vertex coordinates (commit 10e70bf2). Signed-off-by: Loïc Molinari <loic.molinari@gmail.com>
49053a2a -
Add a basic check to let the clipper take the simple axis-aligned path when nodes are solely transformed with a translation and/or a scaling. That makes some nodes like sub-surfaces (which always have their transform enabled) take the fast path in the common case. Signed-off-by: Loïc Molinari <loic.molinari@gmail.com>
d34f35c9 -
Since both the surface rect and the transformed quad are axis-aligned in the simple clipping path, non-zero area detection can more efficiently be checked post-clipping by comparing opposite edges. Signed-off-by: Loïc Molinari <loic.molinari@gmail.com>
39fee794 -
Signed-off-by: Loïc Molinari <loic.molinari@gmail.com>
3d94f943 -
clip_quad() is a dedicated clipping function for quads that doesn't depend on any GL renderer internal structures. It can be moved out to the clipper to be called by both the renderer and the clipping test client without having to duplicate code. Signed-off-by: Loïc Molinari <loic.molinari@gmail.com>
fff8dbd9