Rename SDL_PIXELFORMAT_RGB888 and SDL_PIXELFORMAT_BGR888 to SDL_PIXELFORMAT_XRGB8888 and SDL_PIXELFORMAT_XBGR8888 for clarity

Fixes https://github.com/libsdl-org/SDL/issues/7903
This commit is contained in:
Sam Lantinga 2023-07-01 14:01:14 -07:00
parent d85e327c92
commit e264bb5178
39 changed files with 400 additions and 390 deletions

View File

@ -599,12 +599,12 @@ expression e1, e2, e3, e4, e5, e6, e7, e8, e9;
|
- SDL_CreateRGBSurface(e1, e2, e3, 32, 0x00FF0000, 0x0000FF00, 0x000000FF, 0x00000000)
+ SDL_CreateSurface(e2, e3, SDL_PIXELFORMAT_RGB888)
+ SDL_CreateSurface(e2, e3, SDL_PIXELFORMAT_XRGB8888)
|
- SDL_CreateRGBSurfaceFrom(e1, e2, e3, 32, e4, 0x00FF0000, 0x0000FF00, 0x000000FF, 0x00000000)
+ SDL_CreateSurfaceFrom(e1, e2, e3, e4, SDL_PIXELFORMAT_RGB888)
+ SDL_CreateSurfaceFrom(e1, e2, e3, e4, SDL_PIXELFORMAT_XRGB8888)
|
@ -619,12 +619,12 @@ expression e1, e2, e3, e4, e5, e6, e7, e8, e9;
|
- SDL_CreateRGBSurface(e1, e2, e3, 32, 0x000000FF, 0x0000FF00, 0x00FF0000, 0x00000000)
+ SDL_CreateSurface(e2, e3, SDL_PIXELFORMAT_BGR888)
+ SDL_CreateSurface(e2, e3, SDL_PIXELFORMAT_XBGR8888)
|
- SDL_CreateRGBSurfaceFrom(e1, e2, e3, 32, e4, 0x000000FF, 0x0000FF00, 0x00FF0000, 0x00000000)
+ SDL_CreateSurfaceFrom(e1, e2, e3, e4, SDL_PIXELFORMAT_BGR888)
+ SDL_CreateSurfaceFrom(e1, e2, e3, e4, SDL_PIXELFORMAT_XBGR8888)
|
@ -2677,3 +2677,11 @@ typedef SDL_cond, SDL_Condition;
@@
- SDL_WINDOW_SKIP_TASKBAR
+ SDL_WINDOW_UTILITY
@@
@@
- SDL_PIXELFORMAT_RGB888
+ SDL_PIXELFORMAT_XRGB8888
@@
@@
- SDL_PIXELFORMAT_BGR888
+ SDL_PIXELFORMAT_XBGR8888

View File

@ -215,7 +215,7 @@ Windows:
Full-size, single window applications only. You cannot create multi-window SDL applications for iPhone OS. The application window will fill the display, though you have the option of turning on or off the menu-bar (pass SDL_CreateWindow() the flag SDL_WINDOW_BORDERLESS).
Textures:
The optimal texture formats on iOS are SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, and SDL_PIXELFORMAT_RGB24 pixel formats.
The optimal texture formats on iOS are SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_XBGR8888, and SDL_PIXELFORMAT_RGB24 pixel formats.
Loading Shared Objects:
This is disabled by default since it seems to break the terms of the iOS SDK agreement for iOS versions prior to iOS 8. It can be re-enabled in SDL_config_ios.h.

View File

@ -352,6 +352,8 @@
#define SDL_FreeFormat SDL_DestroyPixelFormat
#define SDL_FreePalette SDL_DestroyPalette
#define SDL_MasksToPixelFormatEnum SDL_GetPixelFormatEnumForMasks
#define SDL_PIXELFORMAT_BGR888 SDL_PIXELFORMAT_XBGR8888
#define SDL_PIXELFORMAT_RGB888 SDL_PIXELFORMAT_XRGB8888
#define SDL_PixelFormatEnumToMasks SDL_GetMasksForPixelFormatEnum
/* ##SDL_platform.h */
@ -790,6 +792,8 @@
#define SDL_FreeFormat SDL_FreeFormat_renamed_SDL_DestroyPixelFormat
#define SDL_FreePalette SDL_FreePalette_renamed_SDL_DestroyPalette
#define SDL_MasksToPixelFormatEnum SDL_MasksToPixelFormatEnum_renamed_SDL_GetPixelFormatEnumForMasks
#define SDL_PIXELFORMAT_BGR888 SDL_PIXELFORMAT_BGR888_renamed_SDL_PIXELFORMAT_XBGR8888
#define SDL_PIXELFORMAT_RGB888 SDL_PIXELFORMAT_RGB888_renamed_SDL_PIXELFORMAT_XRGB8888
#define SDL_PixelFormatEnumToMasks SDL_PixelFormatEnumToMasks_renamed_SDL_GetMasksForPixelFormatEnum
/* ##SDL_platform.h */

View File

@ -232,14 +232,12 @@ typedef enum
SDL_PIXELFORMAT_XRGB8888 =
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XRGB,
SDL_PACKEDLAYOUT_8888, 24, 4),
SDL_PIXELFORMAT_RGB888 = SDL_PIXELFORMAT_XRGB8888,
SDL_PIXELFORMAT_RGBX8888 =
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBX,
SDL_PACKEDLAYOUT_8888, 24, 4),
SDL_PIXELFORMAT_XBGR8888 =
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XBGR,
SDL_PACKEDLAYOUT_8888, 24, 4),
SDL_PIXELFORMAT_BGR888 = SDL_PIXELFORMAT_XBGR8888,
SDL_PIXELFORMAT_BGRX8888 =
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRX,
SDL_PACKEDLAYOUT_8888, 24, 4),

View File

