From ed81992aeaf5b81aa9c4ee5e1491c43d7aa8862e Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sun, 10 Feb 2008 15:04:26 -0500 Subject: make rendertest exit cleanly when it is unmapped (iconify/desktopchange) --- render/test.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'render/test.c') diff --git a/render/test.c b/render/test.c index 307e2629..05416a3f 100644 --- a/render/test.c +++ b/render/test.c @@ -44,6 +44,7 @@ gint main() Window win; RrInstance *inst; RrAppearance *look; + int done; Window root; XEvent report; @@ -67,8 +68,10 @@ gint main() inst = RrInstanceNew(ob_display, ob_screen); look = RrAppearanceNew(inst, 0); - look->surface.grad = RR_SURFACE_PYRAMID; + look->surface.grad = RR_SURFACE_SPLIT_VERTICAL; look->surface.secondary = RrColorParse(inst, "Yellow"); + look->surface.split_secondary = RrColorParse(inst, "Red"); + look->surface.split_primary = RrColorParse(inst, "Green"); look->surface.primary = RrColorParse(inst, "Blue"); look->surface.interlaced = FALSE; if (ob_display == NULL) { @@ -77,7 +80,8 @@ gint main() } RrPaint(look, win, w, h); - while (1) { + done = 0; + while (!done) { XNextEvent(ob_display, &report); switch (report.type) { case Expose: @@ -87,8 +91,10 @@ gint main() report.xconfigure.width, report.xconfigure.height); break; + case UnmapNotify: + done = 1; + break; } - } RrAppearanceFree (look); -- cgit v1.2.3 From 9c729986844a65545f7736d053359ad24d2df120 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sun, 10 Feb 2008 18:08:05 -0500 Subject: a small optimization for the vertical gradients, and use the same log(n) strategy to use less memcpy's for filling out the horizontal gradients --- render/test.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'render/test.c') diff --git a/render/test.c b/render/test.c index 05416a3f..36c962da 100644 --- a/render/test.c +++ b/render/test.c @@ -68,7 +68,7 @@ gint main() inst = RrInstanceNew(ob_display, ob_screen); look = RrAppearanceNew(inst, 0); - look->surface.grad = RR_SURFACE_SPLIT_VERTICAL; + look->surface.grad = RR_SURFACE_MIRROR_HORIZONTAL; look->surface.secondary = RrColorParse(inst, "Yellow"); look->surface.split_secondary = RrColorParse(inst, "Red"); look->surface.split_primary = RrColorParse(inst, "Green"); @@ -79,6 +79,18 @@ gint main() return 0; } +#if BIGTEST + int i; + look->surface.pixel_data = g_new(RrPixel32, w*h); + for (i = 0; i < 10000; ++i) { + printf("\r%d", i); + fflush(stdout); + RrRender(look, w, h); + } + exit (0); +#endif + + RrPaint(look, win, w, h); done = 0; while (!done) { -- cgit v1.2.3