summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorEamon Walsh <ewalsh@tycho.nsa.gov>2007-08-28 07:25:21 -0400
committerEamon Walsh <ewalsh@moss-charon.epoch.ncsc.mil>2007-08-28 07:25:21 -0400
commit85547073265ae9bc4ae3af920a6d3214fd1ca0c5 (patch)
tree2e720a9d55fe3cf65e735c8ce66866fb8c749d18 /render
parent860a09cfb8afc0a293c7eb5e01762724eb86847a (diff)
parent7d54399cfdaa7f54e28828267a76b89c4e8e798f (diff)
Merge branch 'master' into XACE-SELINUX
Conflicts: include/miscstruct.h mi/mibstore.c mi/midispcur.c os/Makefile.am
Diffstat (limited to 'render')
-rw-r--r--render/picture.c48
-rw-r--r--render/picture.h2
-rw-r--r--render/picturestr.h2
3 files changed, 26 insertions, 26 deletions
diff --git a/render/picture.c b/render/picture.c
index 5ddd68ce3..ede865f28 100644
--- a/render/picture.c
+++ b/render/picture.c
@@ -452,6 +452,28 @@ PictureFindVisual (ScreenPtr pScreen, VisualID visual)
}
Bool
+PictureInitIndexedFormat(ScreenPtr pScreen, PictFormatPtr format)
+{
+ PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
+
+ if (format->type != PictTypeIndexed || format->index.pColormap)
+ return TRUE;
+
+ if (format->index.vid == pScreen->rootVisual) {
+ format->index.pColormap =
+ (ColormapPtr) LookupIDByType(pScreen->defColormap, RT_COLORMAP);
+ } else {
+ VisualPtr pVisual = PictureFindVisual(pScreen, format->index.vid);
+ if (!CreateColormap(FakeClientID (0), pScreen, pVisual,
+ &format->index.pColormap, AllocNone, 0))
+ return FALSE;
+ }
+ if (!ps->InitIndexed(pScreen, format))
+ return FALSE;
+ return TRUE;
+}
+
+static Bool
PictureInitIndexedFormats (ScreenPtr pScreen)
{
PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
@@ -463,30 +485,8 @@ PictureInitIndexedFormats (ScreenPtr pScreen)
format = ps->formats;
nformat = ps->nformats;
while (nformat--)
- {
- if (format->type == PictTypeIndexed && !format->index.pColormap)
- {
- if (format->index.vid == pScreen->rootVisual)
- format->index.pColormap = (ColormapPtr) LookupIDByType(pScreen->defColormap,
- RT_COLORMAP);
- else
- {
- VisualPtr pVisual;
-
- pVisual = PictureFindVisual (pScreen, format->index.vid);
- if (CreateColormap (FakeClientID (0), pScreen,
- pVisual,
- &format->index.pColormap, AllocNone,
- 0) != Success)
- {
- return FALSE;
- }
- }
- if (!(*ps->InitIndexed) (pScreen, format))
- return FALSE;
- }
- format++;
- }
+ if (!PictureInitIndexedFormat(pScreen, format++))
+ return FALSE;
return TRUE;
}
diff --git a/render/picture.h b/render/picture.h
index 1719587a5..563a81b43 100644
--- a/render/picture.h
+++ b/render/picture.h
@@ -25,7 +25,7 @@
#ifndef _PICTURE_H_
#define _PICTURE_H_
-#include <pixman/pixman.h>
+#include <pixman.h>
typedef struct _DirectFormat *DirectFormatPtr;
typedef struct _PictFormat *PictFormatPtr;
diff --git a/render/picturestr.h b/render/picturestr.h
index 01572ec48..005c58808 100644
--- a/render/picturestr.h
+++ b/render/picturestr.h
@@ -449,7 +449,7 @@ void
PictureStoreColors (ColormapPtr pColormap, int ndef, xColorItem *pdef);
Bool
-PictureInitIndexedFormats (ScreenPtr pScreen);
+PictureInitIndexedFormat (ScreenPtr pScreen, PictFormatPtr format);
Bool
PictureSetSubpixelOrder (ScreenPtr pScreen, int subpixel);