Skip to content
This repository has been archived by the owner on Mar 13, 2023. It is now read-only.

[wip] xrender backend #1196

Draft
wants to merge 19 commits into
base: master
Choose a base branch
from
Draft

[wip] xrender backend #1196

wants to merge 19 commits into from

Conversation

dkochmanski
Copy link
Member

No description provided.

sqrt sometimes resulted in a complex number very close to 0 in recording.
This protocol is redundant with medium-draw-ellipse*. Moreover it is forced to
fallback to drawing ellipses for some medium transformations. On top of all that
draw-circle* already calls medium-draw-ellipse* so this is not used in pracitce.

This change is backward incompatible, because medium-draw-circle* was exported
from the extension and the backend packages.
This class memoizes a result of the last call to bounding-rectangle*.
The used algorithm was winding number and its inclusion definition does not
agree with "our" definition exhibited in drawing. Use ray casting algorithm
instead. Fixes #1200.
- move expand-point-seq from graphics.lisp
- move coord-seq->point-seq (reverse of the above) from utils.lisp
- add a function polygonize to transform bezier curve to a polygon
The previous version of this function was not very readable. Add a comment that
explains why we collect a 0-length edge. Move the high order function to flet
instead of putting directly in the body (so the iteration is separated from the
logic).
This commit does not introduce changes to functionality - only adds comments and
reshapes the function for readibility.
This was previously computed in the function polygon-op. For this function to
work on non-simple polygons this is necessary.
This internal function returns a list of points that constitue subsequent
triangles. The function works on self-intersecting polygons, that's why its
complexity is O[n²log(n)].
The previous version was recursive (for long chains of points the stack could
overflow) and was consing. This version mutates the input list instead and uses
iteration instead.
When macros WITH-ROUND-POSITIONS and WITH-ROUND-COORDINATES receive as a
transformation either NIL or +IDENTITY-TRANSFORMATION+ then the transformation
step is skipped in the expansion.

CLIPPED-* functions are replaced with functions WITH-CLIPPED-*.
This step is necessary to allow using custom gcontext with legacy drawing
routines. This will be used for:

- setting the clipping region
- computing masks in the new ink sourcing model (xrender)

clx-draw-* routines are similar to medium-draw-* however they accept explicit
arguments for the drawable, the gcontext and the transformation. They are
responsible for clipping coordinates to valid x11 values.

Moreover it is assumed that after the transformation the nature of a drawn
object won't change (i.e clx-draw-rectangle will always call xlib:draw-rectangle
even when the transformation is not rectilinear - it is medium-draw-rectangle*
responsiblity to handle this situation.
The picture object is lazily created for each mirror in the drawable's
plist. Getting source and target pictures is done by means of calling
medium-{target,source}-picture. This is a preliminary step towards further
improvements of the xrender rendering.

To use legacy drawing routines (without breaking compatibility with the "legacy"
medium) a new function clx-drawable-gcontext is created. It works similar to
clx-drawable-picture.

Also don't assume that the first picture and the first gcontext on the drawable
plist is "ours" - instead find them with getf.
A macro with-render-context macro is responsible for binding the source and the
target ink as well as for setting the target's clip mask. All allocated
resources are released after use. Currently we clip by means of a gcontext.

For now only filled rectangles and text use this macro. Non-uniform designs are
implemented. Fixes #1132.
@dkochmanski
Copy link
Member Author

dkochmanski commented Jul 13, 2021

image

polygonized circle drawn with this branch.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant