}
if (strstr(extensions, "GL_EXT_read_format_bgra"))
- ec->read_format = GL_BGRA_EXT;
+ ec->read_format = PIXMAN_a8r8g8b8;
else
- ec->read_format = GL_RGBA;
+ ec->read_format = PIXMAN_a8b8g8r8;
if (strstr(extensions, "GL_EXT_unpack_subimage"))
ec->has_unpack_subimage = 1;
return;
}
- glPixelStorei(GL_PACK_ALIGNMENT, 1);
- glReadPixels(0, 0, output->current->width, output->current->height,
- output->compositor->read_format,
- GL_UNSIGNED_BYTE, pixels);
+ output->compositor->renderer->read_pixels(output,
+ output->compositor->read_format, pixels,
+ 0, 0, output->current->width,
+ output->current->height);
stride = wl_shm_buffer_get_stride(l->buffer);
s = pixels + stride * (l->buffer->height - 1);
switch (output->compositor->read_format) {
- case GL_BGRA_EXT:
+ case PIXMAN_a8r8g8b8:
copy_bgra_yflip(d, s, output->current->height, stride);
break;
- case GL_RGBA:
+ case PIXMAN_a8b8g8r8:
copy_rgba_yflip(d, s, output->current->height, stride);
break;
default:
for (i = 0; i < n; i++) {
width = r[i].x2 - r[i].x1;
height = r[i].y2 - r[i].y1;
- glReadPixels(r[i].x1, output->current->height - r[i].y2,
- width, height,
- output->compositor->read_format,
- GL_UNSIGNED_BYTE, recorder->rect);
+ output->compositor->renderer->read_pixels(output,
+ output->compositor->read_format, recorder->rect,
+ r[i].x1, output->current->height - r[i].y2,
+ width, height);
s = recorder->rect;
p = recorder->rect;
header.magic = WCAP_HEADER_MAGIC;
switch (output->compositor->read_format) {
- case GL_BGRA_EXT:
+ case PIXMAN_a8r8g8b8:
header.format = WCAP_FORMAT_XRGB8888;
break;
- case GL_RGBA:
+ case PIXMAN_a8b8g8r8:
header.format = WCAP_FORMAT_XBGR8888;
break;
+ default:
+ weston_log("unknown recorder format\n");
+ break;
}
header.width = output->current->width;