@ -1258,14 +1258,14 @@ SDL_Texture *SDL_CreateTextureFromSurface(SDL_Renderer *renderer, SDL_Surface *s
/* Try to have the best pixel format for the texture */
/* No alpha, but a colorkey => promote to alpha */
if (!fmt->Amask && SDL_SurfaceHasColorKey(surface)) {
if (fmt->format == SDL_PIXELFORMAT_RGB888) {
if (fmt->format == SDL_PIXELFORMAT_XRGB8888) {
for (i = 0; i < (int)renderer->info.num_texture_formats; ++i) {
if (renderer->info.texture_formats[i] == SDL_PIXELFORMAT_ARGB8888) {
format = SDL_PIXELFORMAT_ARGB8888;
break;
}
}
} else if (fmt->format == SDL_PIXELFORMAT_BGR888) {
} else if (fmt->format == SDL_PIXELFORMAT_XBGR8888) {
for (i = 0; i < (int)renderer->info.num_texture_formats; ++i) {
if (renderer->info.texture_formats[i] == SDL_PIXELFORMAT_ABGR8888) {
format = SDL_PIXELFORMAT_ABGR8888;

View File

@ -193,7 +193,7 @@ static D3DFORMAT PixelFormatToD3DFMT(Uint32 format)
switch (format) {
case SDL_PIXELFORMAT_RGB565:
return D3DFMT_R5G6B5;
case SDL_PIXELFORMAT_RGB888:
case SDL_PIXELFORMAT_XRGB8888:
return D3DFMT_X8R8G8B8;
case SDL_PIXELFORMAT_ARGB8888:
return D3DFMT_A8R8G8B8;
@ -213,7 +213,7 @@ static Uint32 D3DFMTToPixelFormat(D3DFORMAT format)
case D3DFMT_R5G6B5:
return SDL_PIXELFORMAT_RGB565;
case D3DFMT_X8R8G8B8:
return SDL_PIXELFORMAT_RGB888;
return SDL_PIXELFORMAT_XRGB8888;
case D3DFMT_A8R8G8B8:
return SDL_PIXELFORMAT_ARGB8888;
default:

View File

@ -202,7 +202,7 @@ Uint32 D3D11_DXGIFormatToSDLPixelFormat(DXGI_FORMAT dxgiFormat)
case DXGI_FORMAT_B8G8R8A8_UNORM:
return SDL_PIXELFORMAT_ARGB8888;
case DXGI_FORMAT_B8G8R8X8_UNORM:
return SDL_PIXELFORMAT_RGB888;
return SDL_PIXELFORMAT_XRGB8888;
default:
return SDL_PIXELFORMAT_UNKNOWN;
}
@ -213,7 +213,7 @@ static DXGI_FORMAT SDLPixelFormatToDXGIFormat(Uint32 sdlFormat)
switch (sdlFormat) {
case SDL_PIXELFORMAT_ARGB8888:
return DXGI_FORMAT_B8G8R8A8_UNORM;
case SDL_PIXELFORMAT_RGB888:
case SDL_PIXELFORMAT_XRGB8888:
return DXGI_FORMAT_B8G8R8X8_UNORM;
case SDL_PIXELFORMAT_YV12:
case SDL_PIXELFORMAT_IYUV:
@ -2386,7 +2386,7 @@ SDL_RenderDriver D3D11_RenderDriver = {
6, /* num_texture_formats */
{ /* texture_formats */
SDL_PIXELFORMAT_ARGB8888,
SDL_PIXELFORMAT_RGB888,
SDL_PIXELFORMAT_XRGB8888,
SDL_PIXELFORMAT_YV12,
SDL_PIXELFORMAT_IYUV,
SDL_PIXELFORMAT_NV12,

View File

@ -278,7 +278,7 @@ Uint32 D3D12_DXGIFormatToSDLPixelFormat(DXGI_FORMAT dxgiFormat)
case DXGI_FORMAT_B8G8R8A8_UNORM:
return SDL_PIXELFORMAT_ARGB8888;
case DXGI_FORMAT_B8G8R8X8_UNORM:
return SDL_PIXELFORMAT_RGB888;
return SDL_PIXELFORMAT_XRGB8888;
default:
return SDL_PIXELFORMAT_UNKNOWN;
}
@ -289,7 +289,7 @@ static DXGI_FORMAT SDLPixelFormatToDXGIFormat(Uint32 sdlFormat)
switch (sdlFormat) {
case SDL_PIXELFORMAT_ARGB8888:
return DXGI_FORMAT_B8G8R8A8_UNORM;
case SDL_PIXELFORMAT_RGB888:
case SDL_PIXELFORMAT_XRGB8888:
return DXGI_FORMAT_B8G8R8X8_UNORM;
case SDL_PIXELFORMAT_YV12:
case SDL_PIXELFORMAT_IYUV:
@ -3021,7 +3021,7 @@ SDL_RenderDriver D3D12_RenderDriver = {
6, /* num_texture_formats */
{ /* texture_formats */
SDL_PIXELFORMAT_ARGB8888,
SDL_PIXELFORMAT_RGB888,
SDL_PIXELFORMAT_XRGB8888,
SDL_PIXELFORMAT_YV12,
SDL_PIXELFORMAT_IYUV,
SDL_PIXELFORMAT_NV12,

View File

@ -402,13 +402,13 @@ static SDL_bool convert_format(GL_RenderData *renderdata, Uint32 pixel_format,
{
switch (pixel_format) {
case SDL_PIXELFORMAT_ARGB8888:
case SDL_PIXELFORMAT_RGB888:
case SDL_PIXELFORMAT_XRGB8888:
*internalFormat = GL_RGBA8;
*format = GL_BGRA;
*type = GL_UNSIGNED_INT_8_8_8_8_REV;
break;
case SDL_PIXELFORMAT_ABGR8888:
case SDL_PIXELFORMAT_BGR888:
case SDL_PIXELFORMAT_XBGR8888:
*internalFormat = GL_RGBA8;
*format = GL_RGBA;
*type = GL_UNSIGNED_INT_8_8_8_8_REV;
@ -1971,8 +1971,8 @@ SDL_RenderDriver GL_RenderDriver = {
4,
{ SDL_PIXELFORMAT_ARGB8888,
SDL_PIXELFORMAT_ABGR8888,
SDL_PIXELFORMAT_RGB888,
SDL_PIXELFORMAT_BGR888 },
SDL_PIXELFORMAT_XRGB8888,
SDL_PIXELFORMAT_XBGR8888 },
0,
0 }
};

View File

@ -727,7 +727,7 @@ static int GLES2_QueueSetViewport(SDL_Renderer *renderer, SDL_RenderCommand *cmd
static int GLES2_QueueDrawPoints(SDL_Renderer *renderer, SDL_RenderCommand *cmd, const SDL_FPoint *points, int count)
{
const SDL_bool colorswap = (renderer->target && (renderer->target->format == SDL_PIXELFORMAT_ARGB8888 || renderer->target->format == SDL_PIXELFORMAT_RGB888));
const SDL_bool colorswap = (renderer->target && (renderer->target->format == SDL_PIXELFORMAT_ARGB8888 || renderer->target->format == SDL_PIXELFORMAT_XRGB8888));
SDL_VertexSolid *verts = (SDL_VertexSolid *)SDL_AllocateRenderVertices(renderer, count * sizeof(*verts), 0, &cmd->data.draw.first);
int i;
SDL_Color color;
@ -759,7 +759,7 @@ static int GLES2_QueueDrawPoints(SDL_Renderer *renderer, SDL_RenderCommand *cmd,
static int GLES2_QueueDrawLines(SDL_Renderer *renderer, SDL_RenderCommand *cmd, const SDL_FPoint *points, int count)
{
const SDL_bool colorswap = (renderer->target && (renderer->target->format == SDL_PIXELFORMAT_ARGB8888 || renderer->target->format == SDL_PIXELFORMAT_RGB888));
const SDL_bool colorswap = (renderer->target && (renderer->target->format == SDL_PIXELFORMAT_ARGB8888 || renderer->target->format == SDL_PIXELFORMAT_XRGB8888));
int i;
GLfloat prevx, prevy;
SDL_VertexSolid *verts = (SDL_VertexSolid *)SDL_AllocateRenderVertices(renderer, count * sizeof(*verts), 0, &cmd->data.draw.first);
@ -819,7 +819,7 @@ static int GLES2_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, S
float scale_x, float scale_y)
{
int i;
const SDL_bool colorswap = (renderer->target && (renderer->target->format == SDL_PIXELFORMAT_ARGB8888 || renderer->target->format == SDL_PIXELFORMAT_RGB888));
const SDL_bool colorswap = (renderer->target && (renderer->target->format == SDL_PIXELFORMAT_ARGB8888 || renderer->target->format == SDL_PIXELFORMAT_XRGB8888));
int count = indices ? num_indices : num_vertices;
cmd->data.draw.count = count;
@ -1020,10 +1020,10 @@ static int SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, vo
case SDL_PIXELFORMAT_ARGB8888:
switch (renderer->target->format) {
case SDL_PIXELFORMAT_ABGR8888:
case SDL_PIXELFORMAT_BGR888:
case SDL_PIXELFORMAT_XBGR8888:
sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB;
break;
case SDL_PIXELFORMAT_RGB888:
case SDL_PIXELFORMAT_XRGB8888:
sourceType = GLES2_IMAGESOURCE_TEXTURE_ABGR;
break;
}
@ -1031,15 +1031,15 @@ static int SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, vo
case SDL_PIXELFORMAT_ABGR8888:
switch (renderer->target->format) {
case SDL_PIXELFORMAT_ARGB8888:
case SDL_PIXELFORMAT_RGB888:
case SDL_PIXELFORMAT_XRGB8888:
sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB;
break;
case SDL_PIXELFORMAT_BGR888:
case SDL_PIXELFORMAT_XBGR8888:
sourceType = GLES2_IMAGESOURCE_TEXTURE_ABGR;
break;
}
break;
case SDL_PIXELFORMAT_RGB888:
case SDL_PIXELFORMAT_XRGB8888:
switch (renderer->target->format) {
case SDL_PIXELFORMAT_ABGR8888:
sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB;
@ -1047,12 +1047,12 @@ static int SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, vo
case SDL_PIXELFORMAT_ARGB8888:
sourceType = GLES2_IMAGESOURCE_TEXTURE_BGR;
break;
case SDL_PIXELFORMAT_BGR888:
case SDL_PIXELFORMAT_XBGR8888:
sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB;
break;
}
break;
case SDL_PIXELFORMAT_BGR888:
case SDL_PIXELFORMAT_XBGR8888:
switch (renderer->target->format) {
case SDL_PIXELFORMAT_ABGR8888:
sourceType = GLES2_IMAGESOURCE_TEXTURE_BGR;
@ -1060,7 +1060,7 @@ static int SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, vo
case SDL_PIXELFORMAT_ARGB8888:
sourceType = GLES2_IMAGESOURCE_TEXTURE_RGB;
break;
case SDL_PIXELFORMAT_RGB888:
case SDL_PIXELFORMAT_XRGB8888:
sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB;
break;
}
@ -1094,10 +1094,10 @@ static int SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, vo
case SDL_PIXELFORMAT_ABGR8888:
sourceType = GLES2_IMAGESOURCE_TEXTURE_ABGR;
break;
case SDL_PIXELFORMAT_RGB888:
case SDL_PIXELFORMAT_XRGB8888:
sourceType = GLES2_IMAGESOURCE_TEXTURE_RGB;
break;
case SDL_PIXELFORMAT_BGR888:
case SDL_PIXELFORMAT_XBGR8888:
sourceType = GLES2_IMAGESOURCE_TEXTURE_BGR;
break;
#if SDL_HAVE_YUV
@ -1150,7 +1150,7 @@ static int SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, vo
static int GLES2_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize)
{
GLES2_RenderData *data = (GLES2_RenderData *)renderer->driverdata;
const SDL_bool colorswap = (renderer->target && (renderer->target->format == SDL_PIXELFORMAT_ARGB8888 || renderer->target->format == SDL_PIXELFORMAT_RGB888));
const SDL_bool colorswap = (renderer->target && (renderer->target->format == SDL_PIXELFORMAT_ARGB8888 || renderer->target->format == SDL_PIXELFORMAT_XRGB8888));
#if USE_VERTEX_BUFFER_OBJECTS
const int vboidx = data->current_vertex_buffer;
@ -1412,8 +1412,8 @@ static int GLES2_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture)
switch (texture->format) {
case SDL_PIXELFORMAT_ARGB8888:
case SDL_PIXELFORMAT_ABGR8888:
case SDL_PIXELFORMAT_RGB888:
case SDL_PIXELFORMAT_BGR888:
case SDL_PIXELFORMAT_XRGB8888:
case SDL_PIXELFORMAT_XBGR8888:
format = GL_RGBA;
type = GL_UNSIGNED_BYTE;
break;
@ -2266,8 +2266,8 @@ SDL_RenderDriver GLES2_RenderDriver = {
4,
{ SDL_PIXELFORMAT_ARGB8888,
SDL_PIXELFORMAT_ABGR8888,
SDL_PIXELFORMAT_RGB888,
SDL_PIXELFORMAT_BGR888 },
SDL_PIXELFORMAT_XRGB8888,
SDL_PIXELFORMAT_XBGR8888 },
0,
0 }
};

View File

@ -75,26 +75,26 @@ static int SDL_BlendFillRect_RGB565(SDL_Surface *dst, const SDL_Rect *rect,
return 0;
}
static int SDL_BlendFillRect_RGB888(SDL_Surface *dst, const SDL_Rect *rect,
static int SDL_BlendFillRect_XRGB8888(SDL_Surface *dst, const SDL_Rect *rect,
SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
{
unsigned inva = 0xff - a;
switch (blendMode) {
case SDL_BLENDMODE_BLEND:
FILLRECT(Uint32, DRAW_SETPIXEL_BLEND_RGB888);
FILLRECT(Uint32, DRAW_SETPIXEL_BLEND_XRGB8888);
break;
case SDL_BLENDMODE_ADD:
FILLRECT(Uint32, DRAW_SETPIXEL_ADD_RGB888);
FILLRECT(Uint32, DRAW_SETPIXEL_ADD_XRGB8888);
break;
case SDL_BLENDMODE_MOD:
FILLRECT(Uint32, DRAW_SETPIXEL_MOD_RGB888);
FILLRECT(Uint32, DRAW_SETPIXEL_MOD_XRGB8888);
break;
case SDL_BLENDMODE_MUL:
FILLRECT(Uint32, DRAW_SETPIXEL_MUL_RGB888);
FILLRECT(Uint32, DRAW_SETPIXEL_MUL_XRGB8888);
break;
default:
FILLRECT(Uint32, DRAW_SETPIXEL_RGB888);
FILLRECT(Uint32, DRAW_SETPIXEL_XRGB8888);
break;
}
return 0;
@ -254,7 +254,7 @@ int SDL_BlendFillRect(SDL_Surface *dst, const SDL_Rect *rect,
switch (dst->format->Rmask) {
case 0x00FF0000:
if (!dst->format->Amask) {
return SDL_BlendFillRect_RGB888(dst, rect, blendMode, r, g, b, a);
return SDL_BlendFillRect_XRGB8888(dst, rect, blendMode, r, g, b, a);
} else {
return SDL_BlendFillRect_ARGB8888(dst, rect, blendMode, r, g, b, a);
}
@ -314,7 +314,7 @@ int SDL_BlendFillRects(SDL_Surface *dst, const SDL_Rect *rects, int count,
switch (dst->format->Rmask) {
case 0x00FF0000:
if (!dst->format->Amask) {
func = SDL_BlendFillRect_RGB888;
func = SDL_BlendFillRect_XRGB8888;
} else {
func = SDL_BlendFillRect_ARGB8888;
}

View File

@ -549,7 +549,7 @@ static void SDL_BlendLine_RGBA4(SDL_Surface *dst, int x1, int y1, int x2, int y2
}
}
static void SDL_BlendLine_RGB888(SDL_Surface *dst, int x1, int y1, int x2, int y2,
static void SDL_BlendLine_XRGB8888(SDL_Surface *dst, int x1, int y1, int x2, int y2,
SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a,
SDL_bool draw_end)
{
@ -571,82 +571,82 @@ static void SDL_BlendLine_RGB888(SDL_Surface *dst, int x1, int y1, int x2, int y
if (y1 == y2) {
switch (blendMode) {
case SDL_BLENDMODE_BLEND:
HLINE(Uint32, DRAW_SETPIXEL_BLEND_RGB888, draw_end);
HLINE(Uint32, DRAW_SETPIXEL_BLEND_XRGB8888, draw_end);
break;
case SDL_BLENDMODE_ADD:
HLINE(Uint32, DRAW_SETPIXEL_ADD_RGB888, draw_end);
HLINE(Uint32, DRAW_SETPIXEL_ADD_XRGB8888, draw_end);
break;
case SDL_BLENDMODE_MOD:
HLINE(Uint32, DRAW_SETPIXEL_MOD_RGB888, draw_end);
HLINE(Uint32, DRAW_SETPIXEL_MOD_XRGB8888, draw_end);
break;
case SDL_BLENDMODE_MUL:
HLINE(Uint32, DRAW_SETPIXEL_MUL_RGB888, draw_end);
HLINE(Uint32, DRAW_SETPIXEL_MUL_XRGB8888, draw_end);
break;
default:
HLINE(Uint32, DRAW_SETPIXEL_RGB888, draw_end);
HLINE(Uint32, DRAW_SETPIXEL_XRGB8888, draw_end);
break;
}
} else if (x1 == x2) {
switch (blendMode) {
case SDL_BLENDMODE_BLEND:
VLINE(Uint32, DRAW_SETPIXEL_BLEND_RGB888, draw_end);
VLINE(Uint32, DRAW_SETPIXEL_BLEND_XRGB8888, draw_end);
break;
case SDL_BLENDMODE_ADD:
VLINE(Uint32, DRAW_SETPIXEL_ADD_RGB888, draw_end);
VLINE(Uint32, DRAW_SETPIXEL_ADD_XRGB8888, draw_end);
break;
case SDL_BLENDMODE_MOD:
VLINE(Uint32, DRAW_SETPIXEL_MOD_RGB888, draw_end);
VLINE(Uint32, DRAW_SETPIXEL_MOD_XRGB8888, draw_end);
break;
case SDL_BLENDMODE_MUL:
VLINE(Uint32, DRAW_SETPIXEL_MUL_RGB888, draw_end);
VLINE(Uint32, DRAW_SETPIXEL_MUL_XRGB8888, draw_end);
break;
default:
VLINE(Uint32, DRAW_SETPIXEL_RGB888, draw_end);
VLINE(Uint32, DRAW_SETPIXEL_XRGB8888, draw_end);
break;
}
} else if (ABS(x1 - x2) == ABS(y1 - y2)) {
switch (blendMode) {
case SDL_BLENDMODE_BLEND:
DLINE(Uint32, DRAW_SETPIXEL_BLEND_RGB888, draw_end);
DLINE(Uint32, DRAW_SETPIXEL_BLEND_XRGB8888, draw_end);
break;
case SDL_BLENDMODE_ADD:
DLINE(Uint32, DRAW_SETPIXEL_ADD_RGB888, draw_end);
DLINE(Uint32, DRAW_SETPIXEL_ADD_XRGB8888, draw_end);
break;
case SDL_BLENDMODE_MOD:
DLINE(Uint32, DRAW_SETPIXEL_MOD_RGB888, draw_end);
DLINE(Uint32, DRAW_SETPIXEL_MOD_XRGB8888, draw_end);
break;
case SDL_BLENDMODE_MUL:
DLINE(Uint32, DRAW_SETPIXEL_MUL_RGB888, draw_end);
DLINE(Uint32, DRAW_SETPIXEL_MUL_XRGB8888, draw_end);
break;
default:
DLINE(Uint32, DRAW_SETPIXEL_RGB888, draw_end);
DLINE(Uint32, DRAW_SETPIXEL_XRGB8888, draw_end);
break;
}
} else {
switch (blendMode) {
case SDL_BLENDMODE_BLEND:
AALINE(x1, y1, x2, y2,
DRAW_SETPIXELXY_BLEND_RGB888, DRAW_SETPIXELXY_BLEND_RGB888,
DRAW_SETPIXELXY_BLEND_XRGB8888, DRAW_SETPIXELXY_BLEND_XRGB8888,
draw_end);
break;
case SDL_BLENDMODE_ADD:
AALINE(x1, y1, x2, y2,
DRAW_SETPIXELXY_ADD_RGB888, DRAW_SETPIXELXY_ADD_RGB888,
DRAW_SETPIXELXY_ADD_XRGB8888, DRAW_SETPIXELXY_ADD_XRGB8888,
draw_end);
break;
case SDL_BLENDMODE_MOD:
AALINE(x1, y1, x2, y2,
DRAW_SETPIXELXY_MOD_RGB888, DRAW_SETPIXELXY_MOD_RGB888,
DRAW_SETPIXELXY_MOD_XRGB8888, DRAW_SETPIXELXY_MOD_XRGB8888,
draw_end);
break;
case SDL_BLENDMODE_MUL:
AALINE(x1, y1, x2, y2,
DRAW_SETPIXELXY_MUL_RGB888, DRAW_SETPIXELXY_MUL_RGB888,
DRAW_SETPIXELXY_MUL_XRGB8888, DRAW_SETPIXELXY_MUL_XRGB8888,
draw_end);
break;
default:
AALINE(x1, y1, x2, y2,
DRAW_SETPIXELXY_RGB888, DRAW_SETPIXELXY_BLEND_RGB888,
DRAW_SETPIXELXY_XRGB8888, DRAW_SETPIXELXY_BLEND_XRGB8888,
draw_end);
break;
}
@ -780,7 +780,7 @@ static BlendLineFunc SDL_CalculateBlendLineFunc(const SDL_PixelFormat *fmt)
if (fmt->Amask) {
return SDL_BlendLine_ARGB8888;
} else {
return SDL_BlendLine_RGB888;
return SDL_BlendLine_XRGB8888;
}
} else {
if (fmt->Amask) {

View File

@ -75,26 +75,26 @@ static int SDL_BlendPoint_RGB565(SDL_Surface *dst, int x, int y, SDL_BlendMode b
return 0;
}
static int SDL_BlendPoint_RGB888(SDL_Surface *dst, int x, int y, SDL_BlendMode blendMode, Uint8 r,
static int SDL_BlendPoint_XRGB8888(SDL_Surface *dst, int x, int y, SDL_BlendMode blendMode, Uint8 r,
Uint8 g, Uint8 b, Uint8 a)
{
unsigned inva = 0xff - a;
switch (blendMode) {
case SDL_BLENDMODE_BLEND:
DRAW_SETPIXELXY_BLEND_RGB888(x, y);
DRAW_SETPIXELXY_BLEND_XRGB8888(x, y);
break;
case SDL_BLENDMODE_ADD:
DRAW_SETPIXELXY_ADD_RGB888(x, y);
DRAW_SETPIXELXY_ADD_XRGB8888(x, y);
break;
case SDL_BLENDMODE_MOD:
DRAW_SETPIXELXY_MOD_RGB888(x, y);
DRAW_SETPIXELXY_MOD_XRGB8888(x, y);
break;
case SDL_BLENDMODE_MUL:
DRAW_SETPIXELXY_MUL_RGB888(x, y);
DRAW_SETPIXELXY_MUL_XRGB8888(x, y);
break;
default:
DRAW_SETPIXELXY_RGB888(x, y);
DRAW_SETPIXELXY_XRGB8888(x, y);
break;
}
return 0;
@ -248,7 +248,7 @@ int SDL_BlendPoint(SDL_Surface *dst, int x, int y, SDL_BlendMode blendMode, Uint
switch (dst->format->Rmask) {
case 0x00FF0000:
if (!dst->format->Amask) {
return SDL_BlendPoint_RGB888(dst, x, y, blendMode, r, g, b, a);
return SDL_BlendPoint_XRGB8888(dst, x, y, blendMode, r, g, b, a);
} else {
return SDL_BlendPoint_ARGB8888(dst, x, y, blendMode, r, g, b, a);
}
@ -312,7 +312,7 @@ int SDL_BlendPoints(SDL_Surface *dst, const SDL_Point *points, int count,
switch (dst->format->Rmask) {
case 0x00FF0000:
if (!dst->format->Amask) {
func = SDL_BlendPoint_RGB888;
func = SDL_BlendPoint_XRGB8888;
} else {
func = SDL_BlendPoint_ARGB8888;
}

View File

@ -191,39 +191,39 @@
* Define draw operators for RGB888
*/
#define DRAW_SETPIXEL_RGB888 \
DRAW_SETPIXEL(RGB888_FROM_RGB(*pixel, sr, sg, sb))
#define DRAW_SETPIXEL_XRGB8888 \
DRAW_SETPIXEL(XRGB8888_FROM_RGB(*pixel, sr, sg, sb))
#define DRAW_SETPIXEL_BLEND_RGB888 \
DRAW_SETPIXEL_BLEND(RGB_FROM_RGB888(*pixel, sr, sg, sb), \
RGB888_FROM_RGB(*pixel, sr, sg, sb))
#define DRAW_SETPIXEL_BLEND_XRGB8888 \
DRAW_SETPIXEL_BLEND(RGB_FROM_XRGB8888(*pixel, sr, sg, sb), \
XRGB8888_FROM_RGB(*pixel, sr, sg, sb))
#define DRAW_SETPIXEL_ADD_RGB888 \
DRAW_SETPIXEL_ADD(RGB_FROM_RGB888(*pixel, sr, sg, sb), \
RGB888_FROM_RGB(*pixel, sr, sg, sb))
#define DRAW_SETPIXEL_ADD_XRGB8888 \
DRAW_SETPIXEL_ADD(RGB_FROM_XRGB8888(*pixel, sr, sg, sb), \
XRGB8888_FROM_RGB(*pixel, sr, sg, sb))
#define DRAW_SETPIXEL_MOD_RGB888 \
DRAW_SETPIXEL_MOD(RGB_FROM_RGB888(*pixel, sr, sg, sb), \
RGB888_FROM_RGB(*pixel, sr, sg, sb))
#define DRAW_SETPIXEL_MOD_XRGB8888 \
DRAW_SETPIXEL_MOD(RGB_FROM_XRGB8888(*pixel, sr, sg, sb), \
XRGB8888_FROM_RGB(*pixel, sr, sg, sb))
#define DRAW_SETPIXEL_MUL_RGB888 \
DRAW_SETPIXEL_MUL(RGB_FROM_RGB888(*pixel, sr, sg, sb), \
RGB888_FROM_RGB(*pixel, sr, sg, sb))
#define DRAW_SETPIXEL_MUL_XRGB8888 \
DRAW_SETPIXEL_MUL(RGB_FROM_XRGB8888(*pixel, sr, sg, sb), \
XRGB8888_FROM_RGB(*pixel, sr, sg, sb))
#define DRAW_SETPIXELXY_RGB888(x, y) \
DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_RGB888)
#define DRAW_SETPIXELXY_XRGB8888(x, y) \
DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_XRGB8888)
#define DRAW_SETPIXELXY_BLEND_RGB888(x, y) \
DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_BLEND_RGB888)
#define DRAW_SETPIXELXY_BLEND_XRGB8888(x, y) \
DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_BLEND_XRGB8888)
#define DRAW_SETPIXELXY_ADD_RGB888(x, y) \
DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_ADD_RGB888)
#define DRAW_SETPIXELXY_ADD_XRGB8888(x, y) \
DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_ADD_XRGB8888)
#define DRAW_SETPIXELXY_MOD_RGB888(x, y) \
DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_MOD_RGB888)
#define DRAW_SETPIXELXY_MOD_XRGB8888(x, y) \
DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_MOD_XRGB8888)
#define DRAW_SETPIXELXY_MUL_RGB888(x, y) \
DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_MUL_RGB888)
#define DRAW_SETPIXELXY_MUL_XRGB8888(x, y) \
DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_MUL_XRGB8888)
/*
* Define draw operators for ARGB8888

View File

@ -98,7 +98,7 @@ static void SDL_DrawLine4(SDL_Surface *dst, int x1, int y1, int x2, int y2, Uint
if (fmt->Rmask == 0x00FF0000) {
if (!fmt->Amask) {
AALINE(x1, y1, x2, y2,
DRAW_FASTSETPIXELXY4, DRAW_SETPIXELXY_BLEND_RGB888,
DRAW_FASTSETPIXELXY4, DRAW_SETPIXELXY_BLEND_XRGB8888,
draw_end);
} else {
AALINE(x1, y1, x2, y2,

View File

@ -124,9 +124,9 @@ static int PixelFormatToVITAFMT(Uint32 format)
switch (format) {
case SDL_PIXELFORMAT_ARGB8888:
return SCE_GXM_TEXTURE_FORMAT_U8U8U8U8_ARGB;
case SDL_PIXELFORMAT_RGB888:
case SDL_PIXELFORMAT_XRGB8888:
return SCE_GXM_TEXTURE_FORMAT_U8U8U8U8_ARGB;
case SDL_PIXELFORMAT_BGR888:
case SDL_PIXELFORMAT_XBGR8888:
return SCE_GXM_TEXTURE_FORMAT_U8U8U8U8_ABGR;
case SDL_PIXELFORMAT_ABGR8888:
return SCE_GXM_TEXTURE_FORMAT_U8U8U8U8_ABGR;

View File

@ -938,11 +938,11 @@ static void SDLTest_PrintPixelFormat(char *text, size_t maxlen, Uint32 format)
case SDL_PIXELFORMAT_BGR24:
SDL_snprintfcat(text, maxlen, "BGR24");
break;
case SDL_PIXELFORMAT_RGB888:
SDL_snprintfcat(text, maxlen, "RGB888");
case SDL_PIXELFORMAT_XRGB8888:
SDL_snprintfcat(text, maxlen, "XRGB8888");
break;
case SDL_PIXELFORMAT_BGR888:
SDL_snprintfcat(text, maxlen, "BGR888");
case SDL_PIXELFORMAT_XBGR8888:
SDL_snprintfcat(text, maxlen, "XBGR8888");
break;
case SDL_PIXELFORMAT_ARGB8888:
SDL_snprintfcat(text, maxlen, "ARGB8888");

View File

@ -139,7 +139,7 @@ extern SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface);
g = SDL_expand_byte[3][((Pixel & 0x03E0) >> 5)]; \
b = SDL_expand_byte[3][(Pixel & 0x001F)]; \
}
#define RGB_FROM_RGB888(Pixel, r, g, b) \
#define RGB_FROM_XRGB8888(Pixel, r, g, b) \
{ \
r = ((Pixel & 0xFF0000) >> 16); \
g = ((Pixel & 0xFF00) >> 8); \
@ -232,7 +232,7 @@ extern SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface);
{ \
Pixel = (Uint16)(((r >> 3) << 10) | ((g >> 3) << 5) | (b >> 3)); \
}
#define RGB888_FROM_RGB(Pixel, r, g, b) \
#define XRGB8888_FROM_RGB(Pixel, r, g, b) \
{ \
Pixel = (r << 16) | (g << 8) | b; \
}

View File

@ -193,8 +193,8 @@ static vector unsigned char reorder_ppc64le_vec(vector unsigned char vpermute)
}
#endif
static void Blit_RGB888_RGB565(SDL_BlitInfo *info);
static void Blit_RGB888_RGB565Altivec(SDL_BlitInfo *info)
static void Blit_XRGB8888_RGB565(SDL_BlitInfo *info);
static void Blit_XRGB8888_RGB565Altivec(SDL_BlitInfo *info)
{
int height = info->dst_h;
Uint8 *src = (Uint8 *)info->src;
@ -906,9 +906,9 @@ static enum blit_features GetBlitFeatures(void)
#endif
#ifdef SDL_ARM_SIMD_BLITTERS
void Blit_BGR888_RGB888ARMSIMDAsm(int32_t w, int32_t h, uint32_t *dst, int32_t dst_stride, uint32_t *src, int32_t src_stride);
void Blit_XBGR8888_XRGB8888ARMSIMDAsm(int32_t w, int32_t h, uint32_t *dst, int32_t dst_stride, uint32_t *src, int32_t src_stride);
static void Blit_BGR888_RGB888ARMSIMD(SDL_BlitInfo *info)
static void Blit_XBGR8888_XRGB8888ARMSIMD(SDL_BlitInfo *info)
{
int32_t width = info->dst_w;
int32_t height = info->dst_h;
@ -917,12 +917,12 @@ static void Blit_BGR888_RGB888ARMSIMD(SDL_BlitInfo *info)
uint32_t *srcp = (uint32_t *)info->src;
int32_t srcstride = width + (info->src_skip >> 2);
Blit_BGR888_RGB888ARMSIMDAsm(width, height, dstp, dststride, srcp, srcstride);
Blit_XBGR8888_XRGB8888ARMSIMDAsm(width, height, dstp, dststride, srcp, srcstride);
}
void Blit_RGB444_RGB888ARMSIMDAsm(int32_t w, int32_t h, uint32_t *dst, int32_t dst_stride, uint16_t *src, int32_t src_stride);
void Blit_RGB444_XRGB8888ARMSIMDAsm(int32_t w, int32_t h, uint32_t *dst, int32_t dst_stride, uint16_t *src, int32_t src_stride);
static void Blit_RGB444_RGB888ARMSIMD(SDL_BlitInfo *info)
static void Blit_RGB444_XRGB8888ARMSIMD(SDL_BlitInfo *info)
{
int32_t width = info->dst_w;
int32_t height = info->dst_h;
@ -931,7 +931,7 @@ static void Blit_RGB444_RGB888ARMSIMD(SDL_BlitInfo *info)
uint16_t *srcp = (uint16_t *)info->src;
int32_t srcstride = width + (info->src_skip >> 1);
Blit_RGB444_RGB888ARMSIMDAsm(width, height, dstp, dststride, srcp, srcstride);
Blit_RGB444_XRGB8888ARMSIMDAsm(width, height, dstp, dststride, srcp, srcstride);
}
#endif
@ -951,7 +951,7 @@ static void Blit_RGB444_RGB888ARMSIMD(SDL_BlitInfo *info)
(((src)&0x0000E000) >> 11) | \
(((src)&0x000000C0) >> 6)); \
}
static void Blit_RGB888_index8(SDL_BlitInfo *info)
static void Blit_XRGB8888_index8(SDL_BlitInfo *info)
{
#ifndef USE_DUFFS_LOOP
int c;
@ -1191,7 +1191,7 @@ static void Blit_RGB101010_index8(SDL_BlitInfo *info)
(((src[LO]) & 0x000000F8) >> 3); \
}
#endif
static void Blit_RGB888_RGB555(SDL_BlitInfo *info)
static void Blit_XRGB8888_RGB555(SDL_BlitInfo *info)
{
#ifndef USE_DUFFS_LOOP
int c;
@ -1321,7 +1321,7 @@ static void Blit_RGB888_RGB555(SDL_BlitInfo *info)
(((src[LO]) & 0x000000F8) >> 3); \
}
#endif
static void Blit_RGB888_RGB565(SDL_BlitInfo *info)
static void Blit_XRGB8888_RGB565(SDL_BlitInfo *info)
{
#ifndef USE_DUFFS_LOOP
int c;
@ -3222,7 +3222,7 @@ static const struct blit_table normal_blit_2[] = {
#endif
#ifdef SDL_ARM_SIMD_BLITTERS
{ 0x00000F00, 0x000000F0, 0x0000000F, 4, 0x00FF0000, 0x0000FF00, 0x000000FF,
BLIT_FEATURE_HAS_ARM_SIMD, Blit_RGB444_RGB888ARMSIMD, NO_ALPHA | COPY_ALPHA },
BLIT_FEATURE_HAS_ARM_SIMD, Blit_RGB444_XRGB8888ARMSIMD, NO_ALPHA | COPY_ALPHA },
#endif
#if SDL_HAVE_BLIT_N_RGB565
{ 0x0000F800, 0x000007E0, 0x0000001F, 4, 0x00FF0000, 0x0000FF00, 0x000000FF,
@ -3289,11 +3289,11 @@ static const struct blit_table normal_blit_4[] = {
BLIT_FEATURE_HAS_ALTIVEC, ConvertAltivec32to32_prefetch, NO_ALPHA | COPY_ALPHA | SET_ALPHA },
/* has-altivec */
{ 0x00000000, 0x00000000, 0x00000000, 2, 0x0000F800, 0x000007E0, 0x0000001F,
BLIT_FEATURE_HAS_ALTIVEC, Blit_RGB888_RGB565Altivec, NO_ALPHA },
BLIT_FEATURE_HAS_ALTIVEC, Blit_XRGB8888_RGB565Altivec, NO_ALPHA },
#endif
#ifdef SDL_ARM_SIMD_BLITTERS
{ 0x000000FF, 0x0000FF00, 0x00FF0000, 4, 0x00FF0000, 0x0000FF00, 0x000000FF,
BLIT_FEATURE_HAS_ARM_SIMD, Blit_BGR888_RGB888ARMSIMD, NO_ALPHA | COPY_ALPHA },
BLIT_FEATURE_HAS_ARM_SIMD, Blit_XBGR8888_XRGB8888ARMSIMD, NO_ALPHA | COPY_ALPHA },
#endif
/* 4->3 with same rgb triplet */
{ 0x000000FF, 0x0000FF00, 0x00FF0000, 3, 0x000000FF, 0x0000FF00, 0x00FF0000,
@ -3320,9 +3320,9 @@ static const struct blit_table normal_blit_4[] = {
SET_ALPHA | COPY_ALPHA },
/* RGB 888 and RGB 565 */
{ 0x00FF0000, 0x0000FF00, 0x000000FF, 2, 0x0000F800, 0x000007E0, 0x0000001F,
0, Blit_RGB888_RGB565, NO_ALPHA },
0, Blit_XRGB8888_RGB565, NO_ALPHA },
{ 0x00FF0000, 0x0000FF00, 0x000000FF, 2, 0x00007C00, 0x000003E0, 0x0000001F,
0, Blit_RGB888_RGB555, NO_ALPHA },
0, Blit_XRGB8888_RGB555, NO_ALPHA },
/* Default for 32-bit RGB source, used if no other blitter matches */
{ 0, 0, 0, 0, 0, 0, 0, 0, BlitNtoN, 0 }
};
@ -3359,7 +3359,7 @@ SDL_BlitFunc SDL_CalculateBlitN(SDL_Surface *surface)
(srcfmt->Rmask == 0x00FF0000) &&
(srcfmt->Gmask == 0x0000FF00) &&
(srcfmt->Bmask == 0x000000FF)) {
blitfun = Blit_RGB888_index8;
blitfun = Blit_XRGB8888_index8;
} else if ((srcfmt->BytesPerPixel == 4) &&
(srcfmt->Rmask == 0x3FF00000) &&
(srcfmt->Gmask == 0x000FFC00) &&

File diff suppressed because it is too large Load Diff

View File

@ -109,9 +109,9 @@ const char *SDL_GetPixelFormatName(Uint32 format)
CASE(SDL_PIXELFORMAT_BGR565)
CASE(SDL_PIXELFORMAT_RGB24)
CASE(SDL_PIXELFORMAT_BGR24)
CASE(SDL_PIXELFORMAT_RGB888)
CASE(SDL_PIXELFORMAT_XRGB8888)
CASE(SDL_PIXELFORMAT_RGBX8888)
CASE(SDL_PIXELFORMAT_BGR888)
CASE(SDL_PIXELFORMAT_XBGR8888)
CASE(SDL_PIXELFORMAT_BGRX8888)
CASE(SDL_PIXELFORMAT_ARGB8888)
CASE(SDL_PIXELFORMAT_RGBA8888)
@ -444,13 +444,13 @@ Uint32 SDL_GetPixelFormatEnumForMasks(int bpp, Uint32 Rmask, Uint32 Gmask, Uint3
break;
case 32:
if (Rmask == 0) {
return SDL_PIXELFORMAT_RGB888;
return SDL_PIXELFORMAT_XRGB8888;
}
if (Rmask == 0x00FF0000 &&
Gmask == 0x0000FF00 &&
Bmask == 0x000000FF &&
Amask == 0x00000000) {
return SDL_PIXELFORMAT_RGB888;
return SDL_PIXELFORMAT_XRGB8888;
}
if (Rmask == 0xFF000000 &&
Gmask == 0x00FF0000 &&
@ -462,7 +462,7 @@ Uint32 SDL_GetPixelFormatEnumForMasks(int bpp, Uint32 Rmask, Uint32 Gmask, Uint3
Gmask == 0x0000FF00 &&
Bmask == 0x00FF0000 &&
Amask == 0x00000000) {
return SDL_PIXELFORMAT_BGR888;
return SDL_PIXELFORMAT_XBGR8888;
}
if (Rmask == 0x0000FF00 &&
Gmask == 0x00FF0000 &&

View File

@ -333,11 +333,11 @@ static SDL_bool SDL_TARGETING("sse2") yuv_rgb_sse(
case SDL_PIXELFORMAT_BGRA8888:
yuv420_bgra_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
return SDL_TRUE;
case SDL_PIXELFORMAT_RGB888:
case SDL_PIXELFORMAT_XRGB8888:
case SDL_PIXELFORMAT_ARGB8888:
yuv420_argb_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
return SDL_TRUE;
case SDL_PIXELFORMAT_BGR888:
case SDL_PIXELFORMAT_XBGR8888:
case SDL_PIXELFORMAT_ABGR8888:
yuv420_abgr_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
return SDL_TRUE;
@ -365,11 +365,11 @@ static SDL_bool SDL_TARGETING("sse2") yuv_rgb_sse(
case SDL_PIXELFORMAT_BGRA8888:
yuv422_bgra_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
return SDL_TRUE;
case SDL_PIXELFORMAT_RGB888:
case SDL_PIXELFORMAT_XRGB8888:
case SDL_PIXELFORMAT_ARGB8888:
yuv422_argb_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
return SDL_TRUE;
case SDL_PIXELFORMAT_BGR888:
case SDL_PIXELFORMAT_XBGR8888:
case SDL_PIXELFORMAT_ABGR8888:
yuv422_abgr_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
return SDL_TRUE;
@ -396,11 +396,11 @@ static SDL_bool SDL_TARGETING("sse2") yuv_rgb_sse(
case SDL_PIXELFORMAT_BGRA8888:
yuvnv12_bgra_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
return SDL_TRUE;
case SDL_PIXELFORMAT_RGB888:
case SDL_PIXELFORMAT_XRGB8888:
case SDL_PIXELFORMAT_ARGB8888:
yuvnv12_argb_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
return SDL_TRUE;
case SDL_PIXELFORMAT_BGR888:
case SDL_PIXELFORMAT_XBGR8888:
case SDL_PIXELFORMAT_ABGR8888:
yuvnv12_abgr_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
return SDL_TRUE;
@ -448,11 +448,11 @@ static SDL_bool yuv_rgb_lsx(
case SDL_PIXELFORMAT_BGRA8888:
yuv420_bgra_lsx(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
return SDL_TRUE;
case SDL_PIXELFORMAT_RGB888:
case SDL_PIXELFORMAT_XRGB8888:
case SDL_PIXELFORMAT_ARGB8888:
yuv420_argb_lsx(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
return SDL_TRUE;
case SDL_PIXELFORMAT_BGR888:
case SDL_PIXELFORMAT_XBGR8888:
case SDL_PIXELFORMAT_ABGR8888:
yuv420_abgr_lsx(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
return SDL_TRUE;
@ -499,11 +499,11 @@ static SDL_bool yuv_rgb_std(
case SDL_PIXELFORMAT_BGRA8888:
yuv420_bgra_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
return SDL_TRUE;
case SDL_PIXELFORMAT_RGB888:
case SDL_PIXELFORMAT_XRGB8888:
case SDL_PIXELFORMAT_ARGB8888:
yuv420_argb_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
return SDL_TRUE;
case SDL_PIXELFORMAT_BGR888:
case SDL_PIXELFORMAT_XBGR8888:
case SDL_PIXELFORMAT_ABGR8888:
yuv420_abgr_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
return SDL_TRUE;
@ -531,11 +531,11 @@ static SDL_bool yuv_rgb_std(
case SDL_PIXELFORMAT_BGRA8888:
yuv422_bgra_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
return SDL_TRUE;
case SDL_PIXELFORMAT_RGB888:
case SDL_PIXELFORMAT_XRGB8888:
case SDL_PIXELFORMAT_ARGB8888:
yuv422_argb_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
return SDL_TRUE;
case SDL_PIXELFORMAT_BGR888:
case SDL_PIXELFORMAT_XBGR8888:
case SDL_PIXELFORMAT_ABGR8888:
yuv422_abgr_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
return SDL_TRUE;
@ -562,11 +562,11 @@ static SDL_bool yuv_rgb_std(
case SDL_PIXELFORMAT_BGRA8888:
yuvnv12_bgra_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
return SDL_TRUE;
case SDL_PIXELFORMAT_RGB888:
case SDL_PIXELFORMAT_XRGB8888:
case SDL_PIXELFORMAT_ARGB8888:
yuvnv12_argb_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
return SDL_TRUE;
case SDL_PIXELFORMAT_BGR888:
case SDL_PIXELFORMAT_XBGR8888:
case SDL_PIXELFORMAT_ABGR8888:
yuvnv12_abgr_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
return SDL_TRUE;

View File

@ -465,7 +465,7 @@ generate_composite_function \
.endm
generate_composite_function \
Blit_BGR888_RGB888ARMSIMDAsm, 32, 0, 32, \
Blit_XBGR8888_XRGB8888ARMSIMDAsm, 32, 0, 32, \
FLAG_DST_WRITEONLY | FLAG_COND_EXEC | FLAG_PROCESS_PRESERVES_SCRATCH, \
2, /* prefetch distance */ \
nop_macro, /* init */ \
@ -522,7 +522,7 @@ generate_composite_function \
.endm
generate_composite_function \
Blit_RGB444_RGB888ARMSIMDAsm, 16, 0, 32, \
Blit_RGB444_XRGB8888ARMSIMDAsm, 16, 0, 32, \
FLAG_DST_WRITEONLY | FLAG_BRANCH_OVER, \
2, /* prefetch distance */ \
RGB444toRGB888_init, \

View File

@ -30,7 +30,7 @@
int SDL_DUMMY_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, Uint32 *format, void **pixels, int *pitch)
{
SDL_Surface *surface;
const Uint32 surface_format = SDL_PIXELFORMAT_RGB888;
const Uint32 surface_format = SDL_PIXELFORMAT_XRGB8888;
int w, h;
/* Free the old framebuffer surface */

View File

@ -143,7 +143,7 @@ int DUMMY_VideoInit(SDL_VideoDevice *_this)
/* Use a fake 32-bpp desktop mode */
SDL_zero(mode);
mode.format = SDL_PIXELFORMAT_RGB888;
mode.format = SDL_PIXELFORMAT_XRGB8888;
mode.w = 1024;
mode.h = 768;
if (SDL_AddBasicVideoDisplay(&mode) == 0) {

View File

@ -30,7 +30,7 @@
int Emscripten_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, Uint32 *format, void **pixels, int *pitch)
{
SDL_Surface *surface;
const Uint32 surface_format = SDL_PIXELFORMAT_BGR888;
const Uint32 surface_format = SDL_PIXELFORMAT_XBGR8888;
int w, h;
/* Free the old framebuffer surface */

View File

@ -126,7 +126,7 @@ int Emscripten_VideoInit(SDL_VideoDevice *_this)
/* Use a fake 32-bpp desktop mode */
SDL_zero(mode);
mode.format = SDL_PIXELFORMAT_RGB888;
mode.format = SDL_PIXELFORMAT_XRGB8888;
emscripten_get_screen_size(&mode.w, &mode.h);
mode.pixel_density = emscripten_get_device_pixel_ratio();

View File

@ -156,7 +156,7 @@ int32 HAIKU_ColorSpaceToSDLPxFormat(uint32 colorspace)
case B_RGBA32:
case B_RGB32_BIG:
case B_RGBA32_BIG:
return SDL_PIXELFORMAT_RGB888;
return SDL_PIXELFORMAT_XRGB8888;
break;
}

View File

@ -30,7 +30,7 @@
int SDL_OFFSCREEN_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, Uint32 *format, void **pixels, int *pitch)
{
SDL_Surface *surface;
const Uint32 surface_format = SDL_PIXELFORMAT_RGB888;
const Uint32 surface_format = SDL_PIXELFORMAT_XRGB8888;
int w, h;
/* Free the old framebuffer surface */

View File

@ -102,7 +102,7 @@ int OFFSCREEN_VideoInit(SDL_VideoDevice *_this)
/* Use a fake 32-bpp desktop mode */
SDL_zero(mode);
mode.format = SDL_PIXELFORMAT_RGB888;
mode.format = SDL_PIXELFORMAT_XRGB8888;
mode.w = 1024;
mode.h = 768;
if (SDL_AddBasicVideoDisplay(&mode) == 0) {

View File

@ -42,7 +42,7 @@ static int chooseFormat(EGLConfig egl_conf)
case 32:
return SCREEN_FORMAT_RGBX8888;
case 24:
return SCREEN_FORMAT_RGB888;
return SDL_PIXELFORMAT_RGB24;
case 16:
switch (alpha_bit_depth) {
case 4:

View File

@ -170,7 +170,7 @@ static int createWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window * window,
return -1;
}
*format = SDL_PIXELFORMAT_RGB888;
*format = SDL_PIXELFORMAT_XRGB8888;
return 0;
}

View File

@ -52,7 +52,7 @@ int RISCOS_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, U
*format = mode->format;
sprite_mode = (unsigned int)mode->driverdata;
} else {
*format = SDL_PIXELFORMAT_BGR888;
*format = SDL_PIXELFORMAT_XBGR8888;
sprite_mode = (1 | (90 << 1) | (90 << 14) | (6 << 27));
}

View File

@ -17,8 +17,8 @@ my %file;
# SDL_PIXELFORMAT_RGB565
# SDL_PIXELFORMAT_RGB24
# SDL_PIXELFORMAT_BGR24
# SDL_PIXELFORMAT_RGB888
# SDL_PIXELFORMAT_BGR888
# SDL_PIXELFORMAT_XRGB8888
# SDL_PIXELFORMAT_XBGR8888
# SDL_PIXELFORMAT_ARGB8888
# SDL_PIXELFORMAT_RGBA8888
# SDL_PIXELFORMAT_ABGR8888
@ -27,22 +27,22 @@ my %file;
# The formats we're actually creating blitters for:
my @src_formats = (
"RGB888",
"BGR888",
"XRGB8888",
"XBGR8888",
"ARGB8888",
"RGBA8888",
"ABGR8888",
"BGRA8888",
);
my @dst_formats = (
"RGB888",
"BGR888",
"XRGB8888",
"XBGR8888",
"ARGB8888",
);
my %format_size = (
"RGB888" => 4,
"BGR888" => 4,
"XRGB8888" => 4,
"XBGR8888" => 4,
"ARGB8888" => 4,
"RGBA8888" => 4,
"ABGR8888" => 4,
@ -50,8 +50,8 @@ my %format_size = (
);
my %format_type = (
"RGB888" => "Uint32",
"BGR888" => "Uint32",
"XRGB8888" => "Uint32",
"XBGR8888" => "Uint32",
"ARGB8888" => "Uint32",
"RGBA8888" => "Uint32",
"ABGR8888" => "Uint32",
@ -59,8 +59,8 @@ my %format_type = (
);
my %get_rgba_string_ignore_alpha = (
"RGB888" => "_R = (Uint8)(_pixel >> 16); _G = (Uint8)(_pixel >> 8); _B = (Uint8)_pixel;",
"BGR888" => "_B = (Uint8)(_pixel >> 16); _G = (Uint8)(_pixel >> 8); _R = (Uint8)_pixel;",
"XRGB8888" => "_R = (Uint8)(_pixel >> 16); _G = (Uint8)(_pixel >> 8); _B = (Uint8)_pixel;",
"XBGR8888" => "_B = (Uint8)(_pixel >> 16); _G = (Uint8)(_pixel >> 8); _R = (Uint8)_pixel;",
"ARGB8888" => "_R = (Uint8)(_pixel >> 16); _G = (Uint8)(_pixel >> 8); _B = (Uint8)_pixel;",
"RGBA8888" => "_R = (Uint8)(_pixel >> 24); _G = (Uint8)(_pixel >> 16); _B = (Uint8)(_pixel >> 8);",
"ABGR8888" => "_B = (Uint8)(_pixel >> 16); _G = (Uint8)(_pixel >> 8); _R = (Uint8)_pixel;",
@ -68,8 +68,8 @@ my %get_rgba_string_ignore_alpha = (
);
my %get_rgba_string = (
"RGB888" => $get_rgba_string_ignore_alpha{"RGB888"},
"BGR888" => $get_rgba_string_ignore_alpha{"BGR888"},
"XRGB8888" => $get_rgba_string_ignore_alpha{"XRGB8888"},
"XBGR8888" => $get_rgba_string_ignore_alpha{"XBGR8888"},
"ARGB8888" => $get_rgba_string_ignore_alpha{"ARGB8888"} . " _A = (Uint8)(_pixel >> 24);",
"RGBA8888" => $get_rgba_string_ignore_alpha{"RGBA8888"} . " _A = (Uint8)_pixel;",
"ABGR8888" => $get_rgba_string_ignore_alpha{"ABGR8888"} . " _A = (Uint8)(_pixel >> 24);",
@ -77,8 +77,8 @@ my %get_rgba_string = (
);
my %set_rgba_string = (
"RGB888" => "_pixel = (_R << 16) | (_G << 8) | _B;",
"BGR888" => "_pixel = (_B << 16) | (_G << 8) | _R;",
"XRGB8888" => "_pixel = (_R << 16) | (_G << 8) | _B;",
"XBGR8888" => "_pixel = (_B << 16) | (_G << 8) | _R;",
"ARGB8888" => "_pixel = (_A << 24) | (_R << 16) | (_G << 8) | _B;",
"RGBA8888" => "_pixel = (_R << 24) | (_G << 16) | (_B << 8) | _A;",
"ABGR8888" => "_pixel = (_A << 24) | (_B << 16) | (_G << 8) | _R;",
@ -235,9 +235,9 @@ __EOF__
# Matching color-order
$sa = $src;
$sa =~ s/[A8]//g;
$sa =~ s/[XA8]//g;
$da = $dst;
$da =~ s/[A8]//g;
$da =~ s/[XA8]//g;
if ($sa eq $da) {
if ($dst_has_alpha && $src_has_alpha) {
$da = substr $dst, 0, 1;
@ -259,14 +259,14 @@ __EOF__
} elsif ($dst_has_alpha) {
$da = substr $dst, 0, 1;
if ($da eq "A") {
# RGB -> ARGB
# XRGB -> ARGB
print FILE <<__EOF__;
pixel = *src;
pixel |= (A << 24);
*dst = pixel;
__EOF__
} else {
# RGB -> RGBA -- unused
# XRGB -> RGBA -- unused
print FILE <<__EOF__;
pixel = *src;
pixel = (pixel << 8) | A;
@ -276,14 +276,14 @@ __EOF__
} else {
$sa = substr $src, 0, 1;
if ($sa eq "A") {
# ARGB -> RGB
# ARGB -> XRGB
print FILE <<__EOF__;
pixel = *src;
pixel &= 0xFFFFFF;
*dst = pixel;
__EOF__
} else {
# RGBA -> RGB
# RGBA -> XRGB
print FILE <<__EOF__;
pixel = *src;
pixel >>= 8;
@ -424,8 +424,8 @@ sub output_copyfunc
my $da = $dst;
my $matching_colors = 0;
$sa =~ s/[A8]//g;
$da =~ s/[A8]//g;
$sa =~ s/[XA8]//g;
$da =~ s/[XA8]//g;
$matching_colors = (!$modulate && !$blend && ($sa eq $da)) ? 1 : 0;
output_copyfuncname("static void", $src, $dst, $modulate, $blend, $scale, 1, "\n");

View File

@ -511,7 +511,7 @@ static void display_handle_done(void *data,
/* The native display resolution */
SDL_zero(native_mode);
native_mode.format = SDL_PIXELFORMAT_RGB888;
native_mode.format = SDL_PIXELFORMAT_XRGB8888;
/* Transform the pixel values, if necessary. */
if (driverdata->transform & WL_OUTPUT_TRANSFORM_90) {
@ -552,7 +552,7 @@ static void display_handle_done(void *data,
/* The scaled desktop mode */
SDL_zero(desktop_mode);
desktop_mode.format = SDL_PIXELFORMAT_RGB888;
desktop_mode.format = SDL_PIXELFORMAT_XRGB8888;
desktop_mode.w = driverdata->screen_width;
desktop_mode.h = driverdata->screen_height;

View File

@ -70,7 +70,7 @@ int WIN_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, Uint
}
if (*format == SDL_PIXELFORMAT_UNKNOWN) {
/* We'll use RGB format for now */
*format = SDL_PIXELFORMAT_RGB888;
*format = SDL_PIXELFORMAT_XRGB8888;
/* Create a new one */
SDL_memset(info, 0, size);

View File

@ -58,10 +58,10 @@ static void WIN_UpdateDisplayMode(SDL_VideoDevice *_this, LPCWSTR deviceName, DW
if (bmi->bmiHeader.biCompression == BI_BITFIELDS) {
switch (*(Uint32 *)bmi->bmiColors) {
case 0x00FF0000:
mode->format = SDL_PIXELFORMAT_RGB888;
mode->format = SDL_PIXELFORMAT_XRGB8888;
break;
case 0x000000FF:
mode->format = SDL_PIXELFORMAT_BGR888;
mode->format = SDL_PIXELFORMAT_XBGR8888;
break;
case 0xF800:
mode->format = SDL_PIXELFORMAT_RGB565;
@ -80,7 +80,7 @@ static void WIN_UpdateDisplayMode(SDL_VideoDevice *_this, LPCWSTR deviceName, DW
if ((data->DeviceMode.dmFields & DM_BITSPERPEL) == DM_BITSPERPEL) {
switch (data->DeviceMode.dmBitsPerPel) {
case 32:
mode->format = SDL_PIXELFORMAT_RGB888;
mode->format = SDL_PIXELFORMAT_XRGB8888;
break;
case 24:
mode->format = SDL_PIXELFORMAT_RGB24;

View File

@ -31,9 +31,9 @@ static const Uint32 g_AllFormats[] = {
SDL_PIXELFORMAT_BGR565,
SDL_PIXELFORMAT_RGB24,
SDL_PIXELFORMAT_BGR24,
SDL_PIXELFORMAT_RGB888,
SDL_PIXELFORMAT_XRGB8888,
SDL_PIXELFORMAT_RGBX8888,
SDL_PIXELFORMAT_BGR888,
SDL_PIXELFORMAT_XBGR8888,
SDL_PIXELFORMAT_BGRX8888,
SDL_PIXELFORMAT_ARGB8888,
SDL_PIXELFORMAT_RGBA8888,
@ -73,9 +73,9 @@ static const char *g_AllFormatsVerbose[] = {
"SDL_PIXELFORMAT_BGR565",
"SDL_PIXELFORMAT_RGB24",
"SDL_PIXELFORMAT_BGR24",
"SDL_PIXELFORMAT_RGB888",
"SDL_PIXELFORMAT_XRGB8888",
"SDL_PIXELFORMAT_RGBX8888",
"SDL_PIXELFORMAT_BGR888",
"SDL_PIXELFORMAT_XBGR8888",
"SDL_PIXELFORMAT_BGRX8888",
"SDL_PIXELFORMAT_ARGB8888",
"SDL_PIXELFORMAT_RGBA8888",

View File

@ -319,9 +319,9 @@ static int surface_testCompleteSurfaceConversion(void *arg)
SDL_PIXELFORMAT_BGR565,
SDL_PIXELFORMAT_RGB24,
SDL_PIXELFORMAT_BGR24,
SDL_PIXELFORMAT_RGB888,
SDL_PIXELFORMAT_XRGB8888,
SDL_PIXELFORMAT_RGBX8888,
SDL_PIXELFORMAT_BGR888,
SDL_PIXELFORMAT_XBGR8888,
SDL_PIXELFORMAT_BGRX8888,
SDL_PIXELFORMAT_ARGB8888,
SDL_PIXELFORMAT_RGBA8888,