From 58a47e860a899f0a8a8380ead804f20836b973f0 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 20 Jan 2017 14:04:50 +0100 Subject: [PATCH] Add use_rgba member to video_frame_info_t --- gfx/drivers/gl.c | 4 +--- gfx/video_driver.c | 1 + gfx/video_driver.h | 1 + 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gfx/drivers/gl.c b/gfx/drivers/gl.c index aa085d2c73..6f289b4ccd 100644 --- a/gfx/drivers/gl.c +++ b/gfx/drivers/gl.c @@ -737,13 +737,11 @@ static INLINE void gl_copy_frame(gl_t *gl, const void *frame, else #endif { - bool use_rgba = video_driver_supports_rgba(); - glPixelStorei(GL_UNPACK_ALIGNMENT, video_pixel_get_alignment(width * gl->base_size)); /* Fallback for GLES devices without GL_BGRA_EXT. */ - if (gl->base_size == 4 && use_rgba) + if (gl->base_size == 4 && video_info->use_rgba) { video_frame_convert_argb8888_to_abgr8888( &gl->scaler, diff --git a/gfx/video_driver.c b/gfx/video_driver.c index b6c1a89ce3..55e6729382 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -2279,6 +2279,7 @@ void video_driver_build_info(video_frame_info_t *video_info) video_info->width = video_driver_width; video_info->height = video_driver_height; + video_info->use_rgba = video_driver_supports_rgba(); video_driver_threaded_unlock(); } diff --git a/gfx/video_driver.h b/gfx/video_driver.h index 0b745c8380..b08039dabd 100644 --- a/gfx/video_driver.h +++ b/gfx/video_driver.h @@ -111,6 +111,7 @@ typedef struct video_frame_info float font_msg_color_r; float font_msg_color_g; float font_msg_color_b; + bool use_rgba; } video_frame_info_t; /* Optionally implemented interface to poke more