summaryrefslogtreecommitdiff
path: root/gsk
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2021-09-22 02:01:41 +0200
committerBenjamin Otte <otte@redhat.com>2021-10-06 22:50:07 +0200
commit48781cf7f7b67fe2f769423150b8fecce67a3549 (patch)
tree79a29f868aa9b311e84c418c417814cc5c069784 /gsk
parent4360bc326ad9e19120a7bebfd7f5174c4e022f34 (diff)
downloadgtk+-48781cf7f7b67fe2f769423150b8fecce67a3549.tar.gz
memorytexture: Split out GdkMemoryFormat handling
Also, now make gdk_memory_convert() the only conversion functions and allow conversions between any 2 formats by going via a float[4]. This could be optimized via fast-paths, but so far it isn't.
Diffstat (limited to 'gsk')
-rw-r--r--gsk/ngl/gsknglcommandqueue.c1
-rw-r--r--gsk/ngl/gsknglglyphlibrary.c4
-rw-r--r--gsk/ngl/gskngliconlibrary.c4
3 files changed, 5 insertions, 4 deletions
diff --git a/gsk/ngl/gsknglcommandqueue.c b/gsk/ngl/gsknglcommandqueue.c
index a5fbf0dc8d..b2a474cf59 100644
--- a/gsk/ngl/gsknglcommandqueue.c
+++ b/gsk/ngl/gsknglcommandqueue.c
@@ -26,6 +26,7 @@
#include <string.h>
#include <gdk/gdkglcontextprivate.h>
+#include <gdk/gdkmemoryformatprivate.h>
#include <gdk/gdkmemorytextureprivate.h>
#include <gdk/gdkprofilerprivate.h>
#include <gsk/gskdebugprivate.h>
diff --git a/gsk/ngl/gsknglglyphlibrary.c b/gsk/ngl/gsknglglyphlibrary.c
index 33c86cc967..ede4f19105 100644
--- a/gsk/ngl/gsknglglyphlibrary.c
+++ b/gsk/ngl/gsknglglyphlibrary.c
@@ -21,7 +21,7 @@
#include "config.h"
#include <gdk/gdkglcontextprivate.h>
-#include <gdk/gdkmemorytextureprivate.h>
+#include <gdk/gdkmemoryformatprivate.h>
#include <gdk/gdkprofilerprivate.h>
#include "gsknglcommandqueueprivate.h"
@@ -237,7 +237,7 @@ gsk_ngl_glyph_library_upload_glyph (GskNglGlyphLibrary *self,
pixel_data = free_data = g_malloc (width * height * 4);
gdk_memory_convert (pixel_data,
width * 4,
- GDK_MEMORY_CONVERT_GLES_RGBA,
+ GDK_MEMORY_R8G8B8A8_PREMULTIPLIED,
cairo_image_surface_get_data (surface),
width * 4,
GDK_MEMORY_DEFAULT,
diff --git a/gsk/ngl/gskngliconlibrary.c b/gsk/ngl/gskngliconlibrary.c
index ab4d1b4d6f..cfc662a9e6 100644
--- a/gsk/ngl/gskngliconlibrary.c
+++ b/gsk/ngl/gskngliconlibrary.c
@@ -21,7 +21,7 @@
#include "config.h"
#include <gdk/gdkglcontextprivate.h>
-#include <gdk/gdkmemorytextureprivate.h>
+#include <gdk/gdkmemoryformatprivate.h>
#include <gdk/gdkprofilerprivate.h>
#include <gdk/gdktextureprivate.h>
@@ -115,7 +115,7 @@ gsk_ngl_icon_library_add (GskNglIconLibrary *self,
{
pixel_data = free_data = g_malloc (width * height * 4);
gdk_memory_convert (pixel_data, width * 4,
- GDK_MEMORY_CONVERT_GLES_RGBA,
+ GDK_MEMORY_R8G8B8A8_PREMULTIPLIED,
surface_data, cairo_image_surface_get_stride (surface),
GDK_MEMORY_DEFAULT, width, height);
gl_format = GL_RGBA;