-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Julien Danjou wrote:
> At 1243673434 time_t, Uli Schlachter wrote:
>> Looking at the current image lua API, I kinda doubt that it's worth to use
>> this
>> for generating a 1bit pixmap. Plus, if a window is resized you pretty much
>> have
>> to set a new pixmap. Everything else would look ugly or make the resize
>> pointless.
>
> We could adapt image API for such a case.
I just looked into this again. It looks like I can't to a 1-bit depth pixmap
with cairo which means cairo is a no-go here, so I would have to transfer the
shape to the X server via xcb_poly_point() which sucks. E.g. for a 15x1050 wibox
this would mean drawing 15.750 points. If I wanted a fullscreen wibox
(1680x1050) with some fancy shape (a debian swirl shaped wibox? Dunno...) I
would need 1.764.000 xcb_point_ts. I didn't do any benchmarks on this, but I
kinda doubt that this would have nice results...
The alternative would be to add a new lua api which wraps the X core drawing
primitives (Qt anyone? images and pixmaps?). Server-side drawing should be
faster anyway! (and more limited, but meh..)
But on the other hand I doubt that this is worth it just for window shapes.
Anyone can come up with ideas in which other places we could use pixmaps instead
of images to speed things up? If yes, I'll look into adding a pixmap lua type
(If jd doesnt mind..)
Looking at the current image api, here is what would not be hard on a pixmap:
- - No idea how one would rotate / orientate a pixmap.
- - save: Why does this even exist? But yeah, not possible with a pixmap.
- - draw_rectangle_gradient: Uhm, I'm almost sure not (easily) possible via the
X
core drawing api, but XRender can do it afaik (but XRender isn't available
everywhere)
- - Any kind of alpha is a no-go.
On the pro side, these are quite easy:
- - crop and crop_and_scale might be possible, I'm not sure about the latter.
- - insert: Hm, I'm confused from all the parameters, but the basic
functionality
can easily be implemented.
- - No problem: draw_pixel, _line, _rectangle and _circle
So is it worth the trouble to add a pixmap api just so that jd can have his
triangle-shaped wiboxes? ;)
Cheers,
Uli
P.S.: Oh and I have no idea how this lua-shape API would work with resizing a
wibox, I think I would make this reset the wibox' shape to a rectangle on
resize.
- --
"Do you know that books smell like nutmeg or some spice from a foreign land?"
-- Faber in Fahrenheit 451
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iQEcBAEBCAAGBQJKNgOyAAoJECLkKOvLj8sGKf4IAMpB3BvCOgKbIWE7T36uvV3y
ddy7uEBhK1LihqD93kI2Lq1ublFt6pLYhUcQtnEDdxxFAYiqtitv3auDfEGEHBMa
/oH4fSM76Gx48j9jgGVpL0JAePRbShJk1HyRNozHhjY6NcEhyojDaJBiEJQQXk/3
53Ss8cr9LDCnzQeVGDCesQ0zRcfbG5zipnsm8C8fZVnKKU82MbRrno6nApULJ07i
0F2sfrnxFW+9yYFlcDq+XUK1BxWCaUvET4iGYABekF4Vl22CVRYfi0EfddSCKjju
7bTwaKeEPUl0DIDgPd5vibzMlGz9GreRK2nZ15r339movxQ9/9aQcDk+5MNuFH0=
=HJzm
-----END PGP SIGNATURE-----
--
To unsubscribe, send mail to [email protected].