From 6b29371db33763e3a500542aeb617e38112f754a Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Sat, 2 Dec 2023 11:57:42 +0100 Subject: [PATCH] cogl: Remove unused private functions The commit also moves certain functions from the private header as they are not used anywhere else and removes COGL_EXPORT when the function is supposed to be private and is not used outside of cogl Part-of: --- cogl/cogl/cogl-buffer-private.h | 7 +----- cogl/cogl/cogl-buffer.c | 6 ----- cogl/cogl/cogl-closure-list-private.h | 2 +- cogl/cogl/cogl-framebuffer-private.h | 31 ++----------------------- cogl/cogl/cogl-framebuffer.c | 10 -------- cogl/cogl/cogl-journal-private.h | 1 - cogl/cogl/cogl-node-private.h | 1 - cogl/cogl/cogl-onscreen-private.h | 18 +------------- cogl/cogl/cogl-onscreen.c | 5 +++- cogl/cogl/cogl-pipeline-layer-private.h | 9 +------ cogl/cogl/cogl-pipeline-layer-state.c | 4 ++-- cogl/cogl/cogl-pipeline-private.h | 4 ++-- cogl/cogl/cogl-pipeline-state-private.h | 16 ------------- cogl/cogl/cogl-pipeline-state.c | 2 +- cogl/cogl/cogl-pipeline.c | 2 +- cogl/cogl/cogl-poll-private.h | 7 ++---- cogl/cogl/cogl-poll.c | 2 +- cogl/cogl/cogl-primitive-private.h | 2 +- cogl/cogl/cogl-texture-private.h | 2 +- 19 files changed, 21 insertions(+), 110 deletions(-) diff --git a/cogl/cogl/cogl-buffer-private.h b/cogl/cogl/cogl-buffer-private.h index 0027bc77f..9249d556f 100644 --- a/cogl/cogl/cogl-buffer-private.h +++ b/cogl/cogl/cogl-buffer-private.h @@ -110,9 +110,6 @@ struct _CoglBufferClass GObjectClass parent_class; }; -CoglBufferUsageHint -_cogl_buffer_get_usage_hint (CoglBuffer *buffer); - CoglBuffer * _cogl_buffer_immutable_ref (CoglBuffer *buffer); @@ -142,10 +139,8 @@ void * _cogl_buffer_map_range_for_fill_or_fallback (CoglBuffer *buffer, size_t offset, size_t size); -COGL_EXPORT void * -_cogl_buffer_map_for_fill_or_fallback (CoglBuffer *buffer); -COGL_EXPORT void +void _cogl_buffer_unmap_for_fill_or_fallback (CoglBuffer *buffer); G_END_DECLS diff --git a/cogl/cogl/cogl-buffer.c b/cogl/cogl/cogl-buffer.c index 03b80fe0c..23268f32c 100644 --- a/cogl/cogl/cogl-buffer.c +++ b/cogl/cogl/cogl-buffer.c @@ -324,12 +324,6 @@ cogl_buffer_unmap (CoglBuffer *buffer) buffer->unmap (buffer); } -void * -_cogl_buffer_map_for_fill_or_fallback (CoglBuffer *buffer) -{ - return _cogl_buffer_map_range_for_fill_or_fallback (buffer, 0, buffer->size); -} - void * _cogl_buffer_map_range_for_fill_or_fallback (CoglBuffer *buffer, size_t offset, diff --git a/cogl/cogl/cogl-closure-list-private.h b/cogl/cogl/cogl-closure-list-private.h index 40e08d555..df0831141 100644 --- a/cogl/cogl/cogl-closure-list-private.h +++ b/cogl/cogl/cogl-closure-list-private.h @@ -64,7 +64,7 @@ typedef struct _CoglClosure * Removes the given closure from the callback list it is connected to * and destroys it. If the closure was created with a destroy function * then it will be invoked. */ -COGL_EXPORT void +void _cogl_closure_disconnect (CoglClosure *closure); void diff --git a/cogl/cogl/cogl-framebuffer-private.h b/cogl/cogl/cogl-framebuffer-private.h index 519eb7b8e..eb014e00c 100644 --- a/cogl/cogl/cogl-framebuffer-private.h +++ b/cogl/cogl/cogl-framebuffer-private.h @@ -152,8 +152,6 @@ _cogl_framebuffer_set_internal_format (CoglFramebuffer *framebuffer, CoglPixelFormat cogl_framebuffer_get_internal_format (CoglFramebuffer *framebuffer); -void _cogl_framebuffer_free (CoglFramebuffer *framebuffer); - void _cogl_framebuffer_clear_without_flush4f (CoglFramebuffer *framebuffer, unsigned long buffers, @@ -181,10 +179,10 @@ cogl_framebuffer_set_depth_buffer_clear_needed (CoglFramebuffer *framebuffer); CoglClipStack * _cogl_framebuffer_get_clip_stack (CoglFramebuffer *framebuffer); -COGL_EXPORT CoglMatrixStack * +CoglMatrixStack * _cogl_framebuffer_get_modelview_stack (CoglFramebuffer *framebuffer); -COGL_EXPORT CoglMatrixStack * +CoglMatrixStack * _cogl_framebuffer_get_projection_stack (CoglFramebuffer *framebuffer); void @@ -203,20 +201,6 @@ cogl_context_flush_framebuffer_state (CoglContext *context, CoglFramebuffer *read_buffer, CoglFramebufferState state); -CoglFramebuffer * -_cogl_get_read_framebuffer (void); - -GSList * -_cogl_create_framebuffer_stack (void); - -void -_cogl_free_framebuffer_stack (GSList *stack); - -void -_cogl_framebuffer_save_clip_stack (CoglFramebuffer *framebuffer); - -void -_cogl_framebuffer_restore_clip_stack (CoglFramebuffer *framebuffer); /* This can be called directly by the CoglJournal to draw attributes * skipping the implicit journal flush, the framebuffer flush and @@ -282,17 +266,6 @@ _cogl_framebuffer_read_pixels_into_bitmap (CoglFramebuffer *framebuffer, CoglBitmap *bitmap, GError **error); -/* - * _cogl_framebuffer_get_stencil_bits: - * @framebuffer: a pointer to a #CoglFramebuffer - * - * Retrieves the number of stencil bits of @framebuffer - * - * Return value: the number of bits - */ -COGL_EXPORT int -_cogl_framebuffer_get_stencil_bits (CoglFramebuffer *framebuffer); - CoglJournal * cogl_framebuffer_get_journal (CoglFramebuffer *framebuffer); diff --git a/cogl/cogl/cogl-framebuffer.c b/cogl/cogl/cogl-framebuffer.c index 2ae7fc707..aa43fd1aa 100644 --- a/cogl/cogl/cogl-framebuffer.c +++ b/cogl/cogl/cogl-framebuffer.c @@ -1176,16 +1176,6 @@ cogl_framebuffer_get_depth_bits (CoglFramebuffer *framebuffer) return bits.depth; } -int -_cogl_framebuffer_get_stencil_bits (CoglFramebuffer *framebuffer) -{ - CoglFramebufferBits bits; - - cogl_framebuffer_query_bits (framebuffer, &bits); - - return bits.stencil; -} - gboolean cogl_framebuffer_get_is_stereo (CoglFramebuffer *framebuffer) { diff --git a/cogl/cogl/cogl-journal-private.h b/cogl/cogl/cogl-journal-private.h index 34ddaec5b..4240d195c 100644 --- a/cogl/cogl/cogl-journal-private.h +++ b/cogl/cogl/cogl-journal-private.h @@ -70,7 +70,6 @@ typedef struct _CoglJournal #define COGL_TYPE_JOURNAL (cogl_journal_get_type ()) -COGL_EXPORT G_DECLARE_FINAL_TYPE (CoglJournal, cogl_journal, COGL, diff --git a/cogl/cogl/cogl-node-private.h b/cogl/cogl/cogl-node-private.h index 7f10f10b6..14e2d9bcb 100644 --- a/cogl/cogl/cogl-node-private.h +++ b/cogl/cogl/cogl-node-private.h @@ -75,7 +75,6 @@ struct _CoglNodeClass G_DEFINE_AUTOPTR_CLEANUP_FUNC (CoglNode, g_object_unref) -COGL_EXPORT GType cogl_node_get_type (void) G_GNUC_CONST; void diff --git a/cogl/cogl/cogl-onscreen-private.h b/cogl/cogl/cogl-onscreen-private.h index 9dbecfd0c..959a60533 100644 --- a/cogl/cogl/cogl-onscreen-private.h +++ b/cogl/cogl/cogl-onscreen-private.h @@ -54,15 +54,10 @@ typedef struct _CoglOnscreenQueuedDirty CoglOnscreenDirtyInfo info; } CoglOnscreenQueuedDirty; -COGL_EXPORT void +void _cogl_framebuffer_winsys_update_size (CoglFramebuffer *framebuffer, int width, int height); -void -_cogl_onscreen_queue_event (CoglOnscreen *onscreen, - CoglFrameEvent type, - CoglFrameInfo *info); - COGL_EXPORT void _cogl_onscreen_notify_frame_sync (CoglOnscreen *onscreen, CoglFrameInfo *info); @@ -73,20 +68,9 @@ void _cogl_onscreen_queue_dirty (CoglOnscreen *onscreen, const CoglOnscreenDirtyInfo *info); - -void -_cogl_onscreen_queue_full_dirty (CoglOnscreen *onscreen); - void cogl_onscreen_bind (CoglOnscreen *onscreen); -COGL_EXPORT void -cogl_onscreen_set_winsys (CoglOnscreen *onscreen, - gpointer winsys); - -COGL_EXPORT gpointer -cogl_onscreen_get_winsys (CoglOnscreen *onscreen); - COGL_EXPORT CoglFrameInfo * cogl_onscreen_peek_head_frame_info (CoglOnscreen *onscreen); diff --git a/cogl/cogl/cogl-onscreen.c b/cogl/cogl/cogl-onscreen.c index f6b075c80..f4b460a83 100644 --- a/cogl/cogl/cogl-onscreen.c +++ b/cogl/cogl/cogl-onscreen.c @@ -55,6 +55,9 @@ typedef struct _CoglOnscreenPrivate GQueue pending_frame_infos; } CoglOnscreenPrivate; +static void +_cogl_onscreen_queue_full_dirty (CoglOnscreen *onscreen); + G_DEFINE_TYPE_WITH_PRIVATE (CoglOnscreen, cogl_onscreen, COGL_TYPE_FRAMEBUFFER) static gpointer @@ -275,7 +278,7 @@ _cogl_onscreen_queue_full_dirty (CoglOnscreen *onscreen) _cogl_onscreen_queue_dirty (onscreen, &info); } -void +static void _cogl_onscreen_queue_event (CoglOnscreen *onscreen, CoglFrameEvent type, CoglFrameInfo *info) diff --git a/cogl/cogl/cogl-pipeline-layer-private.h b/cogl/cogl/cogl-pipeline-layer-private.h index a24603c8e..b93904405 100644 --- a/cogl/cogl/cogl-pipeline-layer-private.h +++ b/cogl/cogl/cogl-pipeline-layer-private.h @@ -56,7 +56,6 @@ typedef struct _CoglPipelineLayer CoglPipelineLayer; G_DEFINE_AUTOPTR_CLEANUP_FUNC (CoglPipelineLayer, g_object_unref) -COGL_EXPORT GType cogl_pipeline_layer_get_type (void) G_GNUC_CONST; /* XXX: should I rename these as @@ -342,18 +341,12 @@ typedef enum CoglPipelineLayerType _cogl_pipeline_layer_get_type (CoglPipelineLayer *layer); -COGL_EXPORT CoglTexture * +CoglTexture * _cogl_pipeline_layer_get_texture (CoglPipelineLayer *layer); CoglTexture * _cogl_pipeline_layer_get_texture_real (CoglPipelineLayer *layer); -CoglPipelineWrapMode -_cogl_pipeline_layer_get_wrap_mode_s (CoglPipelineLayer *layer); - -CoglPipelineWrapMode -_cogl_pipeline_layer_get_wrap_mode_t (CoglPipelineLayer *layer); - void _cogl_pipeline_layer_copy_differences (CoglPipelineLayer *dest, CoglPipelineLayer *src, diff --git a/cogl/cogl/cogl-pipeline-layer-state.c b/cogl/cogl/cogl-pipeline-layer-state.c index 05712fcb6..c6625566e 100644 --- a/cogl/cogl/cogl-pipeline-layer-state.c +++ b/cogl/cogl/cogl-pipeline-layer-state.c @@ -412,7 +412,7 @@ cogl_pipeline_set_layer_wrap_mode (CoglPipeline *pipeline, } /* FIXME: deprecate this API */ -CoglPipelineWrapMode +static CoglPipelineWrapMode _cogl_pipeline_layer_get_wrap_mode_s (CoglPipelineLayer *layer) { CoglPipelineLayerState change = COGL_PIPELINE_LAYER_STATE_SAMPLER; @@ -449,7 +449,7 @@ cogl_pipeline_get_layer_wrap_mode_s (CoglPipeline *pipeline, int layer_index) } /* FIXME: deprecate this API */ -CoglPipelineWrapMode +static CoglPipelineWrapMode _cogl_pipeline_layer_get_wrap_mode_t (CoglPipelineLayer *layer) { CoglPipelineLayerState change = COGL_PIPELINE_LAYER_STATE_SAMPLER; diff --git a/cogl/cogl/cogl-pipeline-private.h b/cogl/cogl/cogl-pipeline-private.h index 946d3f152..1bc994287 100644 --- a/cogl/cogl/cogl-pipeline-private.h +++ b/cogl/cogl/cogl-pipeline-private.h @@ -766,7 +766,7 @@ _cogl_pipeline_get_layer_combine_constant (CoglPipeline *pipeline, int layer_index, float *constant); -COGL_EXPORT void +void _cogl_pipeline_prune_to_n_layers (CoglPipeline *pipeline, int n); @@ -777,7 +777,7 @@ _cogl_pipeline_prune_to_n_layers (CoglPipeline *pipeline, int n); typedef gboolean (*CoglPipelineInternalLayerCallback) (CoglPipelineLayer *layer, void *user_data); -COGL_EXPORT void +void _cogl_pipeline_foreach_layer_internal (CoglPipeline *pipeline, CoglPipelineInternalLayerCallback callback, void *user_data); diff --git a/cogl/cogl/cogl-pipeline-state-private.h b/cogl/cogl/cogl-pipeline-state-private.h index b3451482e..9633e98b6 100644 --- a/cogl/cogl/cogl-pipeline-state-private.h +++ b/cogl/cogl/cogl-pipeline-state-private.h @@ -42,10 +42,6 @@ _cogl_pipeline_has_non_layer_vertex_snippets (CoglPipeline *pipeline); gboolean _cogl_pipeline_has_non_layer_fragment_snippets (CoglPipeline *pipeline); -gboolean -_cogl_pipeline_color_equal (CoglPipeline *authority0, - CoglPipeline *authority1); - gboolean _cogl_pipeline_alpha_func_state_equal (CoglPipeline *authority0, CoglPipeline *authority1); @@ -73,10 +69,6 @@ gboolean _cogl_pipeline_per_vertex_point_size_equal (CoglPipeline *authority0, CoglPipeline *authority1); -gboolean -_cogl_pipeline_logic_ops_state_equal (CoglPipeline *authority0, - CoglPipeline *authority1); - gboolean _cogl_pipeline_user_shader_equal (CoglPipeline *authority0, CoglPipeline *authority1); @@ -101,10 +93,6 @@ void _cogl_pipeline_hash_color_state (CoglPipeline *authority, CoglPipelineHashState *state); -void -_cogl_pipeline_hash_layers_state (CoglPipeline *authority, - CoglPipelineHashState *state); - void _cogl_pipeline_hash_alpha_func_state (CoglPipeline *authority, CoglPipelineHashState *state); @@ -137,10 +125,6 @@ void _cogl_pipeline_hash_per_vertex_point_size_state (CoglPipeline *authority, CoglPipelineHashState *state); -void -_cogl_pipeline_hash_logic_ops_state (CoglPipeline *authority, - CoglPipelineHashState *state); - void _cogl_pipeline_hash_cull_face_state (CoglPipeline *authority, CoglPipelineHashState *state); diff --git a/cogl/cogl/cogl-pipeline-state.c b/cogl/cogl/cogl-pipeline-state.c index 0549d2f2e..9403a4bbe 100644 --- a/cogl/cogl/cogl-pipeline-state.c +++ b/cogl/cogl/cogl-pipeline-state.c @@ -47,7 +47,7 @@ #define GL_FUNC_ADD 0x8006 #endif -gboolean +static gboolean _cogl_pipeline_color_equal (CoglPipeline *authority0, CoglPipeline *authority1) { diff --git a/cogl/cogl/cogl-pipeline.c b/cogl/cogl/cogl-pipeline.c index 1104d03bd..9f3d2977f 100644 --- a/cogl/cogl/cogl-pipeline.c +++ b/cogl/cogl/cogl-pipeline.c @@ -2424,7 +2424,7 @@ _cogl_pipeline_hash_layer_cb (CoglPipelineLayer *layer, return TRUE; } -void +static void _cogl_pipeline_hash_layers_state (CoglPipeline *authority, CoglPipelineHashState *state) { diff --git a/cogl/cogl/cogl-poll-private.h b/cogl/cogl/cogl-poll-private.h index 9690ff5c5..1512d2c80 100644 --- a/cogl/cogl/cogl-poll-private.h +++ b/cogl/cogl/cogl-poll-private.h @@ -34,13 +34,10 @@ #include "cogl/cogl-renderer.h" #include "cogl/cogl-closure-list-private.h" -void -_cogl_poll_renderer_remove_fd (CoglRenderer *renderer, int fd); - typedef int64_t (*CoglPollPrepareCallback) (void *user_data); typedef void (*CoglPollDispatchCallback) (void *user_data, int revents); -COGL_EXPORT void +void _cogl_poll_renderer_add_fd (CoglRenderer *renderer, int fd, CoglPollFDEvent events, @@ -58,7 +55,7 @@ _cogl_poll_renderer_add_source (CoglRenderer *renderer, typedef void (*CoglIdleCallback) (void *user_data); -COGL_EXPORT CoglClosure * +CoglClosure * _cogl_poll_renderer_add_idle (CoglRenderer *renderer, CoglIdleCallback idle_cb, void *user_data, diff --git a/cogl/cogl/cogl-poll.c b/cogl/cogl/cogl-poll.c index 6b160e6d1..1d93c00fb 100644 --- a/cogl/cogl/cogl-poll.c +++ b/cogl/cogl/cogl-poll.c @@ -143,7 +143,7 @@ find_pollfd (CoglRenderer *renderer, int fd) return -1; } -void +static void _cogl_poll_renderer_remove_fd (CoglRenderer *renderer, int fd) { int i = find_pollfd (renderer, fd); diff --git a/cogl/cogl/cogl-primitive-private.h b/cogl/cogl/cogl-primitive-private.h index 63e235f2b..64ef89033 100644 --- a/cogl/cogl/cogl-primitive-private.h +++ b/cogl/cogl/cogl-primitive-private.h @@ -58,7 +58,7 @@ _cogl_primitive_immutable_ref (CoglPrimitive *primitive); void _cogl_primitive_immutable_unref (CoglPrimitive *primitive); -COGL_EXPORT void +void _cogl_primitive_draw (CoglPrimitive *primitive, CoglFramebuffer *framebuffer, CoglPipeline *pipeline, diff --git a/cogl/cogl/cogl-texture-private.h b/cogl/cogl/cogl-texture-private.h index 5f28a7474..6338a1c21 100644 --- a/cogl/cogl/cogl-texture-private.h +++ b/cogl/cogl/cogl-texture-private.h @@ -240,7 +240,7 @@ struct _CoglTexturePixel uint8_t data[4]; }; -COGL_EXPORT gboolean +gboolean _cogl_texture_can_hardware_repeat (CoglTexture *texture); void