[UI/Graphics] Ever heard of graff ?

Gustavo Sverzut Barbieri barbieri at gmail.com
Tue Jul 31 20:30:53 CEST 2007


On 7/30/07, Jay Vaughan <jay at w1xer.de> wrote:
> >>
> > Cairo, as suggested, will not be an option in near future, since it
> > does 32bpp graphics and the conversion will kill our hardware.
> >
>
>
> fwiw, its quite feasible to do nice assembly-based BPP conversion on
> ARM and involves a decidedly negligible hit on performance .. don't
> count cairo out of the libpack just yet ..

it's not about the conversion itself, but the data.

16bpp versus 32bpp:
 - opaque images: 2 bytes versus 3 bytes (alignment!)
 - alpha images: 3 bytes (alpha in separate plane) versus 4 bytes
 - rgb * a:  1 arithmetic operation versus 3. This is due the fact
that you can downscale a to 5 bits and then operate rgb (16bits) on a
32bit word, just move 6 bits of G from the pack to the other half-word
and then you can fit the overflow.

Also, in order to look barely good you need to apply dither mask to
images, otherwise you get weird gradients, they become blocky. With
32bpp->16 you need to convert always, while with 16bpp you do at load
time.

For sure quality is not as good, since you lost many bits, but it's
the price of performance... you can try to improve things (like this
dither thing), but not much room is left.

As for counting cairo out, sure not. But use it for specific scope.
EFL does no vector graphics (just line, rectangle and polygon, I'd not
count it as vector graphics lib) and if you have to draw charts,
complex paths, etc... it's the best option.
   However, even UIs being scalable, they're basically described by
pixmaps. It's insane to calculate a gradient on real time just to get
a smooth blend: using a gradient pixmap and maybe using (even smooth)
scaling would look as good, but use less CPU. Same for rounded
corners, you can have a path to describe it, but a smart blit
algorithm would be as fast.

BTW, evas have a cairo backend, so you can mix both if required. Other
backends, like xrender, opengl, fb and directfb are supported as well.

-- 
Gustavo Sverzut Barbieri
--------------------------------------
Jabber: barbieri at gmail.com
   MSN: barbieri at gmail.com
  ICQ#: 17249123
 Skype: gsbarbieri
Mobile: +55 (81) 9927 0010




More information about the community mailing list