diff options
author | Sultan Alsawaf <sultan@kerneltoast.com> | 2022-12-03 18:35:23 -0800 |
---|---|---|
committer | Sultan Alsawaf <sultan@kerneltoast.com> | 2022-12-19 23:56:27 -0800 |
commit | 08183c66e8b08b82152f77c40e38ce48ecfd9902 (patch) | |
tree | 1b97268b2a6596832cdd1388cb2b99f92ce8f46b | |
parent | bb1711b7fba42f2a0c7d1c09beee241a1b2bcc30 (diff) | |
download | xserver-08183c66e8b08b82152f77c40e38ce48ecfd9902.tar.gz |
pixmap: make PixmapDirtyCopyArea public
PixmapDirtyCopyArea() is about to be used outside of pixmap.c, so fix up
its interface by specifying the dirty area directly rather than passing a
`PixmapDirtyUpdatePtr`. This makes it easier to use outside of pixmap.c, as
the caller doesn't need to create a bulky PixmapDirtyUpdateRec to use this
function.
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
-rw-r--r-- | dix/pixmap.c | 15 | ||||
-rw-r--r-- | include/pixmap.h | 5 |
2 files changed, 12 insertions, 8 deletions
diff --git a/dix/pixmap.c b/dix/pixmap.c index 5a0146bbb..0b01c4ee0 100644 --- a/dix/pixmap.c +++ b/dix/pixmap.c @@ -262,12 +262,11 @@ PixmapStopDirtyTracking(DrawablePtr src, PixmapPtr secondary_dst) return TRUE; } -static void -PixmapDirtyCopyArea(PixmapPtr dst, - PixmapDirtyUpdatePtr dirty, +void +PixmapDirtyCopyArea(PixmapPtr dst, DrawablePtr src, + int x, int y, int dst_x, int dst_y, RegionPtr dirty_region) { - DrawablePtr src = dirty->src; ScreenPtr pScreen = src->pScreen; int n; BoxPtr b; @@ -294,9 +293,8 @@ PixmapDirtyCopyArea(PixmapPtr dst, h = dst_box.y2 - dst_box.y1; pGC->ops->CopyArea(src, &dst->drawable, pGC, - dirty->x + dst_box.x1, dirty->y + dst_box.y1, w, h, - dirty->dst_x + dst_box.x1, - dirty->dst_y + dst_box.y1); + x + dst_box.x1, y + dst_box.y1, w, h, + dst_x + dst_box.x1, dst_y + dst_box.y1); b++; } FreeScratchGC(pGC); @@ -408,7 +406,8 @@ Bool PixmapSyncDirtyHelper(PixmapDirtyUpdatePtr dirty) RegionTranslate(&pixregion, -dirty->x, -dirty->y); if (!pScreen->root || dirty->rotation == RR_Rotate_0) - PixmapDirtyCopyArea(dst, dirty, &pixregion); + PixmapDirtyCopyArea(dst, dirty->src, dirty->x, dirty->y, + dirty->dst_x, dirty->dst_y, &pixregion); else PixmapDirtyCompositeRotate(dst, dirty, &pixregion); pScreen->SourceValidate = SourceValidate; diff --git a/include/pixmap.h b/include/pixmap.h index 7144bfb30..e251690d5 100644 --- a/include/pixmap.h +++ b/include/pixmap.h @@ -134,4 +134,9 @@ PixmapStopDirtyTracking(DrawablePtr src, PixmapPtr slave_dst); extern _X_EXPORT Bool PixmapSyncDirtyHelper(PixmapDirtyUpdatePtr dirty); +extern _X_EXPORT void +PixmapDirtyCopyArea(PixmapPtr dst, DrawablePtr src, + int x, int y, int dst_x, int dst_y, + RegionPtr dirty_region); + #endif /* PIXMAP_H */ |