[retro-gtk: 12/12] gl-display: Load texture from RetroPixdata
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [retro-gtk: 12/12] gl-display: Load texture from RetroPixdata
- Date: Sat, 18 Nov 2017 13:30:14 +0000 (UTC)
commit 6b44a6eb56da2a45cee1e46f4a9e8e7e58ee9d0b
Author: Adrien Plazas <kekun plazas laposte net>
Date: Sat Nov 18 10:27:40 2017 +0100
gl-display: Load texture from RetroPixdata
Loads the texture directly from the pixdata when possible, avoiding
pixel format convertion to be done on the CPU and avoiding creating a
pixbuf.
retro-gtk/retro-gl-display.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/retro-gtk/retro-gl-display.c b/retro-gtk/retro-gl-display.c
index ecf3e11..4327cef 100644
--- a/retro-gtk/retro-gl-display.c
+++ b/retro-gtk/retro-gl-display.c
@@ -116,6 +116,13 @@ retro_gl_display_load_texture (RetroGLDisplay *self,
gint *texture_width,
gint *texture_height)
{
+ if (self->pixdata != NULL) {
+ *texture_width = retro_pixdata_get_width (self->pixdata);
+ *texture_height = retro_pixdata_get_height (self->pixdata);
+
+ return retro_pixdata_load_gl_texture (self->pixdata);
+ }
+
if (retro_gl_display_get_pixbuf (self) == NULL)
return FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]