1
0
Fork 0

cogl: Rename COGL_PIXEL_FORMAT_G_8 with COGL_PIXEL_FORMAT_R_8

Mechanical rename. The format already describes the first (r/x)
component.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3276>
This commit is contained in:
Sebastian Wick 2023-09-13 16:47:00 +02:00 committed by Marge Bot
parent 59c77da838
commit 764d5dd67b
12 changed files with 21 additions and 21 deletions

View file

@ -330,7 +330,7 @@ _cogl_bitmap_needs_short_temp_buffer (CoglPixelFormat format)
case COGL_PIXEL_FORMAT_RGB_565:
case COGL_PIXEL_FORMAT_RGBA_4444:
case COGL_PIXEL_FORMAT_RGBA_5551:
case COGL_PIXEL_FORMAT_G_8:
case COGL_PIXEL_FORMAT_R_8:
case COGL_PIXEL_FORMAT_RGB_888:
case COGL_PIXEL_FORMAT_BGR_888:
case COGL_PIXEL_FORMAT_RGBX_8888:

View file

@ -65,7 +65,7 @@ G_PASTE (_cogl_unpack_a_8_, component_size) (const uint8_t *src,
}
inline static void
G_PASTE (_cogl_unpack_g_8_, component_size) (const uint8_t *src,
G_PASTE (_cogl_unpack_r_8_, component_size) (const uint8_t *src,
component_type *dst,
int width)
{
@ -449,8 +449,8 @@ G_PASTE (_cogl_unpack_, component_size) (CoglPixelFormat format,
case COGL_PIXEL_FORMAT_A_8:
G_PASTE (_cogl_unpack_a_8_, component_size) (src, dst, width);
break;
case COGL_PIXEL_FORMAT_G_8:
G_PASTE (_cogl_unpack_g_8_, component_size) (src, dst, width);
case COGL_PIXEL_FORMAT_R_8:
G_PASTE (_cogl_unpack_r_8_, component_size) (src, dst, width);
break;
case COGL_PIXEL_FORMAT_RG_88:
G_PASTE (_cogl_unpack_rg_88_, component_size) (src, dst, width);
@ -575,7 +575,7 @@ G_PASTE (_cogl_pack_a_8_, component_size) (const component_type *src,
}
inline static void
G_PASTE (_cogl_pack_g_8_, component_size) (const component_type *src,
G_PASTE (_cogl_pack_r_8_, component_size) (const component_type *src,
uint8_t *dst,
int width)
{
@ -952,8 +952,8 @@ G_PASTE (_cogl_pack_, component_size) (CoglPixelFormat format,
case COGL_PIXEL_FORMAT_A_8:
G_PASTE (_cogl_pack_a_8_, component_size) (src, dst, width);
break;
case COGL_PIXEL_FORMAT_G_8:
G_PASTE (_cogl_pack_g_8_, component_size) (src, dst, width);
case COGL_PIXEL_FORMAT_R_8:
G_PASTE (_cogl_pack_r_8_, component_size) (src, dst, width);
break;
case COGL_PIXEL_FORMAT_RG_88:
G_PASTE (_cogl_pack_rg_88_, component_size) (src, dst, width);

View file

@ -92,8 +92,8 @@ static const CoglPixelFormatInfo format_info_table[] = {
.bpp = { 0 },
},
{
.cogl_format = COGL_PIXEL_FORMAT_G_8,
.format_str = "G_8",
.cogl_format = COGL_PIXEL_FORMAT_R_8,
.format_str = "R_8",
.n_planes = 1,
.aligned = 1,
.bpp = { 1 },

View file

@ -95,7 +95,7 @@ G_BEGIN_DECLS
* The mapping is the following (see discussion on bug #660188):
*
* 0 = undefined
* 1, 8 = 1 bpp (e.g. A_8, G_8)
* 1, 8 = 1 bpp (e.g. A_8, R_8)
* 2 = 3 bpp, aligned (e.g. 888)
* 3 = 4 bpp, aligned (e.g. 8888)
* 4-6 = 2 bpp, not aligned (e.g. 565, 4444, 5551)
@ -148,7 +148,7 @@ G_BEGIN_DECLS
* @COGL_PIXEL_FORMAT_RGBA_4444: RGBA, 16 bits
* @COGL_PIXEL_FORMAT_RGBA_5551: RGBA, 16 bits
* @COGL_PIXEL_FORMAT_YUV: Not currently supported
* @COGL_PIXEL_FORMAT_G_8: Single luminance component
* @COGL_PIXEL_FORMAT_R_8: Single luminance component
* @COGL_PIXEL_FORMAT_G_16: Single luminance component, 16 bits
* @COGL_PIXEL_FORMAT_RGB_888: RGB, 24 bits
* @COGL_PIXEL_FORMAT_BGR_888: BGR, 24 bits
@ -215,7 +215,7 @@ typedef enum /*< prefix=COGL_PIXEL_FORMAT >*/
COGL_PIXEL_FORMAT_RGBA_4444 = 5 | COGL_A_BIT,
COGL_PIXEL_FORMAT_RGBA_5551 = 6 | COGL_A_BIT,
COGL_PIXEL_FORMAT_YUV = 7,
COGL_PIXEL_FORMAT_G_8 = 8,
COGL_PIXEL_FORMAT_R_8 = 8,
COGL_PIXEL_FORMAT_G_16 = 14,
COGL_PIXEL_FORMAT_RG_88 = 9,

View file

@ -91,7 +91,7 @@ _cogl_driver_pixel_format_to_gl (CoglContext *context,
glformat = GL_RED;
gltype = GL_UNSIGNED_BYTE;
break;
case COGL_PIXEL_FORMAT_G_8:
case COGL_PIXEL_FORMAT_R_8:
glintformat = GL_LUMINANCE;
glformat = GL_LUMINANCE;
gltype = GL_UNSIGNED_BYTE;

View file

@ -395,7 +395,7 @@ _cogl_texture_driver_upload_supported (CoglContext *ctx,
switch (format)
{
case COGL_PIXEL_FORMAT_A_8:
case COGL_PIXEL_FORMAT_G_8:
case COGL_PIXEL_FORMAT_R_8:
case COGL_PIXEL_FORMAT_RG_88:
case COGL_PIXEL_FORMAT_BGRX_8888:
case COGL_PIXEL_FORMAT_BGRA_8888:

View file

@ -85,7 +85,7 @@ _cogl_driver_pixel_format_to_gl (CoglContext *context,
glformat = GL_ALPHA;
gltype = GL_UNSIGNED_BYTE;
break;
case COGL_PIXEL_FORMAT_G_8:
case COGL_PIXEL_FORMAT_R_8:
glintformat = GL_LUMINANCE;
glformat = GL_LUMINANCE;
gltype = GL_UNSIGNED_BYTE;

View file

@ -445,7 +445,7 @@ _cogl_texture_driver_upload_supported (CoglContext *ctx,
switch (format)
{
case COGL_PIXEL_FORMAT_A_8:
case COGL_PIXEL_FORMAT_G_8:
case COGL_PIXEL_FORMAT_R_8:
case COGL_PIXEL_FORMAT_RG_88:
case COGL_PIXEL_FORMAT_BGRX_8888:
case COGL_PIXEL_FORMAT_BGRA_8888:

View file

@ -39,7 +39,7 @@ typedef struct _CoglDrmFormatMap
static const CoglDrmFormatMap meta_cogl_drm_format_map[] = {
/* DRM formats are defined as little-endian, not machine endian. */
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
{ DRM_FORMAT_R8, COGL_PIXEL_FORMAT_G_8, META_MULTI_TEXTURE_FORMAT_INVALID },
{ DRM_FORMAT_R8, COGL_PIXEL_FORMAT_R_8, META_MULTI_TEXTURE_FORMAT_INVALID },
{ DRM_FORMAT_R16, COGL_PIXEL_FORMAT_G_16, META_MULTI_TEXTURE_FORMAT_INVALID },
{ DRM_FORMAT_GR88, COGL_PIXEL_FORMAT_RG_88, META_MULTI_TEXTURE_FORMAT_INVALID },
{ DRM_FORMAT_GR1616, COGL_PIXEL_FORMAT_RG_1616, META_MULTI_TEXTURE_FORMAT_INVALID },

View file

@ -128,7 +128,7 @@ static MetaMultiTextureFormatInfo multi_format_table[] = {
[META_MULTI_TEXTURE_FORMAT_NV12] = {
.name = "NV12",
.n_planes = 2,
.subformats = { COGL_PIXEL_FORMAT_G_8, COGL_PIXEL_FORMAT_RG_88 },
.subformats = { COGL_PIXEL_FORMAT_R_8, COGL_PIXEL_FORMAT_RG_88 },
.plane_indices = { 0, 1 },
.hsub = { 1, 2 },
.vsub = { 1, 2 },
@ -149,7 +149,7 @@ static MetaMultiTextureFormatInfo multi_format_table[] = {
[META_MULTI_TEXTURE_FORMAT_YUV420] = {
.name = "YUV420",
.n_planes = 3,
.subformats = { COGL_PIXEL_FORMAT_G_8, COGL_PIXEL_FORMAT_G_8, COGL_PIXEL_FORMAT_G_8 },
.subformats = { COGL_PIXEL_FORMAT_R_8, COGL_PIXEL_FORMAT_R_8, COGL_PIXEL_FORMAT_R_8 },
.plane_indices = { 0, 1, 2 },
.hsub = { 1, 2, 2 },
.vsub = { 1, 2, 2 },

View file

@ -176,7 +176,7 @@ test_read_texture_formats (void)
/* I'm not sure what's the right value to put here because Nvidia
and Mesa seem to behave differently so one of them must be
wrong. */
test_read_byte (tex_2d, COGL_PIXEL_FORMAT_G_8, 0x9c);
test_read_byte (tex_2d, COGL_PIXEL_FORMAT_R_8, 0x9c);
#endif
/* We should always be able to read into an RG buffer regardless of

View file

@ -138,7 +138,7 @@ test_write_texture_formats (void)
/* I'm not sure what's the right value to put here because Nvidia
and Mesa seem to behave differently so one of them must be
wrong. */
test_write_byte (test_ctx, COGL_PIXEL_FORMAT_G_8, 0x34, 0x340000ff);
test_write_byte (test_ctx, COGL_PIXEL_FORMAT_R_8, 0x34, 0x340000ff);
#endif
/* We should always be able to read from an RG buffer regardless of