From 07a790e2841f94784841bce6cb7423c983ded0bd Mon Sep 17 00:00:00 2001 From: Vincent Wei Date: Mon, 3 Feb 2020 22:32:43 +0800 Subject: [PATCH] debug fallback compositor: on_dirty_ppp --- src/kernel/compsor-fallback.c | 31 ++++++++++++++++++++++++++----- src/kernel/compsor-manager.c | 4 ++++ 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/src/kernel/compsor-fallback.c b/src/kernel/compsor-fallback.c index f7a8ea33..44d2264e 100644 --- a/src/kernel/compsor-fallback.c +++ b/src/kernel/compsor-fallback.c @@ -475,6 +475,13 @@ static void on_showing_ppp (CompositorCtxt* ctxt, int zidx) InitClipRgn (rgn, &ctxt->cliprc_heap); ServerGetPopupMenuZNodeRegion (zidx, RGN_OP_SET | RGN_OP_FLAG_ABS, rgn); ServerSetPopupMenuZNodePrivateData (zidx, rgn); + + _DBG_PRINTF("Initial rcBound of ppp znode region: %d, %d, %d, %d\n", + rgn->rcBound.left, + rgn->rcBound.top, + rgn->rcBound.right, + rgn->rcBound.bottom); + SubtractClipRect (&ctxt->wins_rgn, &znode_hdr->rc); } else { @@ -497,7 +504,6 @@ static void on_dirty_ppp (CompositorCtxt* ctxt, int zidx) int i; InitClipRgn (&dirty_rgn, &ctxt->cliprc_heap); - ClipRgnCopy (&dirty_rgn, ppp_rgn); for (i = 0; i < znode_hdr->nr_dirty_rcs; i++) { RECT rc; @@ -505,14 +511,29 @@ static void on_dirty_ppp (CompositorCtxt* ctxt, int zidx) // convert device coordinates to screen coordinates rc = znode_hdr->dirty_rcs [i]; OffsetRect (&rc, znode_hdr->rc.left, znode_hdr->rc.top); - // intersect the dirty rect with dirty region. - IntersectClipRect (&dirty_rgn, &rc); - } + _DBG_PRINTF("dirty rect (%d) in the surface: %d, %d, %d, %d\n", i, + rc.left, + rc.top, + rc.right, + rc.bottom); - //SelectClipRegion (HDC_SCREEN_SYS, &dirty_rgn); + // Union the dirty rectangle into the dirty region. + AddClipRect (&dirty_rgn, &rc); + } + ClipRgnIntersect (&dirty_rgn, &dirty_rgn, ppp_rgn); + _DBG_PRINTF("rcBound of dirty region: %d, %d, %d, %d; size (%d x %d)\n", + dirty_rgn.rcBound.left, + dirty_rgn.rcBound.top, + dirty_rgn.rcBound.right, + dirty_rgn.rcBound.bottom, + RECTW(dirty_rgn.rcBound), RECTH(dirty_rgn.rcBound)); + + SelectClipRegion (HDC_SCREEN_SYS, &dirty_rgn); BitBlt (znode_hdr->mem_dc, 0, 0, RECTW (znode_hdr->rc), RECTH (znode_hdr->rc), HDC_SCREEN_SYS, znode_hdr->rc.left, znode_hdr->rc.top, 0); + SyncUpdateDC (HDC_SCREEN_SYS); + EmptyClipRgn (&dirty_rgn); } diff --git a/src/kernel/compsor-manager.c b/src/kernel/compsor-manager.c index 437d349f..78d4a8e4 100644 --- a/src/kernel/compsor-manager.c +++ b/src/kernel/compsor-manager.c @@ -56,6 +56,7 @@ #include #include +#define _DEBUG #include "common.h" #if defined(_MGRM_PROCESSES) && defined(_MGSCHEMA_COMPOSITING) @@ -144,6 +145,7 @@ void __mg_composite_dirty_znodes (void) if (changes_in_dc != nodes[i].changes) { ops->on_dirty_ppp (ctxt, i); nodes[i].changes = changes_in_dc; + pdc->surface->dirty_info->nr_dirty_rcs = 0; } } } @@ -160,6 +162,7 @@ void __mg_composite_dirty_znodes (void) if (changes_in_dc != nodes[next].changes) { ops->on_dirty_win (ctxt, next); nodes[next].changes = changes_in_dc; + pdc->surface->dirty_info->nr_dirty_rcs = 0; } } } @@ -172,6 +175,7 @@ void __mg_composite_dirty_znodes (void) if (changes_in_dc != nodes[0].changes) { ops->on_dirty_wpp (ctxt); nodes[0].changes = changes_in_dc; + pdc->surface->dirty_info->nr_dirty_rcs = 0; } } }