libweston: change read_format to struct pixel_format_info
Everywhere we are standardising to drm_fourcc.h pixel format codes, and using struct pixel_format_info as a general handle that allows us to access the equivalent format in various APIs. In the name of standardisation, convert weston_compositor::read_format to pixel_format_info. Pixman formats are defined CPU-endian, while DRM formats are defined always little-endian. OpenGL has various definitions. Correctly mapping between these when the CPU is big-endian is an extra chore we can hopefully offload to pixel-formats.c. GL-renderer read_format is still defined based on Pixman format, because of the pecualiar way OpenGL defines a pixel format with GL_UNSIGNED_BYTE. That matches the same Pixman format on big-endian but not the same drm_fourcc. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This commit is contained in:
committed by
Marius Vlad
parent
03c229f4ce
commit
b966fd07ea
@@ -43,6 +43,7 @@
|
||||
#include <libweston/libweston.h>
|
||||
#include "backend.h"
|
||||
#include "libweston-internal.h"
|
||||
#include "pixel-formats.h"
|
||||
#include "weston.h"
|
||||
#include "shared/helpers.h"
|
||||
#include "shared/os-compatibility.h"
|
||||
@@ -828,8 +829,9 @@ shared_output_repainted(struct wl_listener *listener, void *data)
|
||||
pixman_box32_t *r;
|
||||
pixman_image_t *damaged_image;
|
||||
pixman_transform_t transform;
|
||||
const pixman_format_code_t pixman_format =
|
||||
const struct pixel_format_info *read_format =
|
||||
so->output->compositor->read_format;
|
||||
const pixman_format_code_t pixman_format = read_format->pixman_format;
|
||||
|
||||
width = so->output->current_mode->width;
|
||||
height = so->output->current_mode->height;
|
||||
@@ -884,7 +886,7 @@ shared_output_repainted(struct wl_listener *listener, void *data)
|
||||
y_orig = y;
|
||||
|
||||
so->output->compositor->renderer->read_pixels(
|
||||
so->output, pixman_format,
|
||||
so->output, read_format,
|
||||
so->tmp_data, x, y_orig, width, height);
|
||||
|
||||
damaged_image = pixman_image_create_bits(pixman_format,
|
||||
|
||||
Reference in New Issue
Block a user