tests/cogl: Migrate map buffer range test
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
This commit is contained in:
parent
0a841ce846
commit
33c582d33a
@ -1,6 +1,5 @@
|
|||||||
cogl_test_conformance_sources = [
|
cogl_test_conformance_sources = [
|
||||||
'test-conform-main.c',
|
'test-conform-main.c',
|
||||||
'test-map-buffer-range.c',
|
|
||||||
'test-npot-texture.c',
|
'test-npot-texture.c',
|
||||||
'test-alpha-textures.c',
|
'test-alpha-textures.c',
|
||||||
'test-texture-get-set-data.c',
|
'test-texture-get-set-data.c',
|
||||||
|
@ -77,8 +77,6 @@ main (int argc, char **argv)
|
|||||||
TEST_REQUIREMENT_GL,
|
TEST_REQUIREMENT_GL,
|
||||||
0);
|
0);
|
||||||
|
|
||||||
ADD_TEST (test_map_buffer_range, TEST_REQUIREMENT_MAP_WRITE, 0);
|
|
||||||
|
|
||||||
ADD_TEST (test_primitive_and_journal, 0, 0);
|
ADD_TEST (test_primitive_and_journal, 0, 0);
|
||||||
|
|
||||||
ADD_TEST (test_copy_replace_texture, 0, 0);
|
ADD_TEST (test_copy_replace_texture, 0, 0);
|
||||||
|
@ -9,7 +9,6 @@ void test_npot_texture (void);
|
|||||||
void test_texture_get_set_data (void);
|
void test_texture_get_set_data (void);
|
||||||
void test_alpha_textures (void);
|
void test_alpha_textures (void);
|
||||||
void test_framebuffer_get_bits (void);
|
void test_framebuffer_get_bits (void);
|
||||||
void test_map_buffer_range (void);
|
|
||||||
void test_primitive_and_journal (void);
|
void test_primitive_and_journal (void);
|
||||||
void test_copy_replace_texture (void);
|
void test_copy_replace_texture (void);
|
||||||
void test_pipeline_cache_unrefs_texture (void);
|
void test_pipeline_cache_unrefs_texture (void);
|
||||||
|
@ -27,6 +27,7 @@ cogl_tests = [
|
|||||||
[ 'test-no-gl-header', [] ],
|
[ 'test-no-gl-header', [] ],
|
||||||
[ 'test-layer-remove', [] ],
|
[ 'test-layer-remove', [] ],
|
||||||
[ 'test-alpha-test', [] ],
|
[ 'test-alpha-test', [] ],
|
||||||
|
[ 'test-map-buffer-range', [] ],
|
||||||
]
|
]
|
||||||
|
|
||||||
cogl_test_conformance_includes = [
|
cogl_test_conformance_includes = [
|
||||||
|
@ -2,8 +2,7 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "test-declarations.h"
|
#include "tests/cogl-test-utils.h"
|
||||||
#include "test-utils.h"
|
|
||||||
|
|
||||||
static uint8_t
|
static uint8_t
|
||||||
tex_data[2 * 2 * 4] =
|
tex_data[2 * 2 * 4] =
|
||||||
@ -23,7 +22,7 @@ vertex_data[4] =
|
|||||||
{ 1, 1, 0, 0 }
|
{ 1, 1, 0, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
void
|
static void
|
||||||
test_map_buffer_range (void)
|
test_map_buffer_range (void)
|
||||||
{
|
{
|
||||||
CoglTexture2D *tex;
|
CoglTexture2D *tex;
|
||||||
@ -35,6 +34,12 @@ test_map_buffer_range (void)
|
|||||||
CoglAttribute *tex_coord_attribute;
|
CoglAttribute *tex_coord_attribute;
|
||||||
CoglPrimitive *primitive;
|
CoglPrimitive *primitive;
|
||||||
|
|
||||||
|
if (!cogl_has_feature (test_ctx, COGL_FEATURE_ID_MAP_BUFFER_FOR_WRITE))
|
||||||
|
{
|
||||||
|
g_test_skip ("Missing map buffer for write capability");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
tex = cogl_texture_2d_new_from_data (test_ctx,
|
tex = cogl_texture_2d_new_from_data (test_ctx,
|
||||||
2, 2, /* width/height */
|
2, 2, /* width/height */
|
||||||
COGL_PIXEL_FORMAT_RGBA_8888_PRE,
|
COGL_PIXEL_FORMAT_RGBA_8888_PRE,
|
||||||
@ -122,3 +127,7 @@ test_map_buffer_range (void)
|
|||||||
if (cogl_test_verbose ())
|
if (cogl_test_verbose ())
|
||||||
g_print ("OK\n");
|
g_print ("OK\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
COGL_TEST_SUITE (
|
||||||
|
g_test_add_func ("/map-buffer-range", test_map_buffer_range);
|
||||||
|
)
|
Loading…
x
Reference in New Issue
Block a user