From 898044b9a570c047642458d07aba01895d8658ed Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Mon, 23 Oct 2023 21:39:46 +0200 Subject: [PATCH] cogl/driver: Remove pixel_format_from_gl_internal It's unused. Part-of: --- cogl/cogl/cogl-driver.h | 7 --- cogl/cogl/driver/gl/gl/cogl-driver-gl.c | 50 --------------------- cogl/cogl/driver/gl/gles/cogl-driver-gles.c | 9 ---- cogl/cogl/driver/nop/cogl-driver-nop.c | 1 - 4 files changed, 67 deletions(-) diff --git a/cogl/cogl/cogl-driver.h b/cogl/cogl/cogl-driver.h index e2ad9e027..c0870062b 100644 --- a/cogl/cogl/cogl-driver.h +++ b/cogl/cogl/cogl-driver.h @@ -53,13 +53,6 @@ struct _CoglDriverVtable CoglGraphicsResetStatus (* get_graphics_reset_status) (CoglContext *context); - /* TODO: factor this out since this is OpenGL specific and - * so can be ignored by non-OpenGL drivers. */ - gboolean - (* pixel_format_from_gl_internal) (CoglContext *context, - GLenum gl_int_format, - CoglPixelFormat *out_format); - /* TODO: factor this out since this is OpenGL specific and * so can be ignored by non-OpenGL drivers. */ CoglPixelFormat diff --git a/cogl/cogl/driver/gl/gl/cogl-driver-gl.c b/cogl/cogl/driver/gl/gl/cogl-driver-gl.c index 62c15c4ec..d7231d3ca 100644 --- a/cogl/cogl/driver/gl/gl/cogl-driver-gl.c +++ b/cogl/cogl/driver/gl/gl/cogl-driver-gl.c @@ -71,55 +71,6 @@ _cogl_driver_gl_real_context_init (CoglContext *context) return TRUE; } -static gboolean -_cogl_driver_pixel_format_from_gl_internal (CoglContext *context, - GLenum gl_int_format, - CoglPixelFormat *out_format) -{ - /* It doesn't really matter we convert to exact same - format (some have no cogl match anyway) since format - is re-matched against cogl when getting or setting - texture image data. - */ - - switch (gl_int_format) - { - case GL_ALPHA: case GL_ALPHA4: case GL_ALPHA8: - case GL_ALPHA12: case GL_ALPHA16: - /* Cogl only supports one single-component texture so if we have - * ended up with a red texture then it is probably being used as - * a component-alpha texture */ - case GL_RED: - - *out_format = COGL_PIXEL_FORMAT_A_8; - return TRUE; - - case GL_LUMINANCE: case GL_LUMINANCE4: case GL_LUMINANCE8: - case GL_LUMINANCE12: case GL_LUMINANCE16: - - *out_format = COGL_PIXEL_FORMAT_G_8; - return TRUE; - - case GL_RG: - *out_format = COGL_PIXEL_FORMAT_RG_88; - return TRUE; - - case GL_RGB: case GL_RGB4: case GL_RGB5: case GL_RGB8: - case GL_RGB10: case GL_RGB12: case GL_RGB16: case GL_R3_G3_B2: - - *out_format = COGL_PIXEL_FORMAT_RGB_888; - return TRUE; - - case GL_RGBA: case GL_RGBA2: case GL_RGBA4: case GL_RGB5_A1: - case GL_RGBA8: case GL_RGB10_A2: case GL_RGBA12: case GL_RGBA16: - - *out_format = COGL_PIXEL_FORMAT_RGBA_8888; - return TRUE; - } - - return FALSE; -} - static CoglPixelFormat _cogl_driver_pixel_format_to_gl (CoglContext *context, CoglPixelFormat format, @@ -626,7 +577,6 @@ _cogl_driver_gl = _cogl_driver_gl_context_deinit, _cogl_driver_gl_is_hardware_accelerated, _cogl_gl_get_graphics_reset_status, - _cogl_driver_pixel_format_from_gl_internal, _cogl_driver_pixel_format_to_gl, _cogl_driver_read_pixels_format_supported, _cogl_driver_update_features, diff --git a/cogl/cogl/driver/gl/gles/cogl-driver-gles.c b/cogl/cogl/driver/gl/gles/cogl-driver-gles.c index 32703e811..3485d0a8f 100644 --- a/cogl/cogl/driver/gl/gles/cogl-driver-gles.c +++ b/cogl/cogl/driver/gl/gles/cogl-driver-gles.c @@ -63,14 +63,6 @@ #define GL_HALF_FLOAT_OES 0x8D61 #endif -static gboolean -_cogl_driver_pixel_format_from_gl_internal (CoglContext *context, - GLenum gl_int_format, - CoglPixelFormat *out_format) -{ - return TRUE; -} - static CoglPixelFormat _cogl_driver_pixel_format_to_gl (CoglContext *context, CoglPixelFormat format, @@ -509,7 +501,6 @@ _cogl_driver_gles = _cogl_driver_gl_context_deinit, _cogl_driver_gl_is_hardware_accelerated, _cogl_gl_get_graphics_reset_status, - _cogl_driver_pixel_format_from_gl_internal, _cogl_driver_pixel_format_to_gl, _cogl_driver_read_pixels_format_supported, _cogl_driver_update_features, diff --git a/cogl/cogl/driver/nop/cogl-driver-nop.c b/cogl/cogl/driver/nop/cogl-driver-nop.c index 4f2b3d17d..c71c82fa2 100644 --- a/cogl/cogl/driver/nop/cogl-driver-nop.c +++ b/cogl/cogl/driver/nop/cogl-driver-nop.c @@ -93,7 +93,6 @@ _cogl_driver_nop = _cogl_driver_nop_context_deinit, _cogl_driver_nop_is_hardware_accelerated, NULL, /* get_graphics_reset_status */ - NULL, /* pixel_format_from_gl_internal */ NULL, /* pixel_format_to_gl */ NULL, /* read_pixels_format_supported */ _cogl_driver_update_features,