summaryrefslogtreecommitdiff
path: root/uxa
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-06-07 00:16:18 +0100
committerOwain G. Ainsworth <oga@openbsd.org>2010-06-07 21:10:06 +0100
commitcafcbe45c5645b4db5dd87092e08b5bcf28423f5 (patch)
treef14fb7c0be4aa260696fd3ec186e8850d6d2e662 /uxa
parent34ce21b8537a1873b70437b273f3d6b46ed5b443 (diff)
Adapt glyphs for changes in devPrivates API
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Owain G. Ainsworth <oga@openbsd.org>
Diffstat (limited to 'uxa')
-rw-r--r--uxa/uxa-glyphs.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/uxa/uxa-glyphs.c b/uxa/uxa-glyphs.c
index e6d87bd9..63a0270b 100644
--- a/uxa/uxa-glyphs.c
+++ b/uxa/uxa-glyphs.c
@@ -84,16 +84,24 @@ struct uxa_glyph {
uint16_t size, pos;
};
-static int uxa_glyph_index;
+#if HAS_DEVPRIVATEKEYREC
+static DevPrivateKeyRec uxa_glyph_key;
+#else
+static int uxa_glyph_key;
+#endif
static inline struct uxa_glyph *uxa_glyph_get_private(GlyphPtr glyph)
{
- return dixLookupPrivate(&glyph->devPrivates, &uxa_glyph_index);
+#if HAS_DEVPRIVATEKEYREC
+ return dixGetPrivate(&glyph->devPrivates, &uxa_glyph_key);
+#else
+ return dixLookupPrivate(&glyph->devPrivates, &uxa_glyph_key);
+#endif
}
static inline void uxa_glyph_set_private(GlyphPtr glyph, struct uxa_glyph *priv)
{
- dixSetPrivate(&glyph->devPrivates, &uxa_glyph_index, priv);
+ dixSetPrivate(&glyph->devPrivates, &uxa_glyph_key, priv);
}
#define NeedsComponent(f) (PICT_FORMAT_A(f) != 0 && PICT_FORMAT_RGB(f) != 0)
@@ -189,8 +197,20 @@ bail:
Bool uxa_glyphs_init(ScreenPtr pScreen)
{
- if (!dixRequestPrivate(&uxa_glyph_index, 0))
+ /* We are trying to initialise per screen resources prior to the
+ * complete initialisation of the screen. So ensure the components
+ * that we depend upon are initialsed prior to our use.
+ */
+ if (!CreateScratchPixmapsForScreen(pScreen->myNum))
+ return FALSE;
+
+#if HAS_DIXREGISTERPRIVATEKEY
+ if (!dixRegisterPrivateKey(&uxa_glyph_key, PRIVATE_GLYPH, 0))
+ return FALSE;
+#else
+ if (!dixRequestPrivate(&uxa_glyph_key, 0))
return FALSE;
+#endif
if (!uxa_realize_glyph_caches(pScreen))
return FALSE;