mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 16:10:41 -05:00
Assert that we get a valid format in pixel_format_to_gl{,es}
The assert could use a 'default:' label but that would stop GCC from giving a warning when a new enum value is added. https://bugzilla.gnome.org/show_bug.cgi?id=671016 Reviewed-by: Robert Bragg <robert@linux.intel.com>
This commit is contained in:
parent
b6dc23370d
commit
2b9aca20a8
@ -400,7 +400,7 @@ _cogl_texture_driver_pixel_format_to_gl (CoglPixelFormat format,
|
||||
{
|
||||
CoglPixelFormat required_format;
|
||||
GLenum glintformat;
|
||||
GLenum glformat;
|
||||
GLenum glformat = 0;
|
||||
GLenum gltype;
|
||||
|
||||
required_format = format;
|
||||
@ -522,6 +522,10 @@ _cogl_texture_driver_pixel_format_to_gl (CoglPixelFormat format,
|
||||
break;
|
||||
}
|
||||
|
||||
/* All of the pixel formats are handled above so if this hits then
|
||||
we've been given an invalid pixel format */
|
||||
g_assert (glformat != 0);
|
||||
|
||||
if (out_glintformat != NULL)
|
||||
*out_glintformat = glintformat;
|
||||
if (out_glformat != NULL)
|
||||
|
@ -412,7 +412,7 @@ _cogl_texture_driver_pixel_format_to_gl (CoglPixelFormat format,
|
||||
{
|
||||
CoglPixelFormat required_format;
|
||||
GLenum glintformat;
|
||||
GLenum glformat;
|
||||
GLenum glformat = 0;
|
||||
GLenum gltype;
|
||||
|
||||
required_format = format;
|
||||
@ -491,6 +491,10 @@ _cogl_texture_driver_pixel_format_to_gl (CoglPixelFormat format,
|
||||
break;
|
||||
}
|
||||
|
||||
/* All of the pixel formats are handled above so if this hits then
|
||||
we've been given an invalid pixel format */
|
||||
g_assert (glformat != 0);
|
||||
|
||||
if (out_glintformat != NULL)
|
||||
*out_glintformat = glintformat;
|
||||
if (out_glformat != NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user