summaryrefslogtreecommitdiff
path: root/cogl/tests/conform/test-texture-no-allocate.c
diff options
context:
space:
mode:
authorFlorian Müllner <fmuellner@gnome.org>2021-07-19 00:01:24 +0200
committerFlorian Müllner <fmuellner@gnome.org>2021-07-19 00:03:33 +0200
commit952865a86ebb08f97263cfdbfe38b7adc20e4560 (patch)
tree1f9347628656210b03ceee4fae83beb21491d1eb /cogl/tests/conform/test-texture-no-allocate.c
parent7862f143937e43dca0513af3a24dabfb4d0db4fc (diff)
downloadmutter-master.tar.gz
Replace contents with redirect messagemaster
The default development branch is now `main`. This commit only exists on `master` to point people towards that. See https://gitlab.gnome.org/GNOME/glib/-/issues/2348 for details.
Diffstat (limited to 'cogl/tests/conform/test-texture-no-allocate.c')
-rw-r--r--cogl/tests/conform/test-texture-no-allocate.c63
1 files changed, 0 insertions, 63 deletions
diff --git a/cogl/tests/conform/test-texture-no-allocate.c b/cogl/tests/conform/test-texture-no-allocate.c
deleted file mode 100644
index de2f6e0e3..000000000
--- a/cogl/tests/conform/test-texture-no-allocate.c
+++ /dev/null
@@ -1,63 +0,0 @@
-#include <cogl/cogl.h>
-
-#include "test-declarations.h"
-#include "test-utils.h"
-
-/* Tests that the various texture types can be freed without being
- * allocated */
-
-/* Texture size that is probably to big to fit within the texture
- * limits */
-#define BIG_TEX_WIDTH 16384
-#define BIG_TEX_HEIGHT 128
-
-void
-test_texture_no_allocate (void)
-{
- uint8_t *tex_data;
- CoglTexture *texture;
- CoglTexture2D *texture_2d;
- GError *error = NULL;
-
- tex_data = g_malloc (BIG_TEX_WIDTH * BIG_TEX_HEIGHT * 4);
-
- /* NB: if we make the atlas and sliced texture APIs public then this
- * could changed to explicitly use that instead of the magic texture
- * API */
-
- /* Try to create an atlas texture that is too big so it will
- * internally be freed without allocating */
- texture =
- cogl_atlas_texture_new_from_data (test_ctx,
- BIG_TEX_WIDTH,
- BIG_TEX_HEIGHT,
- /* format */
- COGL_PIXEL_FORMAT_RGBA_8888_PRE,
- /* rowstride */
- BIG_TEX_WIDTH * 4,
- tex_data,
- &error);
-
- g_free (tex_data);
-
- /* It's ok if this causes an error, we just don't want it to
- * crash */
-
- if (texture == NULL)
- g_error_free (error);
- else
- cogl_object_unref (texture);
-
- /* Try to create a sliced texture without allocating it */
- texture =
- cogl_texture_2d_sliced_new_with_size (test_ctx,
- BIG_TEX_WIDTH,
- BIG_TEX_HEIGHT,
- COGL_TEXTURE_MAX_WASTE);
- cogl_object_unref (texture);
-
- /* 2D texture */
- texture_2d = cogl_texture_2d_new_with_size (test_ctx,
- 64, 64);
- cogl_object_unref (texture_2d);
-}