i’m experimenting things with cairo as the backend, as i’m able to use full ARGB window mode in linux when a compositing manager is running (i’m 90% near completion of supporting semi transparent components in linux…).
when rendering a simple alpha rectangle all is working good:
cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, 0.5);
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
cairo_rectangle (cr, dx, dy, dw, dh);
cairo_fill (cr);
but when i try to blit the generate XBitmapImage from the LinuxComponentPeer:
[code] int ls, ps;
uint8* const pixels = myImageToLook->lockPixelDataReadWrite (0, 0, myImageToLook->getWidth(), myImageToLook->getHeight(), ls, ps);
cairo_surface_t* image =
cairo_image_surface_create_for_data (pixels,
myImageToLook->isARGB () ? CAIRO_FORMAT_ARGB32 : CAIRO_FORMAT_RGB24,
myImageToLook->getWidth(),
myImageToLook->getHeight(),
ls);
cairo_surface_write_to_png (image, "/home/kraken/Desktop/test.png");
cairo_surface_destroy (image);
myImageToLook->releasePixelDataReadWrite (pixels);
[/code]
The problem is that the png generated seems to have something strange, like wrong padding or pixel stride or byte order. I’ve tried with a RGB image instead of an ARGB but the result is the same…
This is what i get:
Can you check if cairo internal pixel storage is equal to the one in juce ? Or i’m doing something wrong ? Any clues ?