mirror of
https://github.com/kasmtech/KasmVNC.git
synced 2024-11-28 19:14:14 +01:00
Handle empty changes for every operation
It seems like many of the X11 operations can end up with no pixels actually changing. So instead of discovering and adding workarounds for each individually we'll just check very region added if it's empty.
This commit is contained in:
parent
a4e0dbf7db
commit
a00e40c340
@ -388,6 +388,8 @@ static inline void add_changed(ScreenPtr pScreen, RegionPtr reg)
|
||||
vncHooksScreenPtr vncHooksScreen = vncHooksScreenPrivate(pScreen);
|
||||
if (vncHooksScreen->ignoreHooks)
|
||||
return;
|
||||
if (REGION_NIL(reg))
|
||||
return;
|
||||
vncAddChanged(pScreen->myNum,
|
||||
(const struct UpdateRect*)REGION_EXTENTS(pScreen, reg),
|
||||
REGION_NUM_RECTS(reg),
|
||||
@ -400,6 +402,8 @@ static inline void add_copied(ScreenPtr pScreen, RegionPtr dst,
|
||||
vncHooksScreenPtr vncHooksScreen = vncHooksScreenPrivate(pScreen);
|
||||
if (vncHooksScreen->ignoreHooks)
|
||||
return;
|
||||
if (REGION_NIL(dst))
|
||||
return;
|
||||
vncAddCopied(pScreen->myNum,
|
||||
(const struct UpdateRect*)REGION_EXTENTS(pScreen, dst),
|
||||
REGION_NUM_RECTS(dst),
|
||||
@ -562,7 +566,6 @@ static void vncHooksCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg,
|
||||
|
||||
(*pScreen->CopyWindow) (pWin, ptOldOrg, pOldRegion);
|
||||
|
||||
if (REGION_NOTEMPTY(pScreen, &copied))
|
||||
add_copied(pScreen, &copied, dx, dy);
|
||||
|
||||
REGION_UNINIT(pScreen, &copied);
|
||||
@ -807,7 +810,6 @@ static void vncHooksComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask,
|
||||
(*ps->Composite)(op, pSrc, pMask, pDst, xSrc, ySrc,
|
||||
xMask, yMask, xDst, yDst, width, height);
|
||||
|
||||
if (REGION_NOTEMPTY(pScreen, &changed))
|
||||
add_changed(pScreen, &changed);
|
||||
|
||||
REGION_UNINIT(pScreen, &changed);
|
||||
@ -896,7 +898,6 @@ static void vncHooksGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
|
||||
|
||||
(*ps->Glyphs)(op, pSrc, pDst, maskFormat, xSrc, ySrc, nlists, lists, glyphs);
|
||||
|
||||
if (REGION_NOTEMPTY(pScreen, changed))
|
||||
add_changed(pScreen, changed);
|
||||
|
||||
REGION_DESTROY(pScreen, changed);
|
||||
@ -919,7 +920,6 @@ static void vncHooksCompositeRects(CARD8 op, PicturePtr pDst,
|
||||
|
||||
(*ps->CompositeRects)(op, pDst, color, nRect, rects);
|
||||
|
||||
if (REGION_NOTEMPTY(pScreen, changed))
|
||||
add_changed(pScreen, changed);
|
||||
|
||||
REGION_DESTROY(pScreen, changed);
|
||||
@ -987,7 +987,6 @@ static void vncHooksTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
|
||||
|
||||
(*ps->Trapezoids)(op, pSrc, pDst, maskFormat, xSrc, ySrc, ntrap, traps);
|
||||
|
||||
if (REGION_NOTEMPTY(pScreen, &changed))
|
||||
add_changed(pScreen, &changed);
|
||||
|
||||
REGION_UNINIT(pScreen, &changed);
|
||||
@ -1053,7 +1052,6 @@ static void vncHooksTriangles(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
|
||||
|
||||
(*ps->Triangles)(op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris);
|
||||
|
||||
if (REGION_NOTEMPTY(pScreen, &changed))
|
||||
add_changed(pScreen, &changed);
|
||||
|
||||
REGION_UNINIT(pScreen, &changed);
|
||||
@ -1114,7 +1112,6 @@ static void vncHooksTriStrip(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
|
||||
|
||||
(*ps->TriStrip)(op, pSrc, pDst, maskFormat, xSrc, ySrc, npoint, points);
|
||||
|
||||
if (REGION_NOTEMPTY(pScreen, &changed))
|
||||
add_changed(pScreen, &changed);
|
||||
|
||||
REGION_UNINIT(pScreen, &changed);
|
||||
@ -1173,7 +1170,6 @@ static void vncHooksTriFan(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
|
||||
|
||||
(*ps->TriFan)(op, pSrc, pDst, maskFormat, xSrc, ySrc, npoint, points);
|
||||
|
||||
if (REGION_NOTEMPTY(pScreen, &changed))
|
||||
add_changed(pScreen, &changed);
|
||||
|
||||
REGION_UNINIT(pScreen, &changed);
|
||||
@ -1495,12 +1491,10 @@ static RegionPtr vncHooksCopyArea(DrawablePtr pSrc, DrawablePtr pDst,
|
||||
|
||||
ret = (*pGC->ops->CopyArea) (pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty);
|
||||
|
||||
if (REGION_NOTEMPTY(pScreen, &dst))
|
||||
add_copied(pGC->pScreen, &dst,
|
||||
dstx + pDst->x - srcx - pSrc->x,
|
||||
dsty + pDst->y - srcy - pSrc->y);
|
||||
|
||||
if (REGION_NOTEMPTY(pScreen, &changed))
|
||||
add_changed(pGC->pScreen, &changed);
|
||||
|
||||
REGION_UNINIT(pGC->pScreen, &dst);
|
||||
|
Loading…
Reference in New Issue
Block a user