Browse Source

display_sdl: Fix incorrect blend mode during display_read

The blend mode was set in a way that multiplied pixels with the alpha
value during read, which caused tests to fail.

Signed-off-by: Martin Stumpf <finomnis@gmail.com>
pull/89805/head
Martin Stumpf 2 months ago committed by Benjamin Cabé
parent
commit
2c1cef9659
  1. 2
      drivers/display/display_sdl_bottom.c

2
drivers/display/display_sdl_bottom.c

@ -154,11 +154,13 @@ int sdl_display_read_bottom(const uint16_t height, const uint16_t width, @@ -154,11 +154,13 @@ int sdl_display_read_bottom(const uint16_t height, const uint16_t width,
}
SDL_SetRenderTarget(renderer, read_texture);
SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_NONE);
SDL_RenderClear(renderer);
SDL_RenderCopy(renderer, texture, NULL, NULL);
SDL_RenderReadPixels(renderer, &rect, SDL_PIXELFORMAT_ARGB8888, buf, width * 4);
SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND);
SDL_SetRenderTarget(renderer, NULL);
SDL_UnlockMutex(mutex);

Loading…
Cancel
Save