mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-02-16 02:30:52 +00:00
Don't blend the source surface when blitting
This commit is contained in:
@@ -1433,6 +1433,9 @@ void DrmRenderer::blitOverlayToCompositionSurface(Overlay::OverlayType type, SDL
|
||||
SDL_assert(m_OverlayCompositionSurface);
|
||||
|
||||
if (newSurface && overlayRect) {
|
||||
// Disable blending of the source surface when blitting
|
||||
SDL_SetSurfaceBlendMode(newSurface, SDL_BLENDMODE_NONE);
|
||||
|
||||
// Premultiply alpha in place, so we can blit directly into the composition surface
|
||||
// without having to read anything (which may be very costly due to UC/WC memory)
|
||||
SDL_PremultiplyAlpha(newSurface->w, newSurface->h,
|
||||
@@ -1449,6 +1452,8 @@ void DrmRenderer::blitOverlayToCompositionSurface(Overlay::OverlayType type, SDL
|
||||
SDL_BlitSurface(newSurface, nullptr, m_OverlayCompositionSurface, overlayRect);
|
||||
}
|
||||
else {
|
||||
SDL_assert(newSurface->format->format == m_OverlayCompositionSurface->format->format);
|
||||
|
||||
// Draw the surface row-by-row to ensure we clear the dirty area from the previous surface
|
||||
// without causing flickering, which would be noticeable if we cleared the whole area first.
|
||||
for (int y = overlayUnionRect.y; y < overlayUnionRect.y + overlayUnionRect.h; y++) {
|
||||
|
||||
Reference in New Issue
Block a user