compositor: make GL_EXT_read_format_bgra optional

Some GL implementations do not provide GL_EXT_read_format_bgra
extension.

Set a glReadPixels format based on whether the extensions is supported
or not, and use that format in all backends.

Add RGBA->BGRA swapping copy to screenshooter to keep the shm buffer
data format as BGRA.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
diff --git a/src/compositor-drm.c b/src/compositor-drm.c
index 1b0fbd0..d2a2ea1 100644
--- a/src/compositor-drm.c
+++ b/src/compositor-drm.c
@@ -1052,8 +1052,9 @@
 	eglMakeCurrent(compositor->base.display, output->egl_surface,
 			output->egl_surface, compositor->base.context);
 
-	glReadPixels(0, 0, output_base->current->width, output_base->current->height,
-				GL_BGRA_EXT, GL_UNSIGNED_BYTE, data);
+	glReadPixels(0, 0, output_base->current->width,
+		     output_base->current->height,
+		     compositor->base.read_format, GL_UNSIGNED_BYTE, data);
 }
 
 static int