289fdeb019
This rewrites load_surface_from_png() to load_image_from_png(), to return a pixman_image_t instead of a struct surface. A loaded image has no need for wl_buffer or wl_surface or any of the associated attributes. This is part of unifying to make everything use pixman_image_t. cairo_surface_flush() is added, because Cairo documentation for cairo_image_surface_get_data() says you have to flush after drawing, before using the data. It is unclear if loading a PNG counts as drawing, so stay on the safe side. load_image_from_png() now pays attention to the pixel format returned by Cairo, which seems to come out as CAIRO_FORMAT_RGB24 in internal-screenshot-test, not as CAIRO_FORMAT_ARGB32 as expected. I do not know if Cairo actually guarantees the x8/a8 channel to be 0xff for RGB24, but better to not trust it. Therefore the image is explicitly converted to a8r8g8b8 as needed. This also adds support for loading A8 and RGB16_565 images, provided that Cairo delivers them. The cairo surface is now wrapped directly into a pixman_image_t. If the pixel format conversion is not needed, this eliminates a copy of the image data. The Cairo surface will get automatically destroyed with the Pixman image. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Daniel Stone <daniels@collabora.com> |
||
---|---|---|
.. | ||
reference | ||
.gitignore | ||
bad-buffer-test.c | ||
buffer-count-test.c | ||
button-test.c | ||
config-parser-test.c | ||
devices-test.c | ||
event-test.c | ||
internal-screenshot-test.c | ||
internal-screenshot.ini | ||
ivi_layout-internal-test.c | ||
ivi_layout-test-plugin.c | ||
ivi_layout-test.c | ||
ivi-shell-app-test.c | ||
ivi-test.h | ||
keyboard-test.c | ||
matrix-test.c | ||
presentation-test.c | ||
roles-test.c | ||
setbacklight.c | ||
subsurface-test.c | ||
surface-global-test.c | ||
surface-screenshot.c | ||
surface-test.c | ||
text-test.c | ||
vertex-clip-test.c | ||
viewporter-test.c | ||
weston-test-client-helper.c | ||
weston-test-client-helper.h | ||
weston-test-runner.c | ||
weston-test-runner.h | ||
weston-test.c | ||
weston-tests-env | ||
xwayland-test.c |