On 16 Mar 2012, at 10:49, J. Liles wrote:

> Another update... I've implemented the Cairo support as
> Fl_Cairo_Graphics_Device which inherits from Fl_Xlib_Graphics_Device.
> This results in all drawing (still excepting fonts) in FLTK being
> performed through Cairo. Of course, for the most part everything looks
> the same--it would probably take a set of boxtypes which utilize the
> Cairo gradient and transparency features to produce a more modern
> look. Fl_Dial and anything involving diagonal or curved lines looks
> much improved.

This sounds like excellent stuff... We can get a look at it?


> Performance-wise, the results are mixed. Drawing straight lines and
> rectangles, Cairo is *much* faster. This took me a bit by surprise,
> but I guess it's to be expected as Cairo is using XRender to perform
> these operations. The difference is probably on the order of 500 or
> 1000 times faster. However, drawing circles, bent lines, and polygons,
> is likewise 1000 times slower or more, which is disappointing. And
> means that I probably can't get away with using 100% Cairo rendering
> in Non-DAW (at least, not with antialiasing turned on for complex
> lines and polygons, such as audio waveforms).

For my "oscilloscope" views I used widgets derived from Fl_GL_Window to draw 
the waveforms and so forth - allowed us to do quite a few things that wouldn't 
be possible in "plain" fltk, and leveraged driver acceleration on systems that 
had it.

That might work well for you, too, I'd imagine, and maybe alleviate the timing 
issues some of your users are hitting?


> I haven't tried the EGL,
> GLX, or XCB backends for Cairo yet, who knows, maybe they're faster. I
> plan to try XCB anyway in hopes that it will alleviate the extremely
> slow drawing that some FLTK users experience.

Though I wonder to what extent that would play nice with XFT rendered text.
XFT will be going through Xrender too, I'd assume, so that might make it "more 
compatible" with your Cairo work. Switching the back-end might break text 
rendering? Unless we switch to a fully Cairo based back-end for the text 
drawing too, I guess...


> At the very least, everyone should know that just using XRender to
> draw rectangles and lines in FLTK will likely result in pretty drastic
> speedups on systems with accelerated graphics...

All interesting stuff.




_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to