Fixed bug 4229 - Add support for ABGR format in DirectFB renderer
authorSam Lantinga <slouken@libsdl.org>
Tue, 28 Aug 2018 13:37:11 -0700
changeset 12158ee7f3955c9fb
parent 12156 e5a666405750
child 12159 f7398cb0e3bf
Fixed bug 4229 - Add support for ABGR format in DirectFB renderer

Alexandre

DirectFB supports 32-bit ABGR pixel format via DSPF_ABGR, but SDL doesn't map SDL_PIXELFORMAT_ABGR8888 to DSPF_ABGR.

A patch is attached and should add support for ABGR pixel format devices.
src/video/directfb/SDL_DirectFB_video.c
     1.1 --- a/src/video/directfb/SDL_DirectFB_video.c	Tue Aug 28 12:57:51 2018 -0700
     1.2 +++ b/src/video/directfb/SDL_DirectFB_video.c	Tue Aug 28 13:37:11 2018 -0700
     1.3 @@ -324,6 +324,7 @@
     1.4      { DSPF_YUY2, SDL_PIXELFORMAT_YUY2 },                /* 16 bit YUV (4 byte/ 2 pixel, macropixel contains CbYCrY [31:0]) */
     1.5      { DSPF_UYVY, SDL_PIXELFORMAT_UYVY },                /* 16 bit YUV (4 byte/ 2 pixel, macropixel contains YCbYCr [31:0]) */
     1.6      { DSPF_RGB555, SDL_PIXELFORMAT_RGB555 },            /* 16 bit RGB (2 byte, nothing @15, red 5@10, green 5@5, blue 5@0) */
     1.7 +    { DSPF_ABGR, SDL_PIXELFORMAT_ABGR8888 },		/* 32 bit ABGR (4  byte, alpha 8@24, blue 8@16, green 8@8, red 8@0) */
     1.8  #if (ENABLE_LUT8)
     1.9      { DSPF_LUT8, SDL_PIXELFORMAT_INDEX8 },              /* 8 bit LUT (8 bit color and alpha lookup from palette) */
    1.10  #endif
    1.11 @@ -370,7 +371,6 @@
    1.12      { DSPF_UNKNOWN, SDL_PIXELFORMAT_BGR24 },
    1.13      { DSPF_UNKNOWN, SDL_PIXELFORMAT_BGR888 },
    1.14      { DSPF_UNKNOWN, SDL_PIXELFORMAT_RGBA8888 },
    1.15 -    { DSPF_UNKNOWN, SDL_PIXELFORMAT_ABGR8888 },
    1.16      { DSPF_UNKNOWN, SDL_PIXELFORMAT_BGRA8888 },
    1.17      { DSPF_UNKNOWN, SDL_PIXELFORMAT_ARGB2101010 },
    1.18      { DSPF_UNKNOWN, SDL_PIXELFORMAT_ABGR4444 },