File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -873,6 +873,17 @@ static int SDLCALL surface_testSurfaceRLEPixels(void *arg)
873873 return TEST_ABORTED ;
874874 }
875875
876+ /* RLE encoding only works for 32-bit surfaces with alpha in the high bits */
877+ if (face -> format != SDL_PIXELFORMAT_ARGB8888 ) {
878+ tmp = SDL_ConvertSurface (face , SDL_PIXELFORMAT_ARGB8888 );
879+ SDLTest_AssertCheck (tmp != NULL , "Verify tmp surface is not NULL" );
880+ if (tmp == NULL ) {
881+ return TEST_ABORTED ;
882+ }
883+ SDL_DestroySurface (face );
884+ face = tmp ;
885+ }
886+
876887 /* Create a temporary surface to trigger RLE encoding during blit */
877888 tmp = SDL_DuplicateSurface (face );
878889 SDLTest_AssertCheck (tmp != NULL , "Verify result from SDL_DuplicateSurface() with RLE pixels is not NULL" );
You can’t perform that action at this time.
0 commit comments