optimize composite_with_wallpaper

This commit is contained in:
Vincent Wei
2020-01-20 12:14:24 +08:00
parent 5840f4f1a8
commit 9b48b966cf
+9 -4
View File
@@ -121,7 +121,7 @@ static void composite_with_wallpaper (CompositorCtxt* ctxt,
int wp_w = GetGDCapability (HDC_SCREEN, GDCAP_HPIXEL);
int wp_h = GetGDCapability (HDC_SCREEN, GDCAP_VPIXEL);
SelectClipRect (HDC_SCREEN_SYS, dirty_rc);
//SelectClipRect (HDC_SCREEN_SYS, dirty_rc);
if (wp_w > 0 && wp_h > 0) {
// tile the wallpaper pattern
@@ -132,7 +132,13 @@ static void composite_with_wallpaper (CompositorCtxt* ctxt,
int x = 0;
int left_w = RECTW (ctxt->rc_screen);
while (left_w > 0) {
BitBlt (HDC_SCREEN, 0, 0, wp_w, wp_h, HDC_SCREEN_SYS, x, y, 0);
RECT rc = { x, y, x + wp_w, y + wp_h };
if (IntersectRect (&rc, dirty_rc, &rc)) {
BitBlt (HDC_SCREEN,
rc.left - dirty_rc->left, rc.top - dirty_rc->top,
RECTW (rc), RECTH (rc),
HDC_SCREEN_SYS, rc.left, rc.top, 0);
}
x += wp_w;
left_w -= wp_w;
@@ -256,8 +262,7 @@ static void on_dirty_win (CompositorCtxt* ctxt,
SetClipRgn (&ctxt->dirty_rgn, &ctxt->rc_screen);
}
SelectClipRect (HDC_SCREEN_SYS, &ctxt->rc_screen);
//SelectClipRect (HDC_SCREEN_SYS, &ctxt->rc_screen);
IntersectRegion (&ctxt->comps_rgn, &ctxt->dirty_rgn, &ctxt->wins_rgn);
EmptyClipRgn (&ctxt->dirty_rgn);