mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2026-09-26 03:23:46 +08:00
optimize composite_with_wallpaper
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user