summaryrefslogtreecommitdiff
path: root/render/picture.c
diff options
context:
space:
mode:
Diffstat (limited to 'render/picture.c')
-rw-r--r--render/picture.c66
1 files changed, 24 insertions, 42 deletions
diff --git a/render/picture.c b/render/picture.c
index 5ddd68ce3..a7e40f994 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;
}
@@ -1768,24 +1768,6 @@ CompositePicture (CARD8 op,
}
void
-CompositeGlyphs (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc,
- INT16 ySrc,
- int nlist,
- GlyphListPtr lists,
- GlyphPtr *glyphs)
-{
- PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen);
-
- ValidatePicture (pSrc);
- ValidatePicture (pDst);
- (*ps->Glyphs) (op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, lists, glyphs);
-}
-
-void
CompositeRects (CARD8 op,
PicturePtr pDst,
xRenderColor *color,