Skip to content
Snippets Groups Projects
Commit 5cc83981 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Only erase black bars and use BitBlt()

I expect BitBlt(..., BLACKNESS) to be the better optimized of the
two, and there's no reason to actually reat the source bitmap.
parent 3d8c103a
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #4167 passed
......@@ -323,7 +323,6 @@ gdi_handle_wm_paint(HWND hwnd)
else
SetDIBits(winDC, di, 0, dih, data, (BITMAPINFO *)&b5hdr, DIB_RGB_COLORS);
// Clear to black first
StretchBlt(winDC, 0, 0, w, h, memDC, 0, 0, 1, 1, BLACKNESS);
di = SelectObject(memDC, di);
pthread_mutex_lock(&off_lock);
if (ciolib_scaling) {
......@@ -332,6 +331,14 @@ gdi_handle_wm_paint(HWND hwnd)
else {
StretchBlt(winDC, xoff, yoff, dwidth, dheight, memDC, 0, 0, diw, dih, SRCCOPY);
}
if (xoff > 0) {
BitBlt(winDC, 0, 0, xoff - 1, dheight, memDC, 0, 0, BLACKNESS);
BitBlt(winDC, xoff + dwidth, 0, w, h, memDC, 0, 0, BLACKNESS);
}
else if (yoff > 0) {
BitBlt(winDC, 0, 0, w, yoff - 1, memDC, 0, 0, BLACKNESS);
BitBlt(winDC, 0, yoff + dheight, w, h, memDC, 0, 0, BLACKNESS);
}
pthread_mutex_unlock(&off_lock);
EndPaint(hwnd, &ps);
di = SelectObject(memDC, di);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment