summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2014-05-23 12:25:20 -0700
committerEric Anholt <eric@anholt.net>2014-06-15 22:49:39 +0100
commitc4e95b97f8a72c22d21f843963fc9bab13fb29e4 (patch)
tree8200f2875d4b860f28a68066be203269b66bec70
parentcd1d942f20943bab48859be78bc87a5801d3d01e (diff)
uxa: use glamor_destroy_gc when available
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--src/uxa/uxa.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/src/uxa/uxa.c b/src/uxa/uxa.c
index c8d79002..b14cd8f0 100644
--- a/src/uxa/uxa.c
+++ b/src/uxa/uxa.c
@@ -271,14 +271,27 @@ set_ops:
pGC->ops = (GCOps *) & uxa_ops;
}
+static void
+uxa_destroy_gc(GCPtr gc)
+{
+#if HAS_GLAMOR_DESTROY_GC
+ uxa_screen_t *uxa_screen = uxa_get_screen(gc->pScreen);
+ if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
+ glamor_destroy_gc(gc);
+ return;
+ }
+#endif
+ miDestroyGC(gc);
+}
+
static GCFuncs uxaGCFuncs = {
- uxa_validate_gc,
- miChangeGC,
- miCopyGC,
- miDestroyGC,
- miChangeClip,
- miDestroyClip,
- miCopyClip
+ .ValidateGC = uxa_validate_gc,
+ .ChangeGC = miChangeGC,
+ .CopyGC = miCopyGC,
+ .DestroyGC = uxa_destroy_gc,
+ .ChangeClip = miChangeClip,
+ .DestroyClip = miDestroyClip,
+ .CopyClip = miCopyClip
};
/**