[retro-gtk/wip/aplazas/gl-display: 11/12] gl-display: Load texture from RetroPixdata
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [retro-gtk/wip/aplazas/gl-display: 11/12] gl-display: Load texture from RetroPixdata
- Date: Sat, 18 Nov 2017 09:41:05 +0000 (UTC)
commit b760e1f45653826fd3b0d0ff0892541f479ae498
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 9bf340e..2606027 100644
--- a/retro-gtk/retro-gl-display.c
+++ b/retro-gtk/retro-gl-display.c
@@ -117,6 +117,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]