xwayland: Make copy_pixmap_area return void
GetScratchGC can't really fail without a bug elsewhere. Just FatalError in that case, so we'd get a bug report if it ever happens, instead of trying to limp along.
This commit is contained in:
parent
d1bbf82d72
commit
114f060de5
|
@ -45,27 +45,24 @@ struct xwl_window_buffer {
|
||||||
struct xorg_list link_buffer;
|
struct xorg_list link_buffer;
|
||||||
};
|
};
|
||||||
|
|
||||||
static Bool
|
static void
|
||||||
copy_pixmap_area(PixmapPtr src_pixmap, PixmapPtr dst_pixmap,
|
copy_pixmap_area(PixmapPtr src_pixmap, PixmapPtr dst_pixmap,
|
||||||
int x, int y, int width, int height)
|
int x, int y, int width, int height)
|
||||||
{
|
{
|
||||||
GCPtr pGC;
|
GCPtr pGC;
|
||||||
pGC = GetScratchGC(dst_pixmap->drawable.depth,
|
pGC = GetScratchGC(dst_pixmap->drawable.depth,
|
||||||
dst_pixmap->drawable.pScreen);
|
dst_pixmap->drawable.pScreen);
|
||||||
if (pGC) {
|
if (!pGC)
|
||||||
ValidateGC(&dst_pixmap->drawable, pGC);
|
FatalError("GetScratchGC failed for depth %d", dst_pixmap->drawable.depth);
|
||||||
(void) (*pGC->ops->CopyArea) (&src_pixmap->drawable,
|
|
||||||
&dst_pixmap->drawable,
|
|
||||||
pGC,
|
|
||||||
x, y,
|
|
||||||
width, height,
|
|
||||||
x, y);
|
|
||||||
FreeScratchGC(pGC);
|
|
||||||
|
|
||||||
return TRUE;
|
ValidateGC(&dst_pixmap->drawable, pGC);
|
||||||
}
|
(void) (*pGC->ops->CopyArea) (&src_pixmap->drawable,
|
||||||
|
&dst_pixmap->drawable,
|
||||||
return FALSE;
|
pGC,
|
||||||
|
x, y,
|
||||||
|
width, height,
|
||||||
|
x, y);
|
||||||
|
FreeScratchGC(pGC);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct xwl_window_buffer *
|
static struct xwl_window_buffer *
|
||||||
|
@ -317,13 +314,12 @@ xwl_window_buffers_get_pixmap(struct xwl_window *xwl_window,
|
||||||
BoxPtr pBox = RegionRects(full_damage);
|
BoxPtr pBox = RegionRects(full_damage);
|
||||||
int nBox = RegionNumRects(full_damage);
|
int nBox = RegionNumRects(full_damage);
|
||||||
while (nBox--) {
|
while (nBox--) {
|
||||||
if (!copy_pixmap_area(window_pixmap,
|
copy_pixmap_area(window_pixmap,
|
||||||
xwl_window_buffer->pixmap,
|
xwl_window_buffer->pixmap,
|
||||||
pBox->x1 + xwl_window->window->borderWidth,
|
pBox->x1 + xwl_window->window->borderWidth,
|
||||||
pBox->y1 + xwl_window->window->borderWidth,
|
pBox->y1 + xwl_window->window->borderWidth,
|
||||||
pBox->x2 - pBox->x1,
|
pBox->x2 - pBox->x1,
|
||||||
pBox->y2 - pBox->y1))
|
pBox->y2 - pBox->y1);
|
||||||
return window_pixmap;
|
|
||||||
|
|
||||||
pBox++;
|
pBox++;
|
||||||
}
|
}
|
||||||
|
@ -345,14 +341,11 @@ xwl_window_buffers_get_pixmap(struct xwl_window *xwl_window,
|
||||||
if (!xwl_window_buffer->pixmap)
|
if (!xwl_window_buffer->pixmap)
|
||||||
return window_pixmap;
|
return window_pixmap;
|
||||||
|
|
||||||
if (!copy_pixmap_area(window_pixmap,
|
copy_pixmap_area(window_pixmap,
|
||||||
xwl_window_buffer->pixmap,
|
xwl_window_buffer->pixmap,
|
||||||
0, 0,
|
0, 0,
|
||||||
window_pixmap->drawable.width,
|
window_pixmap->drawable.width,
|
||||||
window_pixmap->drawable.height)) {
|
window_pixmap->drawable.height);
|
||||||
xwl_window_buffer_recycle(xwl_window_buffer);
|
|
||||||
return window_pixmap;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RegionEmpty(xwl_window_buffer->damage_region);
|
RegionEmpty(xwl_window_buffer->damage_region);
|
||||||
|
|
Loading…
Reference in New Issue