diff options
author | Jordan Justen <jordan.l.justen@intel.com> | 2015-01-04 18:40:41 -0800 |
---|---|---|
committer | Jordan Justen <jordan.l.justen@intel.com> | 2015-01-30 23:10:10 -0800 |
commit | ebf387e16dfaa89c8ca645adb5669261d627e164 (patch) | |
tree | 19e5740516222084a368cfb3e854247fb4f5e448 | |
parent | 664ec1db019fd9623ee5f3343c9ed11e05fba5d7 (diff) |
gbm: Use caca_flop to vertically flop the output
Ken pointed out cucul_flop in the original libcaca patch, but going
back to 2008-09-27, r2821,
http://caca.zoy.org/browser/libcaca/trunk/caca/caca.h?rev=2821#L251
caca_flop seems to be preferred.
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
-rw-r--r-- | tests/util/piglit-framework-gl/piglit_gbm_framework.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/tests/util/piglit-framework-gl/piglit_gbm_framework.c b/tests/util/piglit-framework-gl/piglit_gbm_framework.c index 8728f5897..3c42fba6b 100644 --- a/tests/util/piglit-framework-gl/piglit_gbm_framework.c +++ b/tests/util/piglit-framework-gl/piglit_gbm_framework.c @@ -110,7 +110,6 @@ piglit_gbm_console_display(void) uint32_t *pixels; size_t export_size; int width = 40, height = 20; - int i; canvas = caca_create_canvas(width, height); if (!canvas) { @@ -130,8 +129,7 @@ piglit_gbm_console_display(void) return; } - /* Note: we allocate memory for 1 extra row */ - pixels = malloc(4 * piglit_width * (piglit_height + 1)); + pixels = malloc(4 * piglit_width * piglit_height); while (!piglit_check_gl_error(GL_NO_ERROR)) { /* Clear any OpenGL errors */ @@ -146,22 +144,8 @@ piglit_gbm_console_display(void) return; } - /* Swap the image's pixels vertically using the extra - * row of pixels that we allocated as swap space. - */ - for (i = 0; i < (piglit_height / 2); i++) { - memcpy(&pixels[piglit_width * piglit_height], - &pixels[piglit_width * i], - 4 * piglit_width); - memcpy(&pixels[piglit_width * i], - &pixels[piglit_width * (piglit_height - 1 - i)], - 4 * piglit_width); - memcpy(&pixels[piglit_width * (piglit_height - 1 - i)], - &pixels[piglit_width * piglit_height], - 4 * piglit_width); - } - caca_dither_bitmap(canvas, 0, 0, width, height, dither, pixels); + caca_flop(canvas); caca_free_dither(dither); free(pixels); |