[Piglit] [PATCH] Add new test to exercise glBitmap in display lists
Brian Paul
brianp at vmware.com
Sun Feb 14 14:11:44 UTC 2016
On 02/13/2016 03:44 PM, Jose Fonseca wrote:
> On 13/02/16 01:07, Brian Paul wrote:
>> ---
>> tests/all.py | 1 +
>> tests/spec/gl-1.0/CMakeLists.gl.txt | 1 +
>> tests/spec/gl-1.0/dlist-bitmap.c | 236
>> ++++++++++++++++++++++++++++++++++++
>> 3 files changed, 238 insertions(+)
>> create mode 100644 tests/spec/gl-1.0/dlist-bitmap.c
>>
>> diff --git a/tests/all.py b/tests/all.py
>> index 303526d..153a579 100644
>> --- a/tests/all.py
>> +++ b/tests/all.py
>> @@ -989,6 +989,7 @@ with profile.group_manager(
>> grouptools.join('spec', '!opengl 1.0')) as g:
>> g(['gl-1.0-beginend-coverage'])
>> g(['gl-1.0-dlist-beginend'])
>> + g(['gl-1.0-dlist-bitmap'])
>> g(['gl-1.0-dlist-shademodel'])
>> g(['gl-1.0-drawpixels-color-index'])
>> g(['gl-1.0-edgeflag'])
>> diff --git a/tests/spec/gl-1.0/CMakeLists.gl.txt
>> b/tests/spec/gl-1.0/CMakeLists.gl.txt
>> index 6ef9059..70d4581 100644
>> --- a/tests/spec/gl-1.0/CMakeLists.gl.txt
>> +++ b/tests/spec/gl-1.0/CMakeLists.gl.txt
>> @@ -11,6 +11,7 @@ link_libraries (
>> piglit_add_executable (gl-1.0-beginend-coverage beginend-coverage.c)
>> piglit_add_executable (gl-1.0-blend-func blend.c)
>> piglit_add_executable (gl-1.0-dlist-beginend dlist-beginend.c)
>> +piglit_add_executable (gl-1.0-dlist-bitmap dlist-bitmap.c)
>> piglit_add_executable (gl-1.0-dlist-shademodel dlist-shademodel.c)
>> piglit_add_executable (gl-1.0-drawpixels-color-index
>> drawpixels-color-index.c)
>> piglit_add_executable (gl-1.0-edgeflag edgeflag.c)
>> diff --git a/tests/spec/gl-1.0/dlist-bitmap.c
>> b/tests/spec/gl-1.0/dlist-bitmap.c
>> new file mode 100644
>> index 0000000..9773f16
>> --- /dev/null
>> +++ b/tests/spec/gl-1.0/dlist-bitmap.c
>> @@ -0,0 +1,236 @@
>> +/*
>> + * Copyright (C) 2016 VMware, Inc.
>> + *
>> + * Permission is hereby granted, free of charge, to any person
>> obtaining a
>> + * copy of this software and associated documentation files (the
>> "Software"),
>> + * to deal in the Software without restriction, including without
>> limitation
>> + * the rights to use, copy, modify, merge, publish, distribute,
>> sublicense,
>> + * and/or sell copies of the Software, and to permit persons to whom the
>> + * Software is furnished to do so, subject to the following conditions:
>> + *
>> + * The above copyright notice and this permission notice (including
>> the next
>> + * paragraph) shall be included in all copies or substantial portions
>> of the
>> + * Software.
>> + *
>> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
>> EXPRESS OR
>> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
>> MERCHANTABILITY,
>> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
>> SHALL
>> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
>> OR OTHER
>> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
>> ARISING
>> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
>> OTHER DEALINGS
>> + * IN THE SOFTWARE.
>> + */
>> +
>> +/**
>> + * Test glBitmap, glCallList, glCallLists.
>> + * To exercise the texture atlas feature in Mesa.
>> + * Brian Paul
>> + * 3 Feb 2016
>> + */
>> +
>> +#include "piglit-util-gl.h"
>> +
>> +
>> +PIGLIT_GL_TEST_CONFIG_BEGIN
>> + config.supports_gl_compat_version = 10;
>> + config.window_visual = PIGLIT_GL_VISUAL_DOUBLE |
>> PIGLIT_GL_VISUAL_RGBA;
>> + config.window_width = 900;
>> + config.window_height = 300;
>> +PIGLIT_GL_TEST_CONFIG_END
>> +
>> +
>> +enum draw_mode
>> +{
>> + BITMAP,
>> + CALL_LIST,
>> + CALL_LISTS,
>> + CALL_LISTS_IN_LIST,
>> +};
>> +
>> +
>> +struct bitmap_info
>> +{
>> + unsigned width, height;
>> + float xorig, yorig;
>> + float xmove, ymove;
>> + GLubyte bits[100];
>> +};
>> +
>> +#define NUM_BITMAPS 25
>> +
>> +static struct bitmap_info bitmaps[NUM_BITMAPS];
>> +static GLuint ListBase;
>> +static GLubyte *refImage;
>> +static const float yellow[3] = {0.7, 1, 0.5};
>> +
>> +
>> +static void
>> +init_bitmaps(void)
>> +{
>> + unsigned i, j;
>> +
>> + for (i = 0; i < NUM_BITMAPS; i++) {
>> + bitmaps[i].width = 4 + i * 2;
>> + bitmaps[i].height = 8 + 3 * (i & 1);
>> + bitmaps[i].xorig = 0*i;
>> + bitmaps[i].yorig = 0*0.5 * i;
>
> The zero multiplies are confusing. Not sure what was the original intent
> zero, or the right-hand side expression, but better express it clearly.
Oops, that's a left-over debug change. I'll clean that up before
pushing. Thanks!
-Brian
More information about the Piglit
mailing list