Re: [Freetype-devel] Re: GSOC - Distance Fields

2020-06-15 Thread Alexei Podtelezhnikov
On Mon, Jun 15, 2020 at 11:03 AM Anuj Verma wrote: > > > > For linear segments, it will save more than 90% according to your > > table. Then you will see that splitting Bezier curves is not such a > > bad option. In general, Bezier curves are used in graphics because it > > is easy to split and

Re: [Freetype-devel] Re: GSOC - Distance Fields

2020-06-15 Thread Werner LEMBERG
> Did you miss the last two mails from Alexei and me? I missed a few > mails a few days ago for no reason and even got a few duplicate > mails. I think I received everything. It's only that sometimes I start writing an e-mail and finish it hours later – in this case, Alexei has answered

Re: [Freetype-devel] Re: GSOC - Distance Fields

2020-06-15 Thread Anuj Verma
> For linear segments, it will save more than 90% according to your > table. Then you will see that splitting Bezier curves is not such a > bad option. In general, Bezier curves are used in graphics because it > is easy to split and flatten them. I would be very surprised if > distance fields

Re: [Freetype-devel] Re: GSOC - Distance Fields

2020-06-15 Thread Alexei Podtelezhnikov
On Mon, Jun 15, 2020 at 9:06 AM Anuj Verma wrote: > > > Your profiling results indicate that a lot of time is spent > > calculating distances. Perhaps, you can work with much faster > > square-distances (they can be signed or signs stored separately) and > > apply square root as a final

Re: [Freetype-devel] Re: GSOC - Distance Fields

2020-06-15 Thread Alexei Podtelezhnikov
Replying to myself... On Mon, Jun 15, 2020 at 8:11 AM Alexei Podtelezhnikov wrote: > > Hi Anuj, > > > A) Line Segment: ~0.32 microseconds > > B) Conic Bezier: ~1.08 microseconds > > C) Cubic Bezier: ~1.25 microseconds > > > > I am very surprised indeed. In the linear case, it is a trivial >

Re: [Freetype-devel] Re: GSOC - Distance Fields

2020-06-15 Thread Alexei Podtelezhnikov
Hi Anuj, > A) Line Segment: ~0.32 microseconds > B) Conic Bezier: ~1.08 microseconds > C) Cubic Bezier: ~1.25 microseconds > I am very surprised indeed. In the linear case, it is a trivial cross-product divided by the length of a segment, or the smaller of two distances to the ends. There are no

Re: [Freetype-devel] Re: GSOC - Distance Fields

2020-06-15 Thread Anuj Verma
Hello Werner, Thanks for checking the code and for your comments. Did you miss the last two mails from Alexei and me? I missed a few mails a few days ago for no reason and even got a few duplicate mails. > *I think he means that the code must be optimized as much as possible* > *to get fast