[Y-devel] Cairo 2D drawing library.

Sebastian Faubel sfaubel at gmx.de
Thu Feb 26 20:15:00 GMT 2004


> Yeah, but you overcome that by storing the bitmap at the maximum size 
> and only down-scaling. Apple restricts Icons to 128x128 and the icns 
> format stores also 64x64, 32x32, and 16x16 versions so you can provide 
> different smaller versions that look better than even a scaled down 
> version would. This is something I strongly urge Y to do for widgets. 
> Scaling often results in loss of clarity that has nothing to do with 
> fidelity of the original drawing.

...

> > Upscaling a vetcor graphic you "only" have to recalculate the image,
> > which takes up almost the same cpu capacity ( in the VGA or CPU ) but
> > ends up in a clean image.
> 
> I don't know. My only real experience with this is Adobe Illustrator 
> but it seems to me that resampling is a much simpler and faster 
> operation than recalculating vector-based gradients.

ok, you also have to consider that illustrator is a whole vector drawing
suite and is therefore a little bit blown up. cairo is a very small
vector rasterization library with only one purpose... rendering as fast
as possible.

> Some of the icons 
> in OS X, if rendered with Vectors, would have hundreds or thousands of 
> vector paths of arbitrary complexity, and some simply could not be 
> created with vectors at all (those based on photographs or high quality 
> paintings). The idea that you could dynamically scale two dozen 
> arbitrarily complex vector images at 20-30 fps without putting an 
> unacceptable load on the system is hard to believe.

nobody said that we totally want to sweep out pixel based graphics of Y,
we only want to enable vector graphics at a low level. Of course you
cannot replace a photorealistic image by a vector based graphic, but
there are some "simple" applications where vector graphics proove to be
better. please don't get me wrong...

> I admit I have a slow computer (dual-867), but turning on dock 
> magnification and runnning the cursor over the dock causes what looks 
> like significant CPU load (by watching the admittedly low-res CPU 
> monitor). Even though some of the work is done in the GPU, the CPU 
> still has to calculate the nice scaling factors as the mouse moves, 
> which is a fair bit of work. Re-drawing vectors at that rate would be 
> impossible even on a dual G5. The GPU wouldn't be any help at all! I 
> have seen this kind of slowdown in the Aqua U.I. itself -- Aqua already 
> has full support for arbitrarily complex vector drawing, using 
> NSBezierPath. This is how Mail can put a little badge on its dock icon 
> with the number of new messages you have. You can quickly crush the 
> system by trying to dynamically redraw some set of bezier paths over 
> and over again in an animation-style scenario.

i cannot comment here because i really have no experience with apple
computers, esp. the new ones... but afaik the animation of the dock is
quite "smooth", so this really means hell a lot of rendering and
blitting of a few icons at the same time...

> Granted this is not common and caching will be liberally used, but the 
> simple act of starting with a large enough bitmap is itself a kind of 
> caching, and is sufficient in almost all cases. I can certainly think 
> of exceptions, and none of my points are arguments against *having* 
> full vector support. I'm just asking for realism.

You're asking for realism, ok, good thing. there exist a few prove of
concepts in gnome actually. I wouldn't call it unrealistic only because
nobody has done it in that way before (in linux)...

Gnome has native support for SVG icons and themes. Enabling these
doesn't take my laptop to hell, in fact im writing his email using the
Wasp theme which is entirely SVG based.

Of course this is implemented in a relativly high level, so you don't
have to expect the fastest rendering on earth, but i ( as a human )
don't recognize a difference in speed between diplaying a 128x128
Crystal icon in PNG or SVG... so it's obviously fast enough.

Also the upcoming (graphics) hardware will/is powerful enough to deal
with "simple" vector graphics, as it will be abled to render cinema
qualitiy films/games in real time.

Again, adding vector support to Y is not about replacing everything with
bezier splines, but about opening new possibilities at windowing level.
I intend to just take it a few steps down in the pipeline.

Also the pixelbuffer which it will be based on will have a modular
graphics format loading system, so any pixelbased format could be
supported... in fact the initial version will have support for PNG and
SVG.

> If you can prove me wrong, of course, I'd be happy :-), since I'm a 
> huge fan of ridiculously powerful graphics rendering systems, and I 
> think the Cairo stuff is fantastic. Screen shots are here:

ohh you ment these :)

> https://freedesktop.org/~keithp/screenshots/
> 
> They are sweet indeed.
>
> Cheers,

Thanks ;)

sebastian




More information about the Y-devel mailing list









2026 © www.Y-Windows.Org - All Rights Reserved