From 3d0e33d2b300b25681f51a6c77200e9976b8ad93 Mon Sep 17 00:00:00 2001 From: Vincent Wei Date: Sun, 14 Jul 2019 15:26:53 +0800 Subject: [PATCH] Use ENTER_DRAWING_NOCHECK for BitBlt --- src/newgdi/bitmap.c | 19 ++++++++----------- src/newgdi/gdi.c | 3 ++- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/newgdi/bitmap.c b/src/newgdi/bitmap.c index 0512dd80..13c937d7 100644 --- a/src/newgdi/bitmap.c +++ b/src/newgdi/bitmap.c @@ -85,8 +85,6 @@ void _dc_fillbox_clip (PDC pdc, const GAL_Rect* rect) while (cliprect) { if (IntersectRect (&eff_rc, &pdc->rc_output, &cliprect->rc)) { SET_GAL_CLIPRECT (pdc, eff_rc); - _DBG_PRINTF("%s (%d, %d, %d, %d)\n", - __func__, rect->x, rect->y, rect->w, rect->h); GAL_FillRect (pdc->surface, rect, pdc->cur_pixel); } cliprect = cliprect->next; @@ -1128,18 +1126,17 @@ void GUIAPI BitBlt (HDC hsdc, int sx, int sy, int sw, int sh, goto empty_ret; GetBoundRect (&pddc->rc_output, &srcOutput, &dstOutput); } - else + else { pddc->rc_output = dstOutput; + } + + ENTER_DRAWING_NOCHECK (pddc); if (pddc->surface != psdc->surface && (psdc->surface == - __gal_screen)) + __gal_screen)) { psdc->rc_output = srcOutput; - - ENTER_DRAWING (pddc); - - if (pddc->surface != psdc->surface && (psdc->surface == - __gal_screen)) kernel_ShowCursorForGDI (FALSE, psdc); + } /* * The CLIPRECT's RECT order is: rc1 rc2 rc3 rc4 rc5 rc6 @@ -1273,11 +1270,11 @@ void GUIAPI BitBlt (HDC hsdc, int sx, int sy, int sw, int sh, } } - if (pddc->surface != psdc->surface && (psdc->surface == + if (pddc->surface != psdc->surface && (psdc->surface == __gal_screen)) kernel_ShowCursorForGDI (TRUE, psdc); - LEAVE_DRAWING (pddc); + LEAVE_DRAWING_NOCHECK (pddc); empty_ret: UNLOCK_GCRINFO (pddc); diff --git a/src/newgdi/gdi.c b/src/newgdi/gdi.c index 970865e1..17eba90c 100644 --- a/src/newgdi/gdi.c +++ b/src/newgdi/gdi.c @@ -560,8 +560,9 @@ int __mg_enter_drawing (PDC pdc) goto fail; #endif - if (!IntersectRect (&pdc->rc_output, &pdc->rc_output, &pdc->ecrgn.rcBound)) + if (!IntersectRect (&pdc->rc_output, &pdc->rc_output, &pdc->ecrgn.rcBound)) { goto fail; + } LOCK (&__mg_gdilock); if (!dc_IsMemDC (pdc))