Skip to content
Snippets Groups Projects
Commit 4e5e1912 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 c27b2b52
No related branches found
No related tags found
No related merge requests found
...@@ -323,7 +323,6 @@ gdi_handle_wm_paint(HWND hwnd) ...@@ -323,7 +323,6 @@ gdi_handle_wm_paint(HWND hwnd)
else else
SetDIBits(winDC, di, 0, dih, data, (BITMAPINFO *)&b5hdr, DIB_RGB_COLORS); SetDIBits(winDC, di, 0, dih, data, (BITMAPINFO *)&b5hdr, DIB_RGB_COLORS);
// Clear to black first // Clear to black first
StretchBlt(winDC, 0, 0, w, h, memDC, 0, 0, 1, 1, BLACKNESS);
di = SelectObject(memDC, di); di = SelectObject(memDC, di);
pthread_mutex_lock(&off_lock); pthread_mutex_lock(&off_lock);
if (ciolib_scaling) { if (ciolib_scaling) {
...@@ -332,6 +331,14 @@ gdi_handle_wm_paint(HWND hwnd) ...@@ -332,6 +331,14 @@ gdi_handle_wm_paint(HWND hwnd)
else { else {
StretchBlt(winDC, xoff, yoff, dwidth, dheight, memDC, 0, 0, diw, dih, SRCCOPY); 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); pthread_mutex_unlock(&off_lock);
EndPaint(hwnd, &ps); EndPaint(hwnd, &ps);
di = SelectObject(memDC, di); di = SelectObject(memDC, di);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment