[mutter] cogl: return correct enum type



commit 81bb4f00514d2e7e3706c0d62e288a5140d475ea
Author: Thomas Hindoe Paaboel Andersen <phomes gmail com>
Date:   Wed Nov 13 20:16:59 2019 +0100

    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
    5369b3c601fc537db6712c27a5453fa11236c66b
    
    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

 cogl/cogl/cogl-pipeline-state.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/cogl/cogl/cogl-pipeline-state.c b/cogl/cogl/cogl-pipeline-state.c
index c17440979..db56de88b 100644
--- a/cogl/cogl/cogl-pipeline-state.c
+++ b/cogl/cogl/cogl-pipeline-state.c
@@ -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);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]