cogl: return correct enum type

cogl_pipeline_get_front_face_winding() is supposed to return a CoglWinding. It
takes a CoglPipeline as argument and does the following input validation:

g_return_val_if_fail (cogl_is_pipeline (pipeline),
                      COGL_PIPELINE_CULL_FACE_MODE_NONE);

The returned COGL_PIPELINE_CULL_FACE_MODE_NONE is not a winding.

The function was added with this check 8 years ago in
5369b3c601

I do not see any of the two options in the CoglWinding as particularly good
choice for a return value on bad input, but let's go with
COGL_WINDING_CLOCKWISE as that is equivalent with the behavior for all
these years.

Definitions of the two enums:

typedef enum
{
  COGL_WINDING_CLOCKWISE,
  COGL_WINDING_COUNTER_CLOCKWISE
} CoglWinding;

typedef enum
{
  COGL_PIPELINE_CULL_FACE_MODE_NONE,
  COGL_PIPELINE_CULL_FACE_MODE_FRONT,
  COGL_PIPELINE_CULL_FACE_MODE_BACK,
  COGL_PIPELINE_CULL_FACE_MODE_BOTH
} CoglPipelineCullFaceMode;

https://gitlab.gnome.org/GNOME/mutter/merge_requests/934
This commit is contained in:
Thomas Hindoe Paaboel Andersen 2019-11-13 20:16:59 +01:00
parent b078917500
commit 81bb4f0051

View File

@ -973,7 +973,7 @@ cogl_pipeline_get_front_face_winding (CoglPipeline *pipeline)
CoglPipeline *authority;
g_return_val_if_fail (cogl_is_pipeline (pipeline),
COGL_PIPELINE_CULL_FACE_MODE_NONE);
COGL_WINDING_CLOCKWISE);
authority = _cogl_pipeline_get_authority (pipeline, state);