summaryrefslogtreecommitdiff
path: root/common/pixmaputil.c
blob: d03918fc46260d7a3c2c96173f7652a098ce78ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "pixmaputil.h"

PixmapPtr drawable_pixmap_offset(DrawablePtr pDrawable, xPoint *offset)
{
	PixmapPtr pPixmap;

	offset->x = 0;
	offset->y = 0;
	if (OnScreenDrawable(pDrawable->type)) {
		WindowPtr pWin;

		pWin = container_of(pDrawable, struct _Window, drawable);

		pPixmap = pDrawable->pScreen->GetWindowPixmap(pWin);
#ifdef COMPOSITE
		offset->x = -pPixmap->screen_x;
		offset->y = -pPixmap->screen_y;
#endif
	} else {
		pPixmap = container_of(pDrawable, struct _Pixmap, drawable);
	}
	return pPixmap;
}