Hi Daniel,

 From what I understand, the line rendering change in Immi's patch 
primarily concerns variable-width strokes (pressure-sensitive).  Xournal 
renders them as a sequence of line segments connecting successive points 
along the stroke, with rounded ends, each segment of constant width as 
dictated by the pen pressure at one of its endpoints (can't remember 
which, I don't expect it matters). Instead, Immi's version connects 
successive points by trapezoids (usually long and thin) that you should 
think of as a line segment whose thickness varies linearly from the 
start point to the end point (so the width at each end is dictated by 
the pressure recorded at that point). And to restore the roundedness / 
avoid unpleasant gaps between the trapezoids at the bend points, Immi 
adds a filled circle at each vertex.

So: you should be able to see the difference clearly by drawing some 
pressure sensitive strokes and zooming in quite a lot.

Optimization: I believe it's a matter of not requesting a new different 
line width for each line segment, instead grouping together consecutive 
segments that have very similar widths and drawing them in one go -- but 
I am not sure if I got it right.

(I am surprised that overall this speeds up rendering, I would have 
expected trapezoids + circles to be slower than line segments but I 
guess I must be wrong. [or perhaps it depends on the graphics drivers 
and available acceleration?]. I don't know how to profile this, but a 
naive test might be to make a document with TONS of variable-width 
strokes and find out how long it takes to render.]

Best,
Denis


> ok, before you move forward. Today I have been reviewing a PDF using
> your branch. So far, it seems ok. But I am not exactly sure what the
> difference is. Note that I am simply annotating, so I am not writing a
> lot.
>
> I think what we need is two example PDFs (one with and one without) the
> patch where you demonstrate us what your code is doing.
>
> So let us talk first about the change of the line endings. Let us ignore
> the optimization for a bit.

-- 
Denis Auroux
UC Berkeley, Department of Mathematics
817 Evans Hall, Berkeley CA 94720-3840, USA
aur...@math.berkeley.edu

------------------------------------------------------------------------------
_______________________________________________
Xournal-devel mailing list
Xournal-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xournal-devel

Reply via email to