[gtk/wip/otte/gles: 2/5] testsuite: Add a test targeting GL upload code
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/otte/gles: 2/5] testsuite: Add a test targeting GL upload code
- Date: Sat, 9 Oct 2021 02:45:01 +0000 (UTC)
commit b4ab9f7b8c009f20de494a50b9a40917e6a289a0
Author: Benjamin Otte <otte redhat com>
Date: Fri Oct 8 20:15:07 2021 +0200
testsuite: Add a test targeting GL upload code
Previously, all the tests used the icon upload path using
glTexSubImage2D().
This test uses the custom texture path using glTexImage2D().
testsuite/gdk/memorytexture.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
---
diff --git a/testsuite/gdk/memorytexture.c b/testsuite/gdk/memorytexture.c
index 488aec4d6c..401ad58d2f 100644
--- a/testsuite/gdk/memorytexture.c
+++ b/testsuite/gdk/memorytexture.c
@@ -618,6 +618,27 @@ test_download_4x4 (gconstpointer data)
}
}
+/* larger than what NGL puts into the icon cache */
+static void
+test_download_192x192 (gconstpointer data)
+{
+ GdkMemoryFormat format;
+ TextureMethod method;
+ GdkTexture *expected, *test;
+ GdkRGBA color;
+
+ decode (data, &format, &method);
+
+ create_random_color (&color);
+ expected = create_texture (GDK_MEMORY_DEFAULT, TEXTURE_METHOD_LOCAL, 192, 192, &color);
+ test = create_texture (format, method, 192, 192, &color);
+
+ compare_textures (expected, test, gdk_memory_format_has_alpha (format));
+
+ g_object_unref (expected);
+ g_object_unref (test);
+}
+
static void
test_download_float_1x1 (gconstpointer data)
{
@@ -708,6 +729,7 @@ main (int argc, char *argv[])
add_test ("/memorytexture/download_1x1", test_download_1x1);
add_test ("/memorytexture/download_4x4", test_download_4x4);
+ add_test ("/memorytexture/download_192x192", test_download_192x192);
add_test ("/memorytexture/download_float_1x1", test_download_float_1x1);
add_test ("/memorytexture/download_float_4x4", test_download_float_4x4);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]