Skip to content

Commit 2c1cef9

Browse files
Finomniskartben
authored andcommitted
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>
1 parent f01a96c commit 2c1cef9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/display/display_sdl_bottom.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,13 @@ int sdl_display_read_bottom(const uint16_t height, const uint16_t width,
154154
}
155155

156156
SDL_SetRenderTarget(renderer, read_texture);
157+
SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_NONE);
157158

158159
SDL_RenderClear(renderer);
159160
SDL_RenderCopy(renderer, texture, NULL, NULL);
160161
SDL_RenderReadPixels(renderer, &rect, SDL_PIXELFORMAT_ARGB8888, buf, width * 4);
161162

163+
SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND);
162164
SDL_SetRenderTarget(renderer, NULL);
163165

164166
SDL_UnlockMutex(mutex);

0 commit comments

Comments
 (0)