aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/fb/fbwindow.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-04-01 12:04:34 +0000
committermarha <marha@users.sourceforge.net>2011-04-01 12:04:34 +0000
commit0fd309bfed8f9f61a8ea8bbbe7628d0af471c070 (patch)
tree97a335ffb903e9cf159322f3906f9cb71d660d9c /xorg-server/fb/fbwindow.c
parentdab40e0df33e80dab53b4ca20760c1fb4388649b (diff)
parent5d8e1ad0cd01de0bd0b43dc916c1d39fd293e79d (diff)
downloadvcxsrv-0fd309bfed8f9f61a8ea8bbbe7628d0af471c070.tar.gz
vcxsrv-0fd309bfed8f9f61a8ea8bbbe7628d0af471c070.tar.bz2
vcxsrv-0fd309bfed8f9f61a8ea8bbbe7628d0af471c070.zip
svn merge ^/branches/released .
Diffstat (limited to 'xorg-server/fb/fbwindow.c')
-rw-r--r--xorg-server/fb/fbwindow.c61
1 files changed, 20 insertions, 41 deletions
diff --git a/xorg-server/fb/fbwindow.c b/xorg-server/fb/fbwindow.c
index 92b23acdb..f4032b053 100644
--- a/xorg-server/fb/fbwindow.c
+++ b/xorg-server/fb/fbwindow.c
@@ -33,10 +33,8 @@ fbCreateWindow(WindowPtr pWin)
{
dixSetPrivate(&pWin->devPrivates, fbGetWinPrivateKey(),
fbGetScreenPixmap(pWin->drawable.pScreen));
-#ifdef FB_SCREEN_PRIVATE
if (pWin->drawable.bitsPerPixel == 32)
pWin->drawable.bitsPerPixel = fbGetScreenPrivate(pWin->drawable.pScreen)->win32bpp;
-#endif
return TRUE;
}
@@ -148,55 +146,36 @@ fbCopyWindow(WindowPtr pWin,
fbValidateDrawable (&pWin->drawable);
}
+static void
+fbFixupWindowPixmap(DrawablePtr pDrawable, PixmapPtr *ppPixmap)
+{
+ PixmapPtr pPixmap = *ppPixmap;
+
+ if (pPixmap->drawable.bitsPerPixel != pDrawable->bitsPerPixel)
+ {
+ pPixmap = fb24_32ReformatTile (pPixmap, pDrawable->bitsPerPixel);
+ if (!pPixmap)
+ return;
+ (*pDrawable->pScreen->DestroyPixmap) (*ppPixmap);
+ *ppPixmap = pPixmap;
+ }
+ if (FbEvenTile (pPixmap->drawable.width *
+ pPixmap->drawable.bitsPerPixel))
+ fbPadPixmap (pPixmap);
+}
+
Bool
fbChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
{
- PixmapPtr pPixmap;
-
if (mask & CWBackPixmap)
{
if (pWin->backgroundState == BackgroundPixmap)
- {
- pPixmap = pWin->background.pixmap;
-#ifdef FB_24_32BIT
- if (pPixmap->drawable.bitsPerPixel != pWin->drawable.bitsPerPixel)
- {
- pPixmap = fb24_32ReformatTile (pPixmap,
- pWin->drawable.bitsPerPixel);
- if (pPixmap)
- {
- (*pWin->drawable.pScreen->DestroyPixmap) (pWin->background.pixmap);
- pWin->background.pixmap = pPixmap;
- }
- }
-#endif
- if (FbEvenTile (pPixmap->drawable.width *
- pPixmap->drawable.bitsPerPixel))
- fbPadPixmap (pPixmap);
- }
+ fbFixupWindowPixmap(&pWin->drawable, &pWin->background.pixmap);
}
if (mask & CWBorderPixmap)
{
if (pWin->borderIsPixel == FALSE)
- {
- pPixmap = pWin->border.pixmap;
-#ifdef FB_24_32BIT
- if (pPixmap->drawable.bitsPerPixel !=
- pWin->drawable.bitsPerPixel)
- {
- pPixmap = fb24_32ReformatTile (pPixmap,
- pWin->drawable.bitsPerPixel);
- if (pPixmap)
- {
- (*pWin->drawable.pScreen->DestroyPixmap) (pWin->border.pixmap);
- pWin->border.pixmap = pPixmap;
- }
- }
-#endif
- if (FbEvenTile (pPixmap->drawable.width *
- pPixmap->drawable.bitsPerPixel))
- fbPadPixmap (pPixmap);
- }
+ fbFixupWindowPixmap(&pWin->drawable, &pWin->border.pixmap);
}
return TRUE;
}