Skip to content

Commit ccb6757

Browse files
committed
Change default pixel format on little endian to ARGB.
Not touching big endian as this would require further testing. Has the same base performance as ABGR so is okay to use. Makes Masked Blit much faster (see #3497), Pixman fast path probably? Also is the format used by Maniacs so the pixel operations are faster
1 parent ef5c352 commit ccb6757

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/platform/sdl/sdl2_ui.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ static uint32_t GetDefaultFormat() {
6363
#ifdef WORDS_BIGENDIAN
6464
return SDL_PIXELFORMAT_ABGR32;
6565
#else
66-
return SDL_PIXELFORMAT_RGBA32;
66+
return SDL_PIXELFORMAT_BGRA32;
6767
#endif
6868
}
6969

@@ -88,7 +88,7 @@ static int GetFormatRank(uint32_t fmt) {
8888
case SDL_PIXELFORMAT_RGBA32:
8989
return 2;
9090
case SDL_PIXELFORMAT_BGRA32:
91-
return 2;
91+
return 3;
9292
case SDL_PIXELFORMAT_ARGB32:
9393
return 1;
9494
case SDL_PIXELFORMAT_ABGR32:

src/platform/sdl/sdl3_ui.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ static SDL_PixelFormat GetDefaultFormat() {
6565
#ifdef WORDS_BIGENDIAN
6666
return SDL_PIXELFORMAT_ABGR32;
6767
#else
68-
return SDL_PIXELFORMAT_RGBA32;
68+
return SDL_PIXELFORMAT_BGRA32;
6969
#endif
7070
}
7171

0 commit comments

Comments
 (0)