Gfxprim
Threads by month
- ----- 2026 -----
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- 929 discussions
[repo.or.cz] gfxprim.git branch master updated: 4128a845f099a7902414cfe3314a61bcff9b60c8
by metan 25 Nov '12
by metan 25 Nov '12
25 Nov '12
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project gfxprim.git.
The branch, master has been updated
via 4128a845f099a7902414cfe3314a61bcff9b60c8 (commit)
via feddd1c185068f220e394cc7ec34ff3f0e6b5801 (commit)
via cd4e4016c7c2bd7293eec6d9cc99e3355cc8dd38 (commit)
from 7064952e38373799deaae59b2ea67093d75b3709 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/w/gfxprim.git/commit/4128a845f099a7902414cfe3314a61bcff9b…
commit 4128a845f099a7902414cfe3314a61bcff9b60c8
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Sun Nov 25 22:33:29 2012 +0100
tests: Finally get rid of obsolete SDL tests.
diff --git a/tests/Makefile b/tests/Makefile
index 7a0ad0d..71b1004 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -1,7 +1,7 @@
TOPDIR=..
include $(TOPDIR)/pre.mk
-SUBDIRS=core SDL drivers framework loaders gfx filters
+SUBDIRS=core drivers framework loaders gfx filters
loaders: framework
gfx: framework
diff --git a/tests/SDL/Makefile b/tests/SDL/Makefile
deleted file mode 100644
index ce12dcb..0000000
--- a/tests/SDL/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-TOPDIR=../..
-include $(TOPDIR)/pre.mk
-
-INCLUDE=core gfx SDL backends
-LDLIBS+=-lGP -L$(TOPDIR)/build/ -lGP_SDL -lSDL
-
-ifeq ($(HAVE_LIBSDL),yes)
-CSOURCES=$(shell echo *.c)
-
-APPS=textaligntest subcontext- mixpixeltest
-endif
-
-include $(TOPDIR)/app.mk
-include $(TOPDIR)/post.mk
diff --git a/tests/SDL/mixpixeltest.c b/tests/SDL/mixpixeltest.c
deleted file mode 100644
index 0f0d179..0000000
--- a/tests/SDL/mixpixeltest.c
+++ /dev/null
@@ -1,228 +0,0 @@
-/*****************************************************************************
- * This file is part of gfxprim library. *
- * *
- * Gfxprim is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU Lesser General Public *
- * License as published by the Free Software Foundation; either *
- * version 2.1 of the License, or (at your option) any later version. *
- * *
- * Gfxprim is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with gfxprim; if not, write to the Free Software *
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
- * Boston, MA 02110-1301 USA *
- * *
- * Copyright (C) 2009-2012 Cyril Hrubis <metan(a)ucw.cz> *
- * *
- *****************************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <SDL/SDL.h>
-
-#include "GP.h"
-#include "GP_SDL.h"
-
-/* The surface used as a display (in fact it is a software surface). */
-SDL_Surface *display = NULL;
-GP_Context context;
-
-/* Timer used for refreshing the display */
-SDL_TimerID timer;
-
-/* An event used for signaling that the timer was triggered. */
-SDL_UserEvent timer_event;
-
-/* Values for color pixels in display format. */
-GP_Pixel red_pixel, green_pixel, blue_pixel, white_pixel;
-
-Uint32 timer_callback(__attribute__((unused)) Uint32 interval,
- __attribute__((unused)) void *param)
-{
- timer_event.type = SDL_USEREVENT;
- SDL_PushEvent((SDL_Event *) &timer_event);
- return 0;
-}
-
-void draw_pixels(void)
-{
- unsigned int i, j, k;
-
- GP_FillRect(&context, 0, 0, context.w, 120, white_pixel);
-
- unsigned int y = 20;
-
- for (i = 0; i <= 256; i++) {
- GP_MixPixel_Raw(&context, i + 20, y + 0, 0, i);
- GP_MixPixel_Raw(&context, i + 20, y + 1, 0, i);
- GP_MixPixel_Raw(&context, i + 20, y + 2, 0, i);
- GP_MixPixel_Raw(&context, i + 20, y + 3, 0, i);
- GP_MixPixel_Raw(&context, i + 20, y + 4, 0, i);
-
- GP_MixPixel_Raw(&context, i + 20, y + 5, red_pixel, i);
- GP_MixPixel_Raw(&context, i + 20, y + 6, red_pixel, i);
- GP_MixPixel_Raw(&context, i + 20, y + 7, red_pixel, i);
-
- GP_MixPixel_Raw(&context, i + 20, y + 8, green_pixel, i);
- GP_MixPixel_Raw(&context, i + 20, y + 9, green_pixel, i);
- GP_MixPixel_Raw(&context, i + 20, y + 10, green_pixel, i);
-
- GP_MixPixel_Raw(&context, i + 20, y + 11, blue_pixel, i);
- GP_MixPixel_Raw(&context, i + 20, y + 12, blue_pixel, i);
- GP_MixPixel_Raw(&context, i + 20, y + 13, blue_pixel, i);
-
-
- if (i % 16 == 0)
- GP_PutPixel(&context, i + 20, y + 14, 0);
-
- if (i % 32 == 0)
- GP_PutPixel(&context, i + 20, y + 15, 0);
-
- if (i % 64 == 0) {
- GP_PutPixel(&context, i + 20, y + 16, 0);
- GP_Print(&context, NULL, i + 20, y + 20,
- GP_ALIGN_CENTER | GP_VALIGN_BELOW,
- 0, 0, "%u", i);
- }
-
- if (i % 128 == 0)
- GP_PutPixel(&context, i + 20, y + 17, 0);
- }
-
- for (i = 0; i < 7; i++)
- for (j = 0; j < 32; j++)
- for (k = 0; k < 32; k++)
- GP_MixPixel_Raw(&context, (225 * i) / 6 + j + 20,
- y + k + 40, 0, (255 * i) / 6);
-
- y = 140;
-
- for (i = 0; i <= 256; i++) {
- GP_MixPixel_Raw(&context, i + 20, y + 0, white_pixel, i);
- GP_MixPixel_Raw(&context, i + 20, y + 1, white_pixel, i);
- GP_MixPixel_Raw(&context, i + 20, y + 2, white_pixel, i);
- GP_MixPixel_Raw(&context, i + 20, y + 3, white_pixel, i);
- GP_MixPixel_Raw(&context, i + 20, y + 4, white_pixel, i);
-
- GP_MixPixel_Raw(&context, i + 20, y + 5, red_pixel, i);
- GP_MixPixel_Raw(&context, i + 20, y + 6, red_pixel, i);
- GP_MixPixel_Raw(&context, i + 20, y + 7, red_pixel, i);
-
- GP_MixPixel_Raw(&context, i + 20, y + 8, green_pixel, i);
- GP_MixPixel_Raw(&context, i + 20, y + 9, green_pixel, i);
- GP_MixPixel_Raw(&context, i + 20, y + 10, green_pixel, i);
-
- GP_MixPixel_Raw(&context, i + 20, y + 11, blue_pixel, i);
- GP_MixPixel_Raw(&context, i + 20, y + 12, blue_pixel, i);
- GP_MixPixel_Raw(&context, i + 20, y + 13, blue_pixel, i);
-
- if (i % 16 == 0)
- GP_PutPixel(&context, i + 20, y + 14, white_pixel);
-
- if (i % 32 == 0)
- GP_PutPixel(&context, i + 20, y + 15, white_pixel);
-
- if (i % 64 == 0) {
- GP_PutPixel(&context, i + 20, y + 16, white_pixel);
- GP_Print(&context, NULL, i + 20, y + 20,
- GP_ALIGN_CENTER | GP_VALIGN_BELOW,
- white_pixel, 0, "%u", i);
- }
-
- if (i % 128 == 0)
- GP_PutPixel(&context, i + 20, y + 17, white_pixel);
- }
-
- for (i = 0; i < 7; i++)
- for (j = 0; j < 32; j++)
- for (k = 0; k < 32; k++)
- GP_MixPixel_Raw(&context, (225 * i) / 6 + j + 20,
- y + k + 40, white_pixel, (255 * i) / 6);
-
-}
-
-void event_loop(void)
-{
- SDL_Event event;
-
- while (SDL_WaitEvent(&event) > 0) {
- switch (event.type) {
- case SDL_USEREVENT:
- draw_pixels();
- SDL_Flip(display);
- break;
- case SDL_KEYDOWN:
- case SDL_QUIT:
- return;
- }
- }
-}
-
-int main(int argc, char **argv)
-{
- int display_bpp = 0;
-
- int i;
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-16") == 0) {
- display_bpp = 16;
- } else if (strcmp(argv[i], "-24") == 0) {
- display_bpp = 24;
- }
- }
-
- /* Initialize SDL */
- if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) != 0) {
- fprintf(stderr, "Could not initialize SDL: %sn", SDL_GetError());
- return 1;
- }
-
- /* Create a window with a software back surface */
- display = SDL_SetVideoMode(320, 240, display_bpp, SDL_SWSURFACE);
- if (display == NULL) {
- fprintf(stderr, "Could not open display: %sn", SDL_GetError());
- goto fail;
- }
-
-
- /* Print basic information about the surface */
- printf("Display surface properties:n");
- printf(" width: %4d, height: %4d, pitch: %4dn",
- display->w, display->h, display->pitch);
- printf(" bits per pixel: %2d, bytes per pixel: %2dn",
- display->format->BitsPerPixel, display->format->BytesPerPixel);
-
- /* Set up a clipping rectangle to test proper clipping of pixels */
- SDL_Rect clip_rect = {10, 10, 300, 220};
- SDL_SetClipRect(display, &clip_rect);
-
- GP_SDL_ContextFromSurface(&context, display);
-
- /* Load pixel values compatible with the display. */
- red_pixel = GP_ColorToContextPixel(GP_COL_RED, &context);
- green_pixel = GP_ColorToContextPixel(GP_COL_GREEN, &context);
- blue_pixel = GP_ColorToContextPixel(GP_COL_BLUE, &context);
- white_pixel = GP_ColorToContextPixel(GP_COL_WHITE, &context);
-
- /* Set up the refresh timer */
- timer = SDL_AddTimer(30, timer_callback, NULL);
- if (timer == 0) {
- fprintf(stderr, "Could not set up timer: %sn", SDL_GetError());
- goto fail;
- }
-
- /* Enter the event loop */
- event_loop();
-
- /* We're done */
- SDL_Quit();
- return 0;
-
-fail:
- SDL_Quit();
- return 1;
-}
diff --git a/tests/SDL/runtest.sh b/tests/SDL/runtest.sh
deleted file mode 100755
index 163c76c..0000000
--- a/tests/SDL/runtest.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-#
-# Run dynamically linked test.
-#
-
-PROG="$1"
-shift
-
-echo "LD_LIBRARY_PATH=../../build/ ./$PROG $@"
-LD_LIBRARY_PATH=../../build/ ./$PROG "$@"
diff --git a/tests/SDL/subcontext.c b/tests/SDL/subcontext.c
deleted file mode 100644
index a9348e6..0000000
--- a/tests/SDL/subcontext.c
+++ /dev/null
@@ -1,281 +0,0 @@
-/*****************************************************************************
- * This file is part of gfxprim library. *
- * *
- * Gfxprim is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU Lesser General Public *
- * License as published by the Free Software Foundation; either *
- * version 2.1 of the License, or (at your option) any later version. *
- * *
- * Gfxprim is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with gfxprim; if not, write to the Free Software *
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
- * Boston, MA 02110-1301 USA *
- * *
- * Copyright (C) 2009-2010 Jiri "BlueBear" Dluhos *
- * <jiri.bluebear.dluhos(a)gmail.com> *
- * *
- * Copyright (C) 2009-2011 Cyril Hrubis <metan(a)ucw.cz> *
- * *
- *****************************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <SDL/SDL.h>
-
-#include "GP.h"
-#include "GP_SDL.h"
-
-static GP_Pixel black, white, gray;
-
-SDL_Surface *display = NULL;
-GP_Context context, *sub_context;
-
-SDL_TimerID timer;
-
-SDL_UserEvent timer_event;
-
-static int pause_flag = 0;
-static int draw_flag = 0;
-
-Uint32 timer_callback(__attribute__((unused)) Uint32 interval,
- __attribute__((unused)) void *param)
-{
- timer_event.type = SDL_USEREVENT;
- SDL_PushEvent((SDL_Event *) &timer_event);
- return 30;
-}
-
-static void draw_line(GP_Context *dest, GP_Coord x, GP_Coord y,
- GP_Size w, GP_Size h, GP_Color col)
-{
- GP_Coord x1, x2, y1, y2;
-
- x1 = random() % w + x;
- y1 = random() % h + y;
- x2 = random() % w + x;
- y2 = random() % h + y;
-
- GP_Line(dest, x1, y1, x2, y2, col);
-}
-
-static void draw_triangle(GP_Context *dest, GP_Coord x, GP_Coord y,
- GP_Size w, GP_Size h, GP_Color col, int flag)
-{
- GP_Coord x1, x2, x3, y1, y2, y3;
-
- x1 = random() % w + x;
- y1 = random() % h + y;
- x2 = random() % w + x;
- y2 = random() % h + y;
- x3 = random() % w + x;
- y3 = random() % h + y;
-
- if (flag)
- GP_FillTriangle(dest, x1, y1, x2, y2, x3, y3, col);
- else
- GP_Triangle(dest, x1, y1, x2, y2, x3, y3, col);
-}
-
-static void draw_rect(GP_Context *dest, GP_Coord x, GP_Coord y,
- GP_Size w, GP_Size h, GP_Color col, int flag)
-{
- GP_Coord x1, x2, y1, y2;
-
- x1 = random() % w + x;
- y1 = random() % h + y;
- x2 = random() % w + x;
- y2 = random() % h + y;
-
- if (flag)
- GP_FillRect(dest, x1, y1, x2, y2, col);
- else
- GP_Rect(dest, x1, y1, x2, y2, col);
-}
-
-static void draw_circle(GP_Context *dest, GP_Coord x, GP_Coord y,
- GP_Size w, GP_Size h, GP_Color col, int flag)
-{
- GP_Coord x1, y1, r;
-
- r = random() % 150;
-
- x1 = random() % (w - 2*r) + x + r;
- y1 = random() % (h - 2*r) + y + r;
-
- if (flag)
- GP_FillCircle(dest, x1, y1, r, col);
- else
- GP_Circle(dest, x1, y1, r, col);
-}
-
-#define TEXT "Lorem Ipsum Dolor Sit Amet"
-
-static void draw_text(GP_Context *dest, GP_Coord x, GP_Coord y,
- GP_Size w, GP_Size h, GP_Color col)
-{
- GP_Coord x1, y1;
- GP_Size tw, th;
-
- tw = GP_TextWidth(NULL, TEXT);
- th = GP_TextHeight(NULL);
-
- x1 = random() % (w - tw) + x;
- y1 = random() % (h - th) + y;
-
- GP_Text(dest, NULL, x1, y1, GP_ALIGN_RIGHT|GP_VALIGN_BOTTOM, col, black, TEXT);
-}
-
-void redraw_screen(void)
-{
- if (pause_flag)
- return;
-
- SDL_LockSurface(display);
-
- uint8_t v = random() % 128 + 50;
- GP_Color col;
- if (sub_context->pixel_type == GP_PIXEL_P8)
- col = random() % 256;
- else
- col = GP_RGBToContextPixel(v, v, 255, sub_context);
-
- /* frame around subcontext */
- GP_Rect(&context, 99, 99, context.w - 100, context.h - 100, white);
-
- switch (draw_flag) {
- case 0:
- draw_line(sub_context, -100, -100, sub_context->w + 200, sub_context->h + 200, col);
- break;
- case 1:
- draw_triangle(sub_context, -100, -100, sub_context->w + 200, sub_context->h + 200, col, 0);
- break;
- case 2:
- draw_triangle(sub_context, -100, -100, sub_context->w + 200, sub_context->h + 200, col, 1);
- break;
- case 3:
- draw_rect(sub_context, -100, -100, sub_context->w + 200, sub_context->h + 200, col, 0);
- break;
- case 4:
- draw_rect(sub_context, -100, -100, sub_context->w + 200, sub_context->h + 200, col, 1);
- break;
- case 5:
- draw_circle(sub_context, -100, -100, sub_context->w + 200, sub_context->h + 200, col, 0);
- break;
- case 6:
- draw_circle(sub_context, -100, -100, sub_context->w + 200, sub_context->h + 200, col, 1);
- break;
- case 7:
- draw_text(sub_context, -100, -100, sub_context->w + 200, sub_context->h + 200, col);
- break;
- }
-
- SDL_Flip(display);
-
- SDL_UnlockSurface(display);
-}
-
-void clear_screen(void)
-{
- GP_Fill(&context, black);
- GP_Fill(sub_context, gray);
-}
-
-void event_loop(void)
-{
- SDL_Event event;
-
- while (SDL_WaitEvent(&event) > 0) {
-
- switch (event.type) {
-
- case SDL_USEREVENT:
- redraw_screen();
- break;
- case SDL_KEYDOWN:
- switch (event.key.keysym.sym) {
- case SDLK_p:
- pause_flag = !pause_flag;
- break;
- case SDLK_SPACE:
- draw_flag = (draw_flag + 1) % 8;
- clear_screen();
- break;
- case SDLK_ESCAPE:
- return;
-
- default:
- break;
- }
- break;
- case SDL_QUIT:
- return;
- default:
- break;
- }
- }
-}
-
-int main(int argc, char *argv[])
-{
- /* Bits per pixel to be set for the display surface. */
- int display_bpp = 0;
-
- int i;
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-8") == 0) {
- display_bpp = 8;
- } else if (strcmp(argv[i], "-16") == 0) {
- display_bpp = 16;
- }
- else if (strcmp(argv[i], "-24") == 0) {
- display_bpp = 24;
- }
- else if (strcmp(argv[i], "-32") == 0) {
- display_bpp = 32;
- }
- }
-
- GP_SetDebugLevel(10);
-
- if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) != 0) {
- fprintf(stderr, "Could not initialize SDL: %sn", SDL_GetError());
- return 1;
- }
-
- display = SDL_SetVideoMode(640, 480, display_bpp, SDL_SWSURFACE);
- if (display == NULL) {
- fprintf(stderr, "Could not open display: %sn", SDL_GetError());
- goto fail;
- }
-
- GP_SDL_ContextFromSurface(&context, display);
-
- black = GP_ColorToContextPixel(GP_COL_BLACK, &context);
- white = GP_ColorToContextPixel(GP_COL_WHITE, &context);
- gray = GP_ColorToContextPixel(GP_COL_GRAY_DARK, &context);
-
- sub_context = GP_SubContextAlloc(&context, 100, 100, 440, 280);
- GP_Fill(sub_context, gray);
-
- timer = SDL_AddTimer(60, timer_callback, NULL);
- if (timer == 0) {
- fprintf(stderr, "Could not set up timer: %sn", SDL_GetError());
- goto fail;
- }
-
- event_loop();
-
- SDL_Quit();
- return 0;
-
-fail:
- SDL_Quit();
- return 1;
-}
-
diff --git a/tests/SDL/textaligntest.c b/tests/SDL/textaligntest.c
deleted file mode 100644
index a58e670..0000000
--- a/tests/SDL/textaligntest.c
+++ /dev/null
@@ -1,185 +0,0 @@
-/*****************************************************************************
- * This file is part of gfxprim library. *
- * *
- * Gfxprim is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU Lesser General Public *
- * License as published by the Free Software Foundation; either *
- * version 2.1 of the License, or (at your option) any later version. *
- * *
- * Gfxprim is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with gfxprim; if not, write to the Free Software *
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
- * Boston, MA 02110-1301 USA *
- * *
- * Copyright (C) 2009-2010 Jiri "BlueBear" Dluhos *
- * <jiri.bluebear.dluhos(a)gmail.com> *
- * *
- * Copyright (C) 2009-2012 Cyril Hrubis <metan(a)ucw.cz> *
- * *
- *****************************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <SDL/SDL.h>
-
-#include "GP.h"
-#include "GP_SDL.h"
-
-SDL_Surface *display = NULL;
-GP_Context context;
-
-static GP_Pixel black_pixel, red_pixel, yellow_pixel, green_pixel, blue_pixel,
- darkgray_pixel;
-
-static int font_flag = 0;
-
-static int X = 640;
-static int Y = 480;
-
-GP_FontFace *font = NULL;
-
-void redraw_screen(void)
-{
- SDL_LockSurface(display);
-
- GP_Fill(&context, black_pixel);
-
- /* draw axes intersecting in the middle, where text should be shown */
- GP_HLine(&context, 0, X, Y/2, darkgray_pixel);
- GP_VLine(&context, X/2, 0, Y, darkgray_pixel);
-
- GP_TextStyle style = GP_DEFAULT_TEXT_STYLE;
-
- switch (font_flag) {
- case 0:
- style.font = &GP_DefaultProportionalFont;
- break;
- case 1:
- style.font = &GP_DefaultConsoleFont;
- break;
- case 2:
- style.font = font;
- break;
- }
-
- GP_Text(&context, &style, X/2, Y/2, GP_ALIGN_LEFT|GP_VALIGN_BELOW,
- yellow_pixel, black_pixel, "bottom left");
- GP_Text(&context, &style, X/2, Y/2, GP_ALIGN_RIGHT|GP_VALIGN_BELOW,
- red_pixel, black_pixel, "bottom right");
- GP_Text(&context, &style, X/2, Y/2, GP_ALIGN_RIGHT|GP_VALIGN_ABOVE,
- blue_pixel, black_pixel, "top right");
- GP_Text(&context, &style, X/2, Y/2, GP_ALIGN_LEFT|GP_VALIGN_ABOVE,
- green_pixel, black_pixel, "top left");
-
- SDL_UnlockSurface(display);
-}
-
-void event_loop(void)
-{
- SDL_Event event;
-
- while (SDL_WaitEvent(&event) > 0) {
- switch (event.type) {
-
- case SDL_VIDEOEXPOSE:
- redraw_screen();
- SDL_Flip(display);
- break;
-
- case SDL_KEYDOWN:
- switch (event.key.keysym.sym) {
- case SDLK_SPACE:
- font_flag += 1;
-
- if (font) {
- if (font_flag >= 3)
- font_flag = 0;
- } else {
- if (font_flag >= 2)
- font_flag = 0;
- }
- break;
- case SDLK_x:
- context.x_swap = !context.x_swap;
- break;
- case SDLK_y:
- context.y_swap = !context.y_swap;
- break;
- case SDLK_r:
- context.axes_swap = !context.axes_swap;
- GP_SWAP(X, Y);
- break;
- default:
- break;
- case SDLK_ESCAPE:
- return;
- }
- redraw_screen();
- SDL_Flip(display);
- break;
-
- case SDL_QUIT:
- return;
- }
- }
-}
-
-void print_instructions(void)
-{
- printf("Use the following keys to control the test:n");
- printf(" Space ............... toggle proportional/nonproportional fontn");
- printf(" X ................... mirror Xn");
- printf(" Y ................... mirror Yn");
- printf(" R ................... reverse X and Yn");
-}
-
-int main(int argc, char *argv[])
-{
- GP_SetDebugLevel(10);
-
- if (argc > 1)
- font = GP_FontFaceLoad(argv[1], 0, 16);
-
- if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) != 0) {
- fprintf(stderr, "Could not initialize SDL: %sn", SDL_GetError());
- return 1;
- }
-
- display = SDL_SetVideoMode(X, Y, 0, SDL_SWSURFACE);
- if (display == NULL) {
- fprintf(stderr, "Could not open display: %sn", SDL_GetError());
- goto fail;
- }
-
- print_instructions();
-
- SDL_Rect clip_rect = {10, 10, X-10, Y-10};
- SDL_SetClipRect(display, &clip_rect);
-
- GP_SDL_ContextFromSurface(&context, display);
-
- black_pixel = GP_ColorToContextPixel(GP_COL_BLACK, &context);
- red_pixel = GP_ColorToContextPixel(GP_COL_RED, &context);
- blue_pixel = GP_ColorToContextPixel(GP_COL_BLUE, &context);
- green_pixel = GP_ColorToContextPixel(GP_COL_GREEN, &context);
- yellow_pixel = GP_ColorToContextPixel(GP_COL_YELLOW, &context);
- darkgray_pixel = GP_ColorToContextPixel(GP_COL_GRAY_DARK, &context);
-
- redraw_screen();
- SDL_Flip(display);
-
- event_loop();
-
- SDL_Quit();
- return 0;
-
-fail:
- SDL_Quit();
- return 1;
-}
-
http://repo.or.cz/w/gfxprim.git/commit/feddd1c185068f220e394cc7ec34ff3f0e6b…
commit feddd1c185068f220e394cc7ec34ff3f0e6b5801
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Sun Nov 25 22:33:11 2012 +0100
tests: Port textaligntest to backends.
diff --git a/demos/c_simple/Makefile b/demos/c_simple/Makefile
index 708a3ca..b30fc23 100644
--- a/demos/c_simple/Makefile
+++ b/demos/c_simple/Makefile
@@ -9,7 +9,8 @@ LDLIBS+=-lrt `$(TOPDIR)/gfxprim-config --libs --libs-backends`
APPS=backend_example loaders_example loaders filters_symmetry gfx_koch virtual_backend_example meta_data meta_data_dump tmp_file showimage v4l2_show v4l2_grab convolution weighted_median shapetest koch input- fileview linetest randomshapetest fonttest loaders_register blittest
+ fileview linetest randomshapetest fonttest loaders_register blittest+ textaligntest
v4l2_show: LDLIBS+=-lGP_grabbers
v4l2_grab: LDLIBS+=-lGP_grabbers
diff --git a/demos/c_simple/textaligntest.c b/demos/c_simple/textaligntest.c
new file mode 100644
index 0000000..0f1b4a3
--- /dev/null
+++ b/demos/c_simple/textaligntest.c
@@ -0,0 +1,167 @@
+/*****************************************************************************
+ * This file is part of gfxprim library. *
+ * *
+ * Gfxprim is free software; you can redistribute it and/or *
+ * modify it under the terms of the GNU Lesser General Public *
+ * License as published by the Free Software Foundation; either *
+ * version 2.1 of the License, or (at your option) any later version. *
+ * *
+ * Gfxprim is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with gfxprim; if not, write to the Free Software *
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
+ * Boston, MA 02110-1301 USA *
+ * *
+ * Copyright (C) 2009-2010 Jiri "BlueBear" Dluhos *
+ * <jiri.bluebear.dluhos(a)gmail.com> *
+ * *
+ * Copyright (C) 2009-2012 Cyril Hrubis <metan(a)ucw.cz> *
+ * *
+ *****************************************************************************/
+
+#include <GP.h>
+
+static GP_Pixel black_pixel, red_pixel, yellow_pixel, green_pixel, blue_pixel,
+ darkgray_pixel;
+
+static int font_flag = 0;
+
+static int X = 640;
+static int Y = 480;
+
+static GP_FontFace *font = NULL;
+
+static GP_Backend *win;
+
+void redraw_screen(void)
+{
+ GP_Fill(win->context, black_pixel);
+
+ /* draw axes intersecting in the middle, where text should be shown */
+ GP_HLine(win->context, 0, X, Y/2, darkgray_pixel);
+ GP_VLine(win->context, X/2, 0, Y, darkgray_pixel);
+
+ GP_TextStyle style = GP_DEFAULT_TEXT_STYLE;
+
+ switch (font_flag) {
+ case 0:
+ style.font = &GP_DefaultProportionalFont;
+ break;
+ case 1:
+ style.font = &GP_DefaultConsoleFont;
+ break;
+ case 2:
+ style.font = font;
+ break;
+ }
+
+ GP_Text(win->context, &style, X/2, Y/2, GP_ALIGN_LEFT|GP_VALIGN_BELOW,
+ yellow_pixel, black_pixel, "bottom left");
+ GP_Text(win->context, &style, X/2, Y/2, GP_ALIGN_RIGHT|GP_VALIGN_BELOW,
+ red_pixel, black_pixel, "bottom right");
+ GP_Text(win->context, &style, X/2, Y/2, GP_ALIGN_RIGHT|GP_VALIGN_ABOVE,
+ blue_pixel, black_pixel, "top right");
+ GP_Text(win->context, &style, X/2, Y/2, GP_ALIGN_LEFT|GP_VALIGN_ABOVE,
+ green_pixel, black_pixel, "top left");
+}
+
+static void event_loop(void)
+{
+ GP_Event ev;
+
+ while (GP_EventGet(&ev)) {
+ switch (ev.type) {
+ case GP_EV_KEY:
+ if (ev.code != GP_EV_KEY_DOWN)
+ continue;
+
+ switch (ev.val.key.key) {
+ case GP_KEY_X:
+ win->context->x_swap = !win->context->x_swap;
+ break;
+ case GP_KEY_Y:
+ win->context->y_swap = !win->context->y_swap;
+ break;
+ case GP_KEY_R:
+ win->context->axes_swap = !win->context->axes_swap;
+ GP_SWAP(X, Y);
+ break;
+ case GP_KEY_SPACE:
+ font_flag++;
+
+ if (font) {
+ if (font_flag >= 3)
+ font_flag = 0;
+ } else {
+ if (font_flag >= 2)
+ font_flag = 0;
+ }
+ break;
+ case GP_KEY_ESC:
+ GP_BackendExit(win);
+ exit(0);
+ break;
+ }
+ break;
+ case GP_EV_SYS:
+ switch(ev.code) {
+ case GP_EV_SYS_QUIT:
+ GP_BackendExit(win);
+ exit(0);
+ break;
+ }
+ break;
+ }
+
+ redraw_screen();
+ GP_BackendFlip(win);
+ }
+}
+
+void print_instructions(void)
+{
+ printf("Use the following keys to control the test:n");
+ printf(" Space ........ toggle proportional/nonproportional fontn");
+ printf(" X ............ mirror Xn");
+ printf(" Y ............ mirror Yn");
+ printf(" R ............ reverse X and Yn");
+}
+
+int main(int argc, char *argv[])
+{
+ const char *backend_opts = "X11";
+
+ if (argc > 1)
+ font = GP_FontFaceLoad(argv[1], 0, 16);
+
+ print_instructions();
+
+ win = GP_BackendInit(backend_opts, "Font Align Test", stderr);
+
+ if (win == NULL) {
+ fprintf(stderr, "Failed to initalize backend '%s'n",
+ backend_opts);
+ return 1;
+ }
+
+ black_pixel = GP_ColorToContextPixel(GP_COL_BLACK, win->context);
+ red_pixel = GP_ColorToContextPixel(GP_COL_RED, win->context);
+ blue_pixel = GP_ColorToContextPixel(GP_COL_BLUE, win->context);
+ green_pixel = GP_ColorToContextPixel(GP_COL_GREEN, win->context);
+ yellow_pixel = GP_ColorToContextPixel(GP_COL_YELLOW, win->context);
+ darkgray_pixel = GP_ColorToContextPixel(GP_COL_GRAY_DARK, win->context);
+
+ redraw_screen();
+
+ GP_BackendFlip(win);
+
+ for (;;) {
+ GP_BackendWait(win);
+ event_loop();
+ }
+}
+
http://repo.or.cz/w/gfxprim.git/commit/cd4e4016c7c2bd7293eec6d9cc99e3355cc8…
commit cd4e4016c7c2bd7293eec6d9cc99e3355cc8dd38
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Sun Nov 25 21:50:16 2012 +0100
tests: core: Add SubContext assertions.
diff --git a/tests/core/Context.c b/tests/core/Context.c
index 4e05306..af26656 100644
--- a/tests/core/Context.c
+++ b/tests/core/Context.c
@@ -96,11 +96,125 @@ static int Context_Alloc_Free(void)
return TST_SUCCESS;
}
+/*
+ * Asserts that subcontext structure is initialized correctly
+ */
+static int subcontext_assert(const GP_Context *c, const GP_Context *sc,
+ GP_Size w, GP_Size h)
+{
+ if (c->bpp != sc->bpp) {
+ tst_msg("Context->bpp != SubContext->bpp");
+ return TST_FAILED;
+ }
+
+ if (c->bytes_per_row != sc->bytes_per_row) {
+ tst_msg("Context->bytes_per_row != SubContext->bytes_per_row");
+ return TST_FAILED;
+ }
+
+ if (sc->w != w) {
+ tst_msg("SubContext->w != %u (== %i)", w, sc->w);
+ return TST_FAILED;
+ }
+
+ if (sc->h != h) {
+ tst_msg("SubContext->h != %u (== %i)", h, sc->h);
+ return TST_FAILED;
+ }
+
+ if (sc->offset != 0) {
+ tst_msg("SubContext->offset != 0");
+ return TST_FAILED;
+ }
+
+ if (sc->pixel_type != GP_PIXEL_RGB888) {
+ tst_msg("SubContext->pixel_type != GP_PIXEL_RGB888");
+ return TST_FAILED;
+ }
+
+ if (sc->gamma != NULL) {
+ tst_msg("SubContext->gamma != NULL");
+ return TST_FAILED;
+ }
+
+ if (sc->axes_swap != 0 || sc->x_swap != 0 || sc->y_swap != 0) {
+ tst_msg("Wrong default orientation %i %i %i",
+ sc->axes_swap, sc->x_swap, sc->y_swap);
+ return TST_FAILED;
+ }
+
+ /* access the start and end of the pixel buffer */
+ *(char*)GP_PIXEL_ADDR(sc, 0, 0) = 0;
+ *(char*)GP_PIXEL_ADDR(sc, sc->w - 1, sc->h - 1) = 0;
+
+ return 0;
+}
+
+static int SubContext_Alloc_Free(void)
+{
+ GP_Context *c, *sc;
+ int ret;
+
+ c = GP_ContextAlloc(300, 300, GP_PIXEL_RGB888);
+
+ if (c == NULL) {
+ tst_msg("GP_ContextAlloc() failed");
+ return TST_UNTESTED;
+ }
+
+ sc = GP_SubContextAlloc(c, 100, 100, 100, 100);
+
+ if (sc == NULL) {
+ GP_ContextFree(c);
+ return TST_FAILED;
+ }
+
+ ret = subcontext_assert(c, sc, 100, 100);
+
+ if (ret)
+ return ret;
+
+ GP_ContextFree(c);
+ GP_ContextFree(sc);
+
+ return TST_SUCCESS;
+}
+
+static int SubContext_Create(void)
+{
+ GP_Context *c, sc;
+ int ret;
+
+ c = GP_ContextAlloc(300, 300, GP_PIXEL_RGB888);
+
+ if (c == NULL) {
+ tst_msg("GP_ContextAlloc() failed");
+ return TST_UNTESTED;
+ }
+
+ GP_SubContext(c, &sc, 100, 100, 100, 100);
+
+ ret = subcontext_assert(c, &sc, 100, 100);
+
+ if (ret)
+ return ret;
+
+ GP_ContextFree(c);
+
+ return TST_SUCCESS;
+}
+
+
const struct tst_suite tst_suite = {
.suite_name = "Context Testsuite",
.tests = {
{.name = "Context Alloc Free", .tst_fn = Context_Alloc_Free,
.flags = TST_CHECK_MALLOC},
+ {.name = "SubContext Alloc Free",
+ .tst_fn = SubContext_Alloc_Free,
+ .flags = TST_CHECK_MALLOC},
+ {.name = "SubContext Create",
+ .tst_fn = SubContext_Create},
{.name = NULL},
}
};
-----------------------------------------------------------------------
Summary of changes:
demos/c_simple/Makefile | 3 +-
{tests/SDL => demos/c_simple}/textaligntest.c | 156 ++++++--------
tests/Makefile | 2 +-
tests/SDL/Makefile | 15 --
tests/SDL/mixpixeltest.c | 228 --------------------
tests/SDL/runtest.sh | 10 -
tests/SDL/subcontext.c | 281 -------------------------
tests/core/Context.c | 114 ++++++++++
8 files changed, 186 insertions(+), 623 deletions(-)
rename {tests/SDL => demos/c_simple}/textaligntest.c (57%)
delete mode 100644 tests/SDL/Makefile
delete mode 100644 tests/SDL/mixpixeltest.c
delete mode 100755 tests/SDL/runtest.sh
delete mode 100644 tests/SDL/subcontext.c
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos(a)gmail.com
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
gfxprim.git ("A simple 2D graphics library with emphasis on correctness and well-defined operation.")
1
0
[repo.or.cz] gfxprim.git branch master updated: 7064952e38373799deaae59b2ea67093d75b3709
by metan 25 Nov '12
by metan 25 Nov '12
25 Nov '12
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project gfxprim.git.
The branch, master has been updated
via 7064952e38373799deaae59b2ea67093d75b3709 (commit)
from d87921f9670a726993a5bfd756e3ae09a3ba83ed (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/w/gfxprim.git/commit/7064952e38373799deaae59b2ea67093d75b…
commit 7064952e38373799deaae59b2ea67093d75b3709
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Sun Nov 25 20:26:58 2012 +0100
tests: framework: Create JSON log to HTML converter.
Create JSON to HTML log converted and remove the C implementation.
diff --git a/tests/framework/Makefile b/tests/framework/Makefile
index a688952..44ed5e1 100644
--- a/tests/framework/Makefile
+++ b/tests/framework/Makefile
@@ -20,7 +20,7 @@ libtst_preload.so: tst_preload.o tst_alloc_barriers.o tst_preload_FILE.o
libtst.a: tst_suite.o tst_job.o tst_msg.o tst_log.o tst_main.o tst_timespec.o
ar rcs $@ $^
-CLEAN+=libtst_preload.so libtst.a log.html log.json
+CLEAN+=libtst_preload.so libtst.a log.json
include $(TOPDIR)/app.mk
include $(TOPDIR)/post.mk
diff --git a/tests/framework/json_parse.py b/tests/framework/json_parse.py
deleted file mode 100755
index b3e0833..0000000
--- a/tests/framework/json_parse.py
+++ /dev/null
@@ -1,72 +0,0 @@
-#!/usr/bin/env python
-
-#
-# Sample python code to print testsuite name and test results from the JSON logfile
-#
-
-import json
-
-#
-# Create classes from JSON dictionary
-#
-class TestResult:
- def __init__(self, test_result):
- self.name = test_result["Test Name"]
- self.result = test_result["Test Result"]
- self.reports = test_result["Test Reports"]
- self.cpu_time = test_result["CPU Time"]
- self.run_time = test_result["Run Time"]
-
- if ("Malloc Stats" in test_result):
- self.malloc_stats = 1
-
- def __str__(self):
- return "Test '%s' ended with '%s' (CPU %is) (TIME %is)" % - (self.name, self.result, self.cpu_time, self.run_time)
-
-
-class TestSuite:
- def __init__(self, testsuite_result):
- self.name = testsuite_result["Suite Name"]
- self.test_results = []
-
- for test_result in testsuite_result["Test Results"]:
- self.test_results.append(TestResult(test_result))
-
- def __str__(self):
- ret = 'tt' + self.name + 'nn'
-
- max_len = 0
- for i in self.test_results:
- max_len = max(max_len, len(i.name))
-
- for i in self.test_results:
- ret += i.name
-
- padds = (max_len - len(i.name))
-
- while padds > 0:
- ret += ' '
- padds-=1
-
- ret += " | %.3fs/%.3fs | %sn" % - (i.cpu_time, i.run_time, i.result)
-
- for j in i.reports:
- ret += " (%s)n" % j
-
- return ret
-
-def main():
- # parse JSON
- f = open('log.json')
- data = json.load(f)
- f.close()
-
- # convert to python objects
- test_suite = TestSuite(data)
-
- print(test_suite)
-
-if __name__ == '__main__':
- main()
diff --git a/tests/framework/log2html.py b/tests/framework/log2html.py
new file mode 100755
index 0000000..c417daa
--- /dev/null
+++ b/tests/framework/log2html.py
@@ -0,0 +1,289 @@
+#!/usr/bin/env python
+
+#
+# Script to convert testsuite JSON log into html page
+#
+
+import json
+
+#
+# Test result to html color dict
+#
+html_colors = {
+ 'Success': '#008000',
+ 'Skipped': '#888888',
+ 'Untested': '#0000bb',
+ 'Internal Error': '#800000',
+ 'Segmentation Fault': '#e00000',
+ 'Timeout': '#800080',
+ 'Aborted': '#e00000',
+ 'FP Exception': '#e00000',
+ 'Memory Leak': '#a0a000',
+ 'Failed': '#e00000'
+}
+
+#
+# Convert bytes to human-readable string
+#
+def bytes_conv(size):
+ if (size < 512):
+ return "%iB" % (size)
+
+ if (size < 1024 * 512):
+ return "%.2fkB" % (float(size) / 1024)
+
+ if (size < 1024 * 1024 * 512):
+ return "%.2fMB" % (float(size) / 1024 / 1024)
+
+ return "%.2fGB" % (float(size) / 1024 / 1024 / 1024)
+
+#
+# Malloc statistics Class created from JSON dict
+#
+class MallocStats:
+ def __init__(self, malloc_stats):
+ self.total_size = malloc_stats["Total Size"]
+ self.total_chunks = malloc_stats["Total Chunks"]
+ self.max_size = malloc_stats["Max Size"]
+ self.max_chunks = malloc_stats["Max Chunks"]
+ self.lost_size = malloc_stats["Lost Size"]
+ self.lost_chunks = malloc_stats["Lost Chunks"]
+
+ def html(self):
+ print(' <tr>')
+ print(' <td bgcolor="#ffffcc" colspan="3">')
+ print(' <center>')
+ print(' <table>')
+
+ # Table header
+ print(' <tr>')
+
+ print(' <td bgcolor="#ffffaa">')
+ print(' <small>Total size</small>')
+ print(' </td>')
+
+ print(' <td bgcolor="#ffffaa">')
+ print(' <small>Total chunks</small>')
+ print(' </td>')
+
+ print(' <td bgcolor="#ffffaa">')
+ print(' <small>Max size</small>')
+ print(' </td>')
+
+ print(' <td bgcolor="#ffffaa">')
+ print(' <small>Max chunks</small>')
+ print(' </td>')
+
+ print(' <td bgcolor="#ffffaa">')
+ print(' <small>Lost size</small>')
+ print(' </td>')
+
+ print(' <td bgcolor="#ffffaa">')
+ print(' <small>Lost chunks</small>')
+ print(' </td>')
+
+ print(' </tr>')
+
+ # Malloc data
+ print(' <tr>')
+
+ print(' <td bgcolor="#ffffaa">')
+ print(' <center><small>%s</small></center>' %
+ bytes_conv(self.total_size))
+ print(' </td>')
+
+ print(' <td bgcolor="#ffffaa">')
+ print(' <center><small>%s</small></center>' %
+ bytes_conv(self.total_chunks))
+ print(' </td>')
+
+ print(' <td bgcolor="#ffffaa">')
+ print(' <center><small>%s</small></center>' %
+ bytes_conv(self.max_size))
+ print(' </td>')
+
+ print(' <td bgcolor="#ffffaa">')
+ print(' <center><small>%s</small></center>' %
+ bytes_conv(self.max_chunks))
+ print(' </td>')
+
+ print(' <td bgcolor="#ffffaa">')
+ print(' <center><small>%s</small></center>' %
+ bytes_conv(self.lost_size))
+ print(' </td>')
+
+ print(' <td bgcolor="#ffffaa">')
+ print(' <center><small>%s</small></center>' %
+ bytes_conv(self.lost_chunks))
+ print(' </td>')
+
+ print(' </tr>')
+
+ print(' </table>')
+ print(' </center>')
+ print(' </td>')
+ print(' </tr>')
+
+#
+# Benchmark statistics Class created from JSON dict
+#
+class BenchmarkData:
+ def __init__(self, bench_data):
+ self.time_mean = bench_data["Time Mean"]
+ self.time_variance = bench_data["Time Variance"]
+ self.iterations = bench_data["Iterations"]
+
+ def html(self):
+ print(' <tr>')
+ print(' <td bgcolor="#fd8" colspan="3">')
+ print(' <center>')
+ print(' <table>')
+
+ # Table header
+ print(' <tr>')
+
+ print(' <td colspan="2" bgcolor="#fb2">')
+ print(' <center><small>Benchmark data</small></center>')
+ print(' </td>')
+
+ print(' </tr>')
+
+ print(' <tr>')
+
+ print(' <td bgcolor="#fc4">')
+ print(' <center><small>Iterations</small></center>')
+ print(' </td>')
+
+ print(' <td bgcolor="#fc4">')
+ print(' <center><small>Mean ∓ Variance</small></center>')
+ print(' </td>')
+
+ print(' </tr>')
+
+ # Benchmark data
+ print(' <tr>')
+
+ print(' <td bgcolor="#fc4">')
+ print(' <small>%i</small>' % (self.iterations))
+ print(' </td>')
+
+ print(' <td bgcolor="#fc4">')
+ print(' <small>%.6fs ∓ %.6fs</small>' %
+ (self.time_mean, self.time_variance))
+ print(' </td>')
+
+ print(' </tr>')
+
+ print(' </table>')
+ print(' </center>')
+ print(' </td>')
+ print(' </tr>')
+
+#
+# Test Result Class created from JSON dict
+#
+class TestResult:
+ def __init__(self, test_result):
+ self.name = test_result["Test Name"]
+ self.result = test_result["Test Result"]
+ self.reports = test_result["Test Reports"]
+ self.cpu_time = test_result["CPU Time"]
+ self.run_time = test_result["Run Time"]
+ self.test_reports = test_result["Test Reports"]
+
+ if ("Malloc Stats" in test_result):
+ self.malloc_stats = MallocStats(test_result["Malloc Stats"])
+
+ if ("Benchmark" in test_result):
+ self.bench_data = BenchmarkData(test_result["Benchmark"])
+
+ def html(self, bg_color):
+ # Print test result
+ print(' <tr>')
+
+ print(' <td bgcolor="%s">%s </td>' % (bg_color, self.name))
+
+ print(' <td bgcolor="%s">' % (bg_color))
+ print(' <center><small><font color="#222">')
+ print(' %.3fs %.3fs' % (self.run_time, self.cpu_time))
+ print(' </font></small></center>')
+ print(' </td>')
+
+ print(' <td bgcolor="%s">' % (html_colors[self.result]))
+ print(' <center><font color="white"> %s </center>' %
+ (self.result))
+ print(' </td>')
+
+ print(' </tr>')
+
+ # Add malloc statistics, if present
+ if (hasattr(self, 'malloc_stats')):
+ self.malloc_stats.html()
+
+ # And benchmark data
+ if (hasattr(self, 'bench_data')):
+ self.bench_data.html()
+
+ # And test messages
+ if (self.test_reports):
+ print(' <tr>')
+ print(' <td colspan="3" bgcolor="#eeeeee">')
+
+ for msg in self.test_reports:
+ print(' <small>%s</small><br>' % (msg))
+
+ if (self.test_reports):
+ print(' </td>')
+ print(' </tr>')
+
+class TestSuite:
+ def __init__(self, testsuite_result):
+ self.suite_name = testsuite_result["Suite Name"]
+ self.test_results = []
+
+ for test_result in testsuite_result["Test Results"]:
+ self.test_results.append(TestResult(test_result))
+
+ def html(self):
+ print('<html>')
+ print(' <head>')
+ print(' </head>')
+ print(' <body>')
+
+ print(' <table bgcolor="#99a">')
+ print(' <tr>')
+ print(' <td colspan="3" bgcolor="#bbbbff">');
+ print(' <center><b>%s</b></center>' % (self.suite_name))
+ print(' </td>')
+ print(' </tr>')
+
+ flag = False;
+
+ for tst in self.test_results:
+ if (flag):
+ bg_color = '#ccccee'
+ else:
+ bg_color = '#ddddee'
+
+ flag = not flag
+
+ tst.html(bg_color)
+
+ print(' </table>')
+
+ print(' </body>')
+ print('</html>')
+
+def main():
+ # parse JSON
+ f = open('log.json')
+ data = json.load(f)
+ f.close()
+
+ # convert to python objects
+ test_suite = TestSuite(data)
+
+ test_suite.html()
+
+if __name__ == '__main__':
+ main()
diff --git a/tests/framework/tst_log.c b/tests/framework/tst_log.c
index cc86b6f..a7cf9ec 100644
--- a/tests/framework/tst_log.c
+++ b/tests/framework/tst_log.c
@@ -30,36 +30,6 @@
#include "tst_timespec.h"
#include "tst_log.h"
-static const char *ret_to_bg_color(enum tst_ret ret)
-{
- switch (ret) {
- case TST_SUCCESS:
- return "#008000";
- case TST_SKIPPED:
- return "#888888";
- case TST_UNTESTED:
- return "#0000bb";
- case TST_INTERR:
- return "#800000";
- case TST_SIGSEGV:
- return "#e00000";
- case TST_TIMEOUT:
- return "#800080";
- case TST_ABORTED:
- return "#e00000";
- case TST_FPE:
- return "#e00000";
- case TST_MEMLEAK:
- return "#a0a000";
- case TST_FAILED:
- return "#e00000";
- case TST_MAX:
- break;
- }
-
- return "#000000";
-}
-
static const char *ret_to_str(enum tst_ret ret)
{
switch (ret) {
@@ -90,210 +60,6 @@ static const char *ret_to_str(enum tst_ret ret)
return "Unknown";
}
-static void bytes_human_readable(FILE *f, size_t bytes)
-{
- if (bytes < 512) {
- fprintf(f, "%zuB", bytes);
- return;
- }
-
- if (bytes < 1024 * 512) {
- fprintf(f, "%.2fkB", (float)bytes / 1024);
- return;
- }
-
- if (bytes < 1024 * 1024 * 512) {
- fprintf(f, "%.2fMB", (float)bytes / 1024 / 1024);
- return;
- }
-
- fprintf(f, "%.2fGB", (float)bytes / 1024 / 1024 / 1024);
-}
-
-static void malloc_stats_html(struct tst_job *job, FILE *f, const char *padd)
-{
- /* Create innter table */
- fprintf(f, "%s<tr>n", padd);
- fprintf(f, "%s <td bgcolor="#ffffcc" colspan="3">n", padd);
- fprintf(f, "%s <center>n", padd);
- fprintf(f, "%s <table>n", padd);
-
- /* Create header */
- fprintf(f, "%s <tr>n", padd);
-
- fprintf(f, "%s <td bgcolor="#ffffaa">n", padd);
- fprintf(f, "%s <small>Total size</small>n", padd);
- fprintf(f, "%s </td>n", padd);
-
- fprintf(f, "%s <td bgcolor="#ffffaa">n", padd);
- fprintf(f, "%s <small>Total chunks</small>n", padd);
- fprintf(f, "%s </td>n", padd);
-
- fprintf(f, "%s <td bgcolor="#ffffaa">n", padd);
- fprintf(f, "%s <small>Max size</small>n", padd);
- fprintf(f, "%s </td>n", padd);
-
- fprintf(f, "%s <td bgcolor="#ffffaa">n", padd);
- fprintf(f, "%s <small>Max chunks</small>n", padd);
- fprintf(f, "%s </td>n", padd);
-
- fprintf(f, "%s <td bgcolor="#ffffaa">n", padd);
- fprintf(f, "%s <small>Lost size</small>n", padd);
- fprintf(f, "%s </td>n", padd);
-
- fprintf(f, "%s <td bgcolor="#ffffaa">n", padd);
- fprintf(f, "%s <small>Lost chunks</small>n", padd);
- fprintf(f, "%s </td>n", padd);
-
- fprintf(f, "%s </tr>n", padd);
-
- /* Create data */
- fprintf(f, "%s <tr>n", padd);
-
- fprintf(f, "%s <td bgcolor="#ffffaa">n", padd);
- fprintf(f, "%s <center><small>", padd);
- bytes_human_readable(f, job->malloc_stats.total_size);
- fprintf(f, "</small></center>n");
- fprintf(f, "%s </td>n", padd);
-
- fprintf(f, "%s <td bgcolor="#ffffaa">n", padd);
- fprintf(f, "%s <center><small>%u</small></center>n",
- padd, job->malloc_stats.total_chunks);
- fprintf(f, "%s </td>n", padd);
-
- fprintf(f, "%s <td bgcolor="#ffffaa">n", padd);
- fprintf(f, "%s <center><small>", padd);
- bytes_human_readable(f, job->malloc_stats.max_size);
- fprintf(f, "</small></center>n");
- fprintf(f, "%s </td>n", padd);
-
- fprintf(f, "%s <td bgcolor="#ffffaa">n", padd);
- fprintf(f, "%s <center><small>%u</small></center>n",
- padd, job->malloc_stats.max_chunks);
- fprintf(f, "%s </td>n", padd);
-
- fprintf(f, "%s <td bgcolor="#ffffaa">n", padd);
- fprintf(f, "%s <center><small>", padd);
- bytes_human_readable(f, job->malloc_stats.lost_size);
- fprintf(f, "</small></center>n");
- fprintf(f, "%s </td>n", padd);
-
- fprintf(f, "%s <td bgcolor="#ffffaa">n", padd);
- fprintf(f, "%s <center><small>%u</small></center>n",
- padd, job->malloc_stats.lost_chunks);
- fprintf(f, "%s </td>n", padd);
-
- fprintf(f, "%s </tr>n", padd);
-
- fprintf(f, "%s </table>n", padd);
- fprintf(f, "%s </center>n", padd);
- fprintf(f, "%s </td>n", padd);
- fprintf(f, "%s</tr>n", padd);
-}
-
-static void benchmark_stats_html(struct tst_job *job, FILE *f, const char *padd)
-{
- /* Create innter table */
- fprintf(f, "%s<tr>n", padd);
- fprintf(f, "%s <td bgcolor="#fd8" colspan="3">n", padd);
- fprintf(f, "%s <center>n", padd);
- fprintf(f, "%s <table>n", padd);
-
- /* Create header */
- fprintf(f, "%s <tr>n", padd);
-
- fprintf(f, "%s <td colspan="2" bgcolor="#fb2">n", padd);
- fprintf(f, "%s <center><small>Benchmark data", padd);
- fprintf(f, "</small></center>n");
- fprintf(f, "%s </td>n", padd);
-
- fprintf(f, "%s </tr>n", padd);
- fprintf(f, "%s <tr>n", padd);
-
- fprintf(f, "%s <td bgcolor="#fc4">n", padd);
- fprintf(f, "%s <center><small>Iterations", padd);
- fprintf(f, "</small></center>n");
- fprintf(f, "%s </td>n", padd);
-
- fprintf(f, "%s <td bgcolor="#fc4">n", padd);
- fprintf(f, "%s <center><small>Mean ∓ Variance", padd);
- fprintf(f, "</small></center>n");
- fprintf(f, "%s </td>n", padd);
-
- fprintf(f, "%s </tr>n", padd);
-
- /* Create data */
- fprintf(f, "%s <tr>n", padd);
-
- fprintf(f, "%s <td bgcolor="#fc4">n", padd);
- fprintf(f, "%s <center>%i</center>n", padd, job->bench_iter);
- fprintf(f, "%s </td>n", padd);
-
- fprintf(f, "%s <td bgcolor="#fc4">n", padd);
- fprintf(f, "%s <center>%i.%06is ∓ %i.%06is</center>n", padd,
- (int)job->bench_mean.tv_sec, (int)job->bench_mean.tv_nsec/1000,
- (int)job->bench_var.tv_sec, (int)job->bench_var.tv_nsec/1000);
- fprintf(f, "%s </td>n", padd);
-
- fprintf(f, "%s </tr>n", padd);
-
- fprintf(f, "%s </table>n", padd);
- fprintf(f, "%s </center>n", padd);
- fprintf(f, "%s </td>n", padd);
- fprintf(f, "%s</tr>n", padd);
-}
-
-static int append_html(struct tst_job *job, FILE *f)
-{
- const char *padd = " ";
- int sec, nsec;
- static int hack_counter = 0;
- const char *bgcol;
-
- timespec_diff(&sec, &nsec, &job->start_time, &job->stop_time);
-
- if (hack_counter)
- bgcol = "#ccccee";
- else
- bgcol = "#ddddee";
-
- fprintf(f, "%s<tr>n", padd);
- fprintf(f, "%s <td bgcolor="%s">%s </td>n",
- padd, bgcol, job->test->name);
- fprintf(f, "%s <td bgcolor="%s">n", padd, bgcol);
- fprintf(f, "%s <center><small><font color="#222">%i.%03is %i.%03is"
- "</font></small></center>n", padd, sec, nsec/1000000,
- (int)job->cpu_time.tv_sec, (int)job->cpu_time.tv_nsec/1000000);
- fprintf(f, "%s </td>n", padd);
- fprintf(f, "%s <td bgcolor="%s"><center><font color="white">"
- " %s </td></center>n", padd,
- ret_to_bg_color(job->result), ret_to_str(job->result));
-
- struct tst_msg *msg;
-
- /* If calculated include malloc report */
- if (job->test->flags & TST_CHECK_MALLOC)
- malloc_stats_html(job, f, padd);
-
- if (job->bench_iter)
- benchmark_stats_html(job, f, padd);
-
- for (msg = job->store.first; msg != NULL; msg = msg->next) {
- fprintf(f, "%s<tr>n", padd);
- fprintf(f, "%s <td colspan="3" bgcolor="#eeeeee">n", padd);
- fprintf(f, "%s <small>%s</small>n",
- padd, msg->msg);
- fprintf(f, "%s </td>n", padd);
- fprintf(f, "%s</tr>n", padd);
- }
-
- fprintf(f, "%s</tr>n", padd);
-
- hack_counter = !hack_counter;
-
- return 0;
-}
-
static int append_msg_json(struct tst_job *job, FILE *f)
{
struct tst_msg *msg;
@@ -391,9 +157,6 @@ static int append_json(struct tst_job *job, FILE *f)
int tst_log_append(struct tst_job *job, FILE *f, enum tst_log_fmt format)
{
switch (format) {
- case TST_LOG_HTML:
- return append_html(job, f);
- break;
case TST_LOG_JSON:
return append_json(job, f);
break;
@@ -404,30 +167,6 @@ int tst_log_append(struct tst_job *job, FILE *f, enum tst_log_fmt format)
return 1;
}
-FILE *open_html(const struct tst_suite *suite, const char *path)
-{
- FILE *f;
-
- f = fopen(path, "w");
-
- if (f == NULL)
- return NULL;
-
- fprintf(f, "<html>n <head>n </head>n <body>n "
- "<table bgcolor="#99a">n");
-
- fprintf(f, " <tr><td colspan="3" bgcolor="#bbbbff"><center><b>%s"
- "</b></center></td></tr>n", suite->suite_name);
-
- fprintf(f, " <tr>n");
- fprintf(f, " <td bgcolor="#eee"><center>Test Name</center></td>n");
- fprintf(f, " <td bgcolor="#eee"><center>Time/CPU</center></td>n");
- fprintf(f, " <td bgcolor="#eee"><center>Result</center></td>n");
- fprintf(f, " </tr>n");
-
- return f;
-}
-
static void write_system_info_json(FILE *f)
{
struct utsname buf;
@@ -487,9 +226,6 @@ FILE *tst_log_open(const struct tst_suite *suite, const char *path,
enum tst_log_fmt format)
{
switch (format) {
- case TST_LOG_HTML:
- return open_html(suite, path);
- break;
case TST_LOG_JSON:
return open_json(suite, path);
break;
@@ -500,12 +236,6 @@ FILE *tst_log_open(const struct tst_suite *suite, const char *path,
return NULL;
}
-static int close_html(FILE *f)
-{
- fprintf(f, " </table>n </body>n</html>n");
- return fclose(f);
-}
-
static int close_json(FILE *f)
{
fprintf(f, "nt]n}n");
@@ -515,9 +245,6 @@ static int close_json(FILE *f)
int tst_log_close(FILE *f, enum tst_log_fmt format)
{
switch (format) {
- case TST_LOG_HTML:
- return close_html(f);
- break;
case TST_LOG_JSON:
return close_json(f);
break;
diff --git a/tests/framework/tst_log.h b/tests/framework/tst_log.h
index 413c854..28fecf1 100644
--- a/tests/framework/tst_log.h
+++ b/tests/framework/tst_log.h
@@ -35,7 +35,6 @@ struct tst_suite;
struct tst_job;
enum tst_log_fmt {
- TST_LOG_HTML,
TST_LOG_JSON,
};
diff --git a/tests/framework/tst_suite.c b/tests/framework/tst_suite.c
index 1c0440b..e929225 100644
--- a/tests/framework/tst_suite.c
+++ b/tests/framework/tst_suite.c
@@ -115,7 +115,7 @@ static void test_job_report(const struct tst_job *job)
"------------------------- n");
}
-static int run_test(const struct tst_test *test, FILE *html, FILE *json)
+static int run_test(const struct tst_test *test, FILE *json)
{
struct tst_job job;
@@ -127,7 +127,6 @@ static int run_test(const struct tst_test *test, FILE *html, FILE *json)
* child and parent and the lines in the resulting
* file would be repeated several times.
*/
- fflush(html);
fflush(json);
tst_job_run(&job);
@@ -136,7 +135,6 @@ static int run_test(const struct tst_test *test, FILE *html, FILE *json)
/* report result into stdout */
test_job_report(&job);
- tst_log_append(&job, html, TST_LOG_HTML);
tst_log_append(&job, json, TST_LOG_JSON);
/* Free the test message store */
@@ -155,12 +153,11 @@ void tst_run_suite(const struct tst_suite *suite, const char *tst_name)
fprintf(stderr, "Running e[1;37m%se[0mnn", suite->suite_name);
//TODO:
- FILE *html = tst_log_open(suite, "log.html", TST_LOG_HTML);
FILE *json = tst_log_open(suite, "log.json", TST_LOG_JSON);
for (i = 0; suite->tests[i].name != NULL; i++) {
if (tst_name == NULL || !strcmp(tst_name, suite->tests[i].name)) {
- ret = run_test(&suite->tests[i], html, json);
+ ret = run_test(&suite->tests[i], json);
counters[ret]++;
if (ret != TST_SKIPPED)
@@ -168,7 +165,6 @@ void tst_run_suite(const struct tst_suite *suite, const char *tst_name)
}
}
- tst_log_close(html, TST_LOG_HTML);
tst_log_close(json, TST_LOG_JSON);
float percents;
-----------------------------------------------------------------------
Summary of changes:
tests/framework/Makefile | 2 +-
tests/framework/json_parse.py | 72 ----------
tests/framework/log2html.py | 289 +++++++++++++++++++++++++++++++++++++++++
tests/framework/tst_log.c | 273 --------------------------------------
tests/framework/tst_log.h | 1 -
tests/framework/tst_suite.c | 8 +-
6 files changed, 292 insertions(+), 353 deletions(-)
delete mode 100755 tests/framework/json_parse.py
create mode 100755 tests/framework/log2html.py
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos(a)gmail.com
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
gfxprim.git ("A simple 2D graphics library with emphasis on correctness and well-defined operation.")
1
0
[repo.or.cz] gfxprim.git branch master updated: d87921f9670a726993a5bfd756e3ae09a3ba83ed
by metan 22 Nov '12
by metan 22 Nov '12
22 Nov '12
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project gfxprim.git.
The branch, master has been updated
via d87921f9670a726993a5bfd756e3ae09a3ba83ed (commit)
from 75851e6234cc1c67c2c0bf730ef434ebf43227fe (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/w/gfxprim.git/commit/d87921f9670a726993a5bfd756e3ae09a3ba…
commit d87921f9670a726993a5bfd756e3ae09a3ba83ed
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Thu Nov 22 17:38:24 2012 +0100
loaders: Avoid further work when loader issued ENOSYS.
diff --git a/libs/loaders/GP_Loader.c b/libs/loaders/GP_Loader.c
index 3d626a6..4966757 100644
--- a/libs/loaders/GP_Loader.c
+++ b/libs/loaders/GP_Loader.c
@@ -255,6 +255,13 @@ GP_Context *GP_LoadImage(const char *src_path, GP_ProgressCallback *callback)
return img;
}
+ /*
+ * Avoid further work if signature was correct but the loader issued
+ * ENOSYS.
+ */
+ if (errno == ENOSYS)
+ return NULL;
+
sig_load = loader_by_signature(src_path);
if (ext_load && sig_load) {
-----------------------------------------------------------------------
Summary of changes:
libs/loaders/GP_Loader.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos(a)gmail.com
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
gfxprim.git ("A simple 2D graphics library with emphasis on correctness and well-defined operation.")
1
0
[repo.or.cz] gfxprim.git branch master updated: 75851e6234cc1c67c2c0bf730ef434ebf43227fe
by metan 21 Nov '12
by metan 21 Nov '12
21 Nov '12
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project gfxprim.git.
The branch, master has been updated
via 75851e6234cc1c67c2c0bf730ef434ebf43227fe (commit)
from 9d337186e86fbed784c7a616d9a41c969c079e61 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/w/gfxprim.git/commit/75851e6234cc1c67c2c0bf730ef434ebf432…
commit 75851e6234cc1c67c2c0bf730ef434ebf43227fe
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Wed Nov 21 23:43:54 2012 +0100
gfx: Fix "no newline at the end of file" warnings.
diff --git a/include/gfx/GP_AngleUtils.h b/include/gfx/GP_AngleUtils.h
index f896b37..6d8bd67 100644
--- a/include/gfx/GP_AngleUtils.h
+++ b/include/gfx/GP_AngleUtils.h
@@ -27,4 +27,4 @@
double GP_NormalizeAngle(double phi);
int GP_AngleInRange(double angle, double start, double end);
-#endif
No newline at end of file
+#endif
diff --git a/libs/gfx/GP_AngleUtils.c b/libs/gfx/GP_AngleUtils.c
index f1c279b..67911b4 100644
--- a/libs/gfx/GP_AngleUtils.c
+++ b/libs/gfx/GP_AngleUtils.c
@@ -46,4 +46,4 @@ int GP_AngleInRange(double angle, double start, double end)
return (angle >= start && angle <= 2*M_PI)
|| (angle >= 0 && angle <= end);
}
-}
No newline at end of file
+}
-----------------------------------------------------------------------
Summary of changes:
include/gfx/GP_AngleUtils.h | 2 +-
libs/gfx/GP_AngleUtils.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos(a)gmail.com
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
gfxprim.git ("A simple 2D graphics library with emphasis on correctness and well-defined operation.")
1
0
[repo.or.cz] gfxprim.git branch master updated: 9d337186e86fbed784c7a616d9a41c969c079e61
by metan 21 Nov '12
by metan 21 Nov '12
21 Nov '12
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project gfxprim.git.
The branch, master has been updated
via 9d337186e86fbed784c7a616d9a41c969c079e61 (commit)
from 253ef469ede882b4b2bea7d25661d50fdda8d767 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/w/gfxprim.git/commit/9d337186e86fbed784c7a616d9a41c969c07…
commit 9d337186e86fbed784c7a616d9a41c969c079e61
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Wed Nov 21 23:39:49 2012 +0100
tests: framework: Silence stderr when lscpu is not found.
diff --git a/tests/framework/tst_log.c b/tests/framework/tst_log.c
index 9daec17..cc86b6f 100644
--- a/tests/framework/tst_log.c
+++ b/tests/framework/tst_log.c
@@ -444,7 +444,7 @@ static void write_system_info_json(FILE *f)
fprintf(f, "tt"CPU": {");
/* lscpu is part of reasonably new util-linux */
- FILE *cmd = popen("lscpu", "r");
+ FILE *cmd = popen("lscpu 2> /dev/null", "r");
if (cmd != NULL) {
char id[256], val[1024];
-----------------------------------------------------------------------
Summary of changes:
tests/framework/tst_log.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos(a)gmail.com
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
gfxprim.git ("A simple 2D graphics library with emphasis on correctness and well-defined operation.")
1
0
[repo.or.cz] gfxprim.git branch master updated: 253ef469ede882b4b2bea7d25661d50fdda8d767
by metan 21 Nov '12
by metan 21 Nov '12
21 Nov '12
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project gfxprim.git.
The branch, master has been updated
via 253ef469ede882b4b2bea7d25661d50fdda8d767 (commit)
from 22301c3c370f269b10b84582ee524b46abf70019 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/w/gfxprim.git/commit/253ef469ede882b4b2bea7d25661d50fdda8…
commit 253ef469ede882b4b2bea7d25661d50fdda8d767
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Wed Nov 21 23:32:14 2012 +0100
tests: Remove forgotten -lSDL
diff --git a/tests/drivers/Makefile b/tests/drivers/Makefile
index c2d2679..3a028d8 100644
--- a/tests/drivers/Makefile
+++ b/tests/drivers/Makefile
@@ -2,7 +2,7 @@ TOPDIR=../..
CSOURCES=$(shell echo *.c)
-LDLIBS+=-lGP -lGP_backends -lSDL -L$(TOPDIR)/build/
+LDLIBS+=-lGP -lGP_backends -L$(TOPDIR)/build/
APPS=$(CSOURCES:.c=)
-----------------------------------------------------------------------
Summary of changes:
tests/drivers/Makefile | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos(a)gmail.com
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
gfxprim.git ("A simple 2D graphics library with emphasis on correctness and well-defined operation.")
1
0
[repo.or.cz] gfxprim.git branch master updated: 22301c3c370f269b10b84582ee524b46abf70019
by metan 21 Nov '12
by metan 21 Nov '12
21 Nov '12
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project gfxprim.git.
The branch, master has been updated
via 22301c3c370f269b10b84582ee524b46abf70019 (commit)
from ec5c8093c73872736480da4c97cbce5245fd6dc5 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/w/gfxprim.git/commit/22301c3c370f269b10b84582ee524b46abf7…
commit 22301c3c370f269b10b84582ee524b46abf70019
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Wed Nov 21 23:29:15 2012 +0100
loaders: Provide GP_MatchXXX ENOSYS stubs.
diff --git a/libs/loaders/GP_GIF.c b/libs/loaders/GP_GIF.c
index c4e2d2e..8eba747 100644
--- a/libs/loaders/GP_GIF.c
+++ b/libs/loaders/GP_GIF.c
@@ -358,6 +358,12 @@ GP_Context *GP_LoadGIF(const char *src_path, GP_ProgressCallback *callback)
#else
+int GP_MatchGIF(const void GP_UNUSED(*buf))
+{
+ errno = ENOSYS;
+ return -1;
+}
+
int GP_OpenGIF(const char GP_UNUSED(*src_path),
void GP_UNUSED(**f))
{
diff --git a/libs/loaders/GP_JPG.c b/libs/loaders/GP_JPG.c
index bc47c4b..0e04ce6 100644
--- a/libs/loaders/GP_JPG.c
+++ b/libs/loaders/GP_JPG.c
@@ -407,6 +407,12 @@ err0:
#else
+int GP_MatchJPG(const void GP_UNUSED(*buf))
+{
+ errno = ENOSYS;
+ return -1;
+}
+
int GP_OpenJPG(const char GP_UNUSED(*src_path), FILE GP_UNUSED(**f))
{
errno = ENOSYS;
diff --git a/libs/loaders/GP_PNG.c b/libs/loaders/GP_PNG.c
index 275d4be..87d9eca 100644
--- a/libs/loaders/GP_PNG.c
+++ b/libs/loaders/GP_PNG.c
@@ -551,6 +551,12 @@ err0:
#else
+int GP_MatchPNG(const void GP_UNUSED(*buf))
+{
+ errno = ENOSYS;
+ return -1;
+}
+
int GP_OpenPNG(const char GP_UNUSED(*src_path),
FILE GP_UNUSED(**f))
{
-----------------------------------------------------------------------
Summary of changes:
libs/loaders/GP_GIF.c | 6 ++++++
libs/loaders/GP_JPG.c | 6 ++++++
libs/loaders/GP_PNG.c | 6 ++++++
3 files changed, 18 insertions(+), 0 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos(a)gmail.com
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
gfxprim.git ("A simple 2D graphics library with emphasis on correctness and well-defined operation.")
1
0
[repo.or.cz] gfxprim.git branch master updated: ec5c8093c73872736480da4c97cbce5245fd6dc5
by metan 21 Nov '12
by metan 21 Nov '12
21 Nov '12
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project gfxprim.git.
The branch, master has been updated
via ec5c8093c73872736480da4c97cbce5245fd6dc5 (commit)
from a1c7fb9eab833787770f97497d38a17799d490c8 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/w/gfxprim.git/commit/ec5c8093c73872736480da4c97cbce5245fd…
commit ec5c8093c73872736480da4c97cbce5245fd6dc5
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Wed Nov 21 23:16:29 2012 +0100
filters: Silence wrongly generated warnings.
Some older gcc wrongly thinks that x and y
are used uninitialized. Silence the warning
by initializing them to 0.
diff --git a/include/filters/GP_HilbertCurve.h b/include/filters/GP_HilbertCurve.h
index fecac22..f5283c8 100644
--- a/include/filters/GP_HilbertCurve.h
+++ b/include/filters/GP_HilbertCurve.h
@@ -55,7 +55,11 @@ static inline void GP_HilbertCurveInit(struct GP_CurveState *state, int n)
static inline void GP_HilbertCurveGetXY(struct GP_CurveState *state)
{
int sa, sb;
- unsigned int i, temp, x, y;
+ /*
+ * Older gcc thinks that x and y are used uninitialized that is not
+ * true so we silence the warning by initializing them.
+ */
+ unsigned int i, temp, x = 0, y = 0;
for (i = 0; i < 2 * state->n; i += 2) {
sa = (state->s >> (i+1)) & 0x01;
-----------------------------------------------------------------------
Summary of changes:
include/filters/GP_HilbertCurve.h | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos(a)gmail.com
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
gfxprim.git ("A simple 2D graphics library with emphasis on correctness and well-defined operation.")
1
0
[repo.or.cz] gfxprim.git branch master updated: a1c7fb9eab833787770f97497d38a17799d490c8
by metan 21 Nov '12
by metan 21 Nov '12
21 Nov '12
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project gfxprim.git.
The branch, master has been updated
via a1c7fb9eab833787770f97497d38a17799d490c8 (commit)
via 6a14d2a8a7056ffdf6ed6ee04b2a441795d38b5f (commit)
from d2cdbe621395f3e2f5cf5f814491a33f814bb4eb (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/w/gfxprim.git/commit/a1c7fb9eab833787770f97497d38a17799d4…
commit a1c7fb9eab833787770f97497d38a17799d490c8
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Wed Nov 21 23:08:36 2012 +0100
tests: framework: Include correct header for malloc
diff --git a/tests/framework/tst_alloc_barriers.c b/tests/framework/tst_alloc_barriers.c
index c5aa7ad..315480e 100644
--- a/tests/framework/tst_alloc_barriers.c
+++ b/tests/framework/tst_alloc_barriers.c
@@ -22,7 +22,7 @@
#include <stdio.h>
#include <sys/mman.h>
-#include <malloc.h>
+#include <stdlib.h>
#include <unistd.h>
#include "tst_alloc_barriers.h"
http://repo.or.cz/w/gfxprim.git/commit/6a14d2a8a7056ffdf6ed6ee04b2a441795d3…
commit 6a14d2a8a7056ffdf6ed6ee04b2a441795d38b5f
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Wed Nov 21 23:07:35 2012 +0100
core: Remove unused include endian.h
diff --git a/include/core/GP_WritePixel.h b/include/core/GP_WritePixel.h
index 18a4ef6..0d1a875 100644
--- a/include/core/GP_WritePixel.h
+++ b/include/core/GP_WritePixel.h
@@ -26,7 +26,6 @@
#ifndef GP_WRITEPIXEL_H
#define GP_WRITEPIXEL_H
-#include <endian.h>
#include <stdint.h>
#include <unistd.h>
-----------------------------------------------------------------------
Summary of changes:
include/core/GP_WritePixel.h | 1 -
tests/framework/tst_alloc_barriers.c | 2 +-
2 files changed, 1 insertions(+), 2 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos(a)gmail.com
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
gfxprim.git ("A simple 2D graphics library with emphasis on correctness and well-defined operation.")
1
0
[repo.or.cz] gfxprim.git branch master updated: d2cdbe621395f3e2f5cf5f814491a33f814bb4eb
by metan 21 Nov '12
by metan 21 Nov '12
21 Nov '12
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project gfxprim.git.
The branch, master has been updated
via d2cdbe621395f3e2f5cf5f814491a33f814bb4eb (commit)
via 047ce730dcb1c40acf586439be2fc64352e74621 (commit)
via 0ddba05bdb8c901c75b4797e9d281ce1d6307e5e (commit)
from e90eda658220809b70c37e954d2624e3cfdcd5ea (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/w/gfxprim.git/commit/d2cdbe621395f3e2f5cf5f814491a33f814b…
commit d2cdbe621395f3e2f5cf5f814491a33f814bb4eb
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Wed Nov 21 23:34:24 2012 +0100
tests: Port blittest to backends.
diff --git a/demos/c_simple/Makefile b/demos/c_simple/Makefile
index 03c91c5..708a3ca 100644
--- a/demos/c_simple/Makefile
+++ b/demos/c_simple/Makefile
@@ -9,7 +9,7 @@ LDLIBS+=-lrt `$(TOPDIR)/gfxprim-config --libs --libs-backends`
APPS=backend_example loaders_example loaders filters_symmetry gfx_koch virtual_backend_example meta_data meta_data_dump tmp_file showimage v4l2_show v4l2_grab convolution weighted_median shapetest koch input- fileview linetest randomshapetest fonttest loaders_register
+ fileview linetest randomshapetest fonttest loaders_register blittest
v4l2_show: LDLIBS+=-lGP_grabbers
v4l2_grab: LDLIBS+=-lGP_grabbers
diff --git a/tests/SDL/ball.ppm b/demos/c_simple/ball.ppm
similarity index 100%
rename from tests/SDL/ball.ppm
rename to demos/c_simple/ball.ppm
diff --git a/tests/SDL/blittest.c b/demos/c_simple/blittest.c
similarity index 51%
rename from tests/SDL/blittest.c
rename to demos/c_simple/blittest.c
index c23776c..013bf07 100644
--- a/tests/SDL/blittest.c
+++ b/demos/c_simple/blittest.c
@@ -23,48 +23,25 @@
* *
*****************************************************************************/
-#include <stdlib.h>
-#include <stdio.h>
-#include <errno.h>
-#include <SDL/SDL.h>
-
-#include "GP.h"
-#include "GP_SDL.h"
+#include <GP.h>
static GP_Pixel black;
static GP_Pixel white;
-SDL_Surface *display = NULL;
-GP_Context context;
-GP_Context *bitmap, *bitmap_raw, *bitmap_conv;
-
-SDL_TimerID timer;
-
-SDL_UserEvent timer_event;
-
-static int pause_flag = 0;
+static GP_Backend *win;
+static GP_Context *bitmap, *bitmap_raw, *bitmap_conv;
static int bitmap_x, bitmap_y, bitmap_vx = -3, bitmap_vy = -3;
-
-Uint32 timer_callback(__attribute__((unused)) Uint32 interval,
- __attribute__((unused)) void *param)
-{
- timer_event.type = SDL_USEREVENT;
- SDL_PushEvent((SDL_Event *) &timer_event);
- return 10;
-}
+static int pause_flag = 0;
static char text_buf[255];
void redraw_screen(void)
{
- if (pause_flag)
- return;
-
bitmap_x += bitmap_vx;
bitmap_y += bitmap_vy;
- if (bitmap_x + GP_ContextW(bitmap) > context.w) {
+ if (bitmap_x + GP_ContextW(bitmap) > win->context->w) {
bitmap_vx = -bitmap_vx;
bitmap_x += bitmap_vx;
}
@@ -74,7 +51,7 @@ void redraw_screen(void)
bitmap_x += bitmap_vx;
}
- if (bitmap_y + GP_ContextH(bitmap) > context.h) {
+ if (bitmap_y + GP_ContextH(bitmap) > win->context->h) {
bitmap_vy = -bitmap_vy;
bitmap_y += bitmap_vy;
}
@@ -84,25 +61,21 @@ void redraw_screen(void)
bitmap_y += bitmap_vy;
}
- SDL_LockSurface(display);
-
- GP_FillRectXYWH(&context, 20, 20, 300, 50, black);
+ GP_FillRectXYWH(win->context, 20, 20, 300, 50, black);
- GP_Text(&context, NULL, 20, 20, GP_ALIGN_RIGHT|GP_VALIGN_BOTTOM,
+ GP_Text(win->context, NULL, 20, 20, GP_ALIGN_RIGHT|GP_VALIGN_BOTTOM,
white, black, text_buf);
- GP_Print(&context, NULL, 250, 20, GP_ALIGN_RIGHT|GP_VALIGN_BOTTOM,
+ GP_Print(win->context, NULL, 250, 20, GP_ALIGN_RIGHT|GP_VALIGN_BOTTOM,
white, black, "%c|%c|%c", bitmap->x_swap ? 'x' : ' ',
bitmap->y_swap ? 'y' : ' ', bitmap->axes_swap ? 'a' : ' ');
GP_Blit(bitmap, 0, 0, GP_ContextW(bitmap), GP_ContextH(bitmap),
- &context, bitmap_x, bitmap_y);
-
- SDL_UpdateRect(display, bitmap_x, bitmap_y,
- GP_ContextW(bitmap), GP_ContextH(bitmap));
- SDL_UpdateRect(display, 20, 20, 400, 50);
+ win->context, bitmap_x, bitmap_y);
- SDL_UnlockSurface(display);
+ GP_BackendUpdateRectXYWH(win, bitmap_x, bitmap_y,
+ GP_ContextW(bitmap), GP_ContextH(bitmap));
+ GP_BackendUpdateRectXYWH(win, 20, 20, 400, 50);
}
static void change_bitmap(void)
@@ -113,48 +86,52 @@ static void change_bitmap(void)
bitmap = bitmap_raw;
snprintf(text_buf, sizeof(text_buf), "'%s' -> '%s'",
- GP_PixelTypes[bitmap->pixel_type].name,
- GP_PixelTypes[context.pixel_type].name);
+ GP_PixelTypeName(bitmap->pixel_type),
+ GP_PixelTypeName(win->context->pixel_type));
}
void event_loop(void)
{
- SDL_Event event;
-
- while (SDL_WaitEvent(&event) > 0) {
-
- switch (event.type) {
-
- case SDL_USEREVENT:
- redraw_screen();
- break;
- case SDL_KEYDOWN:
- switch (event.key.keysym.sym) {
- case SDLK_p:
- pause_flag = !pause_flag;
- break;
- case SDLK_x:
+ GP_Event ev;
+
+ while (GP_EventGet(&ev)) {
+ GP_EventDump(&ev);
+
+ switch (ev.type) {
+ case GP_EV_KEY:
+ if (ev.code != GP_EV_KEY_DOWN)
+ continue;
+
+ switch (ev.val.key.key) {
+ case GP_KEY_X:
bitmap->x_swap = !bitmap->x_swap;
break;
- case SDLK_y:
+ case GP_KEY_Y:
bitmap->y_swap = !bitmap->y_swap;
break;
- case SDLK_a:
+ case GP_KEY_R:
bitmap->axes_swap = !bitmap->axes_swap;
break;
- case SDLK_SPACE:
+ case GP_KEY_P:
+ pause_flag = !pause_flag;
+ break;
+ case GP_KEY_SPACE:
change_bitmap();
break;
- case SDLK_ESCAPE:
- return;
- default:
- break;
- }
+ case GP_KEY_ESC:
+ GP_BackendExit(win);
+ exit(0);
break;
- case SDL_QUIT:
- return;
- default:
+ }
+ break;
+ case GP_EV_SYS:
+ switch(ev.code) {
+ case GP_EV_SYS_QUIT:
+ GP_BackendExit(win);
+ exit(0);
break;
+ }
+ break;
}
}
}
@@ -162,78 +139,48 @@ void event_loop(void)
void print_instructions(void)
{
printf("Use the following keys to control the test:n");
- printf(" Esc ................. exitn");
- printf(" Space ............... converts bitmap to screen pixel formatn");
- printf(" A ................... swap sprite axesn");
- printf(" X ................... mirror sprite Xn");
- printf(" Y ................... mirror sprite Yn");
- printf(" P ................... pausen");
+ printf(" Esc ............. exitn");
+ printf(" Space ........... converts bitmap to screen pixel formatn");
+ printf(" R ............... swap sprite axesn");
+ printf(" X ............... mirror sprite Xn");
+ printf(" Y ............... mirror sprite Yn");
+ printf(" P ............... pausen");
}
int main(int argc, char *argv[])
{
- int display_bpp = 0;
const char *sprite = "ball.ppm";
+ const char *backend_opts = "X11";
print_instructions();
-
- int i;
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-16") == 0) {
- display_bpp = 16;
- } else if (strcmp(argv[i], "-24") == 0) {
- display_bpp = 24;
- } else if (strcmp(argv[i], "-32") == 0) {
- display_bpp = 32;
- } else {
- sprite = argv[i];
- }
- }
-
- GP_SetDebugLevel(10);
-
- if ((bitmap_raw = GP_LoadImage(sprite, NULL)) == NULL) {
- fprintf(stderr, "Failed to load bitmap: %sn", strerror(errno));
- return 1;
- }
- /* Initialize SDL */
- if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) != 0) {
- fprintf(stderr, "Could not initialize SDL: %sn", SDL_GetError());
+ win = GP_BackendInit(backend_opts, "Line Test", stderr);
+
+ if (win == NULL) {
+ fprintf(stderr, "Failed to initalize backend '%s'n",
+ backend_opts);
return 1;
}
- /* Create a window with a software back surface */
- display = SDL_SetVideoMode(640, 480, display_bpp, SDL_SWSURFACE);
- if (display == NULL) {
- fprintf(stderr, "Could not open display: %sn", SDL_GetError());
- goto fail;
- }
+ bitmap_raw = GP_LoadImage(sprite, NULL);
- GP_SDL_ContextFromSurface(&context, display);
-
- bitmap_conv = GP_ContextConvertAlloc(bitmap_raw, context.pixel_type);
+ bitmap_conv = GP_ContextConvertAlloc(bitmap_raw,
+ win->context->pixel_type);
change_bitmap();
- black = GP_ColorToContextPixel(GP_COL_BLACK, &context);
- white = GP_ColorToContextPixel(GP_COL_WHITE, &context);
+ black = GP_ColorToContextPixel(GP_COL_BLACK, win->context);
+ white = GP_ColorToContextPixel(GP_COL_WHITE, win->context);
- /* Set up the refresh timer */
- timer = SDL_AddTimer(60, timer_callback, NULL);
- if (timer == 0) {
- fprintf(stderr, "Could not set up timer: %sn", SDL_GetError());
- goto fail;
- }
-
- /* Enter the event loop */
- event_loop();
+ for (;;) {
+ GP_BackendPoll(win);
+ event_loop();
+
+ usleep(8000);
- /* We're done */
- SDL_Quit();
- return 0;
+ if (pause_flag)
+ continue;
-fail:
- SDL_Quit();
- return 1;
+ redraw_screen();
+ }
}
diff --git a/tests/SDL/Makefile b/tests/SDL/Makefile
index bea9cd3..ce12dcb 100644
--- a/tests/SDL/Makefile
+++ b/tests/SDL/Makefile
@@ -7,7 +7,7 @@ LDLIBS+=-lGP -L$(TOPDIR)/build/ -lGP_SDL -lSDL
ifeq ($(HAVE_LIBSDL),yes)
CSOURCES=$(shell echo *.c)
-APPS=textaligntest blittest subcontext+APPS=textaligntest subcontext mixpixeltest
endif
diff --git a/tests/SDL/ball.pgm b/tests/SDL/ball.pgm
deleted file mode 100644
index 9f9487f..0000000
--- a/tests/SDL/ball.pgm
+++ /dev/null
@@ -1,10004 +0,0 @@
-P2
-# CREATOR: GIMP PNM Filter Version 1.1
-100 100
-255
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-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-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-3
-6
-10
-13
-16
-18
-21
-23
-26
-28
-30
-32
-33
-34
-36
-36
-37
-36
-37
-37
-37
-36
-35
-34
-33
-32
-30
-28
-26
-24
-22
-19
-16
-13
-10
-6
-3
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-1
-6
-9
-12
-16
-19
-22
-25
-28
-30
-32
-35
-37
-38
-40
-42
-43
-43
-43
-44
-44
-44
-44
-43
-42
-41
-40
-39
-36
-35
-33
-30
-27
-25
-22
-19
-16
-13
-9
-6
-2
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-3
-7
-12
-15
-19
-23
-25
-29
-31
-34
-37
-39
-41
-43
-45
-46
-48
-49
-50
-50
-51
-51
-51
-51
-50
-49
-48
-47
-45
-43
-42
-39
-37
-34
-32
-29
-26
-23
-19
-15
-11
-7
-4
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-4
-9
-13
-17
-21
-25
-29
-31
-35
-38
-41
-43
-46
-48
-50
-52
-53
-55
-56
-57
-57
-59
-58
-58
-58
-57
-56
-55
-53
-52
-50
-48
-46
-44
-41
-38
-35
-32
-29
-25
-21
-17
-13
-9
-5
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-1
-5
-10
-14
-19
-23
-27
-31
-34
-38
-41
-44
-48
-50
-52
-54
-57
-59
-61
-62
-63
-64
-64
-65
-66
-65
-64
-64
-63
-62
-61
-59
-57
-55
-53
-50
-47
-44
-41
-38
-34
-31
-27
-23
-19
-14
-10
-6
-1
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-2
-7
-11
-16
-20
-24
-29
-33
-37
-41
-44
-47
-51
-54
-57
-59
-62
-63
-66
-67
-69
-70
-71
-72
-72
-72
-72
-71
-71
-70
-69
-68
-66
-64
-62
-59
-57
-54
-51
-47
-44
-40
-36
-33
-29
-25
-20
-15
-11
-7
-1
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-1
-6
-11
-16
-21
-26
-30
-35
-38
-43
-46
-50
-53
-56
-60
-63
-66
-68
-70
-72
-75
-76
-77
-78
-79
-80
-80
-79
-78
-78
-77
-76
-74
-72
-70
-68
-66
-63
-60
-56
-53
-50
-46
-43
-39
-34
-30
-25
-21
-16
-12
-7
-1
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-1
-7
-12
-16
-21
-26
-30
-36
-40
-44
-48
-52
-56
-59
-63
-66
-69
-72
-75
-78
-79
-81
-82
-84
-85
-86
-86
-86
-86
-86
-85
-84
-83
-81
-79
-77
-75
-72
-69
-67
-64
-60
-56
-52
-48
-44
-40
-35
-30
-26
-21
-16
-11
-6
-1
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-6
-11
-16
-21
-27
-31
-36
-40
-45
-50
-54
-58
-62
-65
-70
-73
-76
-78
-81
-84
-86
-88
-90
-91
-92
-92
-93
-93
-93
-93
-92
-91
-89
-88
-86
-84
-81
-79
-76
-72
-70
-65
-62
-58
-54
-50
-46
-41
-36
-31
-26
-22
-16
-11
-6
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-5
-10
-16
-21
-26
-31
-37
-41
-46
-51
-56
-60
-64
-68
-72
-75
-79
-82
-85
-87
-90
-93
-94
-97
-98
-99
-100
-101
-100
-101
-100
-99
-98
-96
-95
-93
-90
-88
-85
-82
-79
-75
-72
-68
-64
-60
-55
-51
-46
-41
-36
-31
-26
-21
-16
-10
-5
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-3
-9
-15
-20
-25
-31
-36
-41
-46
-52
-56
-61
-65
-69
-74
-78
-81
-85
-89
-91
-95
-97
-99
-101
-103
-104
-106
-106
-107
-107
-107
-107
-106
-104
-104
-101
-99
-97
-94
-91
-88
-85
-81
-78
-73
-70
-65
-60
-55
-51
-46
-42
-36
-31
-25
-20
-15
-9
-4
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-1
-8
-14
-18
-24
-30
-36
-41
-46
-52
-57
-61
-66
-71
-75
-80
-83
-87
-91
-95
-98
-100
-103
-106
-108
-110
-112
-113
-114
-114
-114
-114
-114
-113
-112
-110
-108
-106
-104
-101
-98
-94
-92
-87
-84
-80
-75
-71
-66
-61
-56
-51
-46
-41
-35
-29
-24
-18
-13
-8
-2
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-5
-11
-17
-22
-29
-34
-40
-46
-51
-56
-61
-66
-71
-75
-80
-84
-89
-93
-97
-101
-104
-107
-110
-113
-115
-117
-119
-120
-121
-121
-121
-121
-121
-120
-118
-117
-115
-112
-110
-108
-104
-100
-97
-93
-89
-85
-81
-76
-71
-66
-61
-56
-51
-45
-40
-35
-28
-23
-17
-11
-6
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-3
-9
-15
-21
-27
-33
-39
-44
-50
-55
-60
-66
-71
-77
-81
-85
-90
-95
-99
-103
-107
-110
-113
-116
-119
-122
-124
-126
-127
-128
-128
-129
-128
-128
-127
-126
-123
-122
-119
-116
-114
-110
-107
-103
-99
-95
-90
-86
-81
-76
-71
-65
-61
-55
-49
-44
-39
-33
-26
-21
-15
-9
-3
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-7
-13
-19
-25
-31
-37
-42
-48
-54
-60
-65
-70
-75
-81
-86
-91
-96
-100
-104
-108
-112
-116
-120
-122
-126
-128
-130
-132
-133
-134
-135
-135
-136
-134
-133
-132
-131
-129
-125
-123
-120
-116
-112
-109
-105
-100
-95
-91
-86
-81
-75
-70
-65
-60
-53
-48
-42
-37
-30
-25
-19
-13
-6
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-3
-10
-16
-22
-28
-34
-40
-46
-52
-58
-64
-69
-75
-80
-85
-91
-96
-101
-106
-110
-115
-119
-122
-126
-130
-132
-135
-137
-139
-141
-141
-142
-143
-142
-142
-140
-140
-137
-135
-132
-130
-126
-122
-119
-115
-110
-106
-100
-96
-91
-86
-81
-75
-69
-64
-58
-52
-46
-40
-34
-28
-23
-16
-10
-4
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-7
-13
-19
-25
-31
-38
-44
-50
-56
-62
-68
-73
-79
-85
-91
-96
-101
-106
-111
-116
-119
-124
-129
-132
-136
-139
-141
-144
-146
-148
-148
-149
-150
-149
-148
-148
-146
-144
-141
-139
-135
-132
-128
-125
-120
-115
-111
-106
-101
-96
-90
-85
-79
-73
-68
-62
-56
-50
-44
-37
-32
-26
-20
-13
-7
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-3
-9
-16
-22
-29
-35
-41
-47
-53
-60
-66
-72
-78
-83
-90
-95
-100
-105
-111
-116
-121
-125
-130
-134
-138
-141
-144
-148
-150
-152
-154
-156
-156
-157
-156
-156
-154
-152
-151
-148
-145
-142
-138
-134
-130
-125
-120
-115
-111
-105
-100
-95
-89
-84
-78
-71
-66
-60
-54
-47
-41
-35
-29
-22
-16
-10
-3
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-6
-12
-19
-25
-31
-38
-44
-51
-56
-63
-70
-75
-82
-88
-94
-99
-105
-110
-116
-120
-125
-130
-135
-140
-144
-147
-151
-154
-157
-159
-161
-163
-163
-164
-164
-162
-161
-160
-157
-154
-151
-148
-144
-140
-135
-131
-126
-121
-116
-110
-105
-99
-93
-88
-81
-76
-69
-63
-57
-51
-44
-38
-32
-25
-19
-12
-6
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-1
-8
-14
-21
-27
-35
-40
-47
-54
-60
-67
-73
-78
-85
-91
-97
-103
-109
-114
-120
-125
-131
-136
-141
-145
-149
-153
-157
-161
-164
-166
-168
-170
-171
-170
-170
-169
-168
-166
-164
-161
-158
-154
-150
-145
-140
-135
-131
-126
-120
-115
-109
-103
-97
-91
-85
-79
-72
-66
-60
-54
-47
-40
-35
-28
-21
-15
-8
-1
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-3
-11
-17
-23
-30
-37
-44
-50
-57
-63
-69
-76
-82
-89
-95
-100
-106
-113
-118
-125
-130
-135
-141
-146
-150
-155
-159
-163
-167
-170
-173
-175
-177
-177
-178
-177
-177
-175
-172
-170
-167
-163
-159
-155
-151
-145
-141
-135
-130
-124
-119
-112
-107
-101
-95
-88
-82
-75
-69
-63
-57
-50
-44
-37
-31
-24
-17
-10
-4
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-6
-12
-20
-26
-33
-39
-46
-53
-59
-66
-72
-79
-85
-91
-97
-104
-110
-116
-122
-128
-134
-140
-145
-150
-155
-160
-164
-169
-173
-176
-180
-182
-184
-184
-185
-184
-183
-181
-179
-177
-173
-169
-165
-160
-155
-150
-145
-139
-134
-129
-123
-116
-110
-104
-98
-91
-85
-79
-72
-66
-60
-53
-46
-40
-32
-26
-19
-13
-6
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-1
-7
-15
-21
-28
-35
-41
-48
-55
-61
-68
-75
-82
-88
-95
-100
-108
-114
-120
-126
-132
-138
-144
-150
-155
-161
-166
-170
-175
-179
-182
-186
-188
-190
-191
-191
-191
-190
-189
-186
-183
-179
-175
-170
-165
-160
-155
-149
-144
-138
-132
-126
-119
-114
-107
-100
-94
-88
-81
-75
-69
-61
-55
-48
-42
-35
-28
-21
-15
-8
-1
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-2
-10
-17
-23
-30
-36
-43
-50
-57
-64
-71
-77
-83
-90
-98
-104
-110
-116
-123
-129
-136
-142
-147
-153
-160
-165
-171
-175
-180
-185
-189
-192
-195
-197
-199
-199
-199
-197
-195
-192
-189
-185
-180
-176
-171
-165
-159
-153
-148
-141
-135
-129
-123
-117
-110
-103
-97
-91
-84
-77
-70
-64
-57
-50
-44
-37
-30
-23
-17
-9
-2
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-4
-11
-18
-25
-32
-39
-45
-53
-59
-66
-73
-79
-86
-93
-100
-106
-112
-119
-126
-132
-138
-145
-151
-158
-164
-169
-175
-181
-186
-191
-195
-199
-201
-204
-205
-206
-205
-204
-201
-199
-194
-190
-185
-180
-175
-169
-163
-157
-151
-145
-139
-132
-126
-119
-113
-106
-99
-93
-86
-79
-73
-65
-59
-52
-45
-38
-31
-25
-18
-11
-4
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-5
-13
-20
-26
-33
-40
-47
-54
-60
-67
-74
-81
-87
-95
-102
-108
-115
-121
-128
-134
-142
-148
-155
-161
-167
-173
-179
-184
-190
-196
-200
-204
-207
-210
-212
-213
-212
-210
-208
-204
-200
-195
-190
-184
-179
-173
-167
-161
-155
-148
-141
-134
-128
-122
-115
-108
-101
-94
-88
-82
-74
-67
-60
-54
-47
-40
-33
-26
-19
-12
-5
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-7
-13
-20
-28
-34
-41
-49
-55
-61
-69
-76
-83
-90
-97
-103
-110
-117
-124
-131
-137
-144
-150
-157
-164
-170
-176
-182
-189
-194
-200
-205
-210
-214
-217
-219
-220
-219
-217
-214
-210
-205
-200
-194
-188
-183
-176
-170
-164
-157
-150
-144
-137
-130
-124
-117
-110
-103
-96
-90
-83
-75
-69
-62
-55
-49
-42
-35
-28
-20
-14
-7
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-7
-14
-21
-29
-36
-42
-49
-56
-63
-70
-77
-84
-91
-98
-104
-112
-118
-125
-132
-139
-146
-153
-159
-166
-173
-179
-185
-192
-198
-205
-210
-215
-220
-224
-226
-227
-226
-223
-220
-216
-210
-204
-198
-192
-186
-179
-172
-166
-159
-153
-146
-139
-132
-125
-119
-111
-105
-98
-91
-84
-77
-70
-63
-56
-49
-42
-35
-28
-22
-14
-7
-1
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-1
-8
-15
-22
-29
-36
-43
-50
-57
-64
-71
-78
-85
-92
-99
-106
-113
-120
-126
-133
-141
-148
-154
-161
-168
-175
-182
-188
-195
-201
-208
-214
-220
-225
-230
-232
-234
-233
-230
-225
-220
-214
-208
-202
-195
-189
-182
-175
-169
-161
-154
-147
-141
-134
-126
-120
-113
-105
-99
-92
-85
-78
-71
-64
-57
-50
-43
-36
-29
-22
-15
-8
-1
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-1
-9
-16
-23
-30
-37
-44
-51
-57
-65
-71
-79
-85
-93
-100
-107
-114
-121
-127
-135
-141
-148
-155
-163
-169
-176
-183
-190
-197
-204
-210
-217
-223
-230
-235
-239
-241
-240
-235
-230
-223
-217
-211
-204
-197
-191
-184
-176
-169
-162
-156
-149
-142
-135
-127
-120
-114
-107
-99
-92
-85
-79
-72
-65
-57
-50
-44
-36
-30
-23
-16
-8
-1
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-2
-9
-16
-23
-30
-37
-44
-51
-58
-65
-73
-79
-86
-93
-100
-108
-114
-121
-128
-135
-143
-149
-157
-164
-171
-177
-184
-191
-198
-205
-212
-219
-226
-233
-239
-245
-248
-245
-239
-233
-226
-219
-212
-205
-198
-192
-184
-178
-170
-163
-157
-149
-143
-135
-128
-122
-114
-107
-100
-93
-86
-79
-72
-65
-58
-51
-44
-37
-30
-23
-15
-9
-2
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-2
-9
-16
-23
-30
-37
-44
-51
-58
-65
-72
-79
-86
-93
-101
-107
-115
-121
-129
-135
-143
-149
-157
-163
-170
-178
-184
-192
-199
-206
-213
-219
-227
-234
-241
-248
-255
-248
-241
-234
-226
-220
-213
-206
-198
-192
-184
-178
-171
-163
-157
-149
-143
-135
-129
-122
-115
-108
-101
-93
-86
-79
-72
-66
-59
-51
-44
-37
-30
-23
-16
-9
-2
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-2
-9
-16
-23
-29
-36
-44
-51
-58
-65
-72
-79
-87
-93
-100
-107
-114
-121
-128
-135
-142
-150
-156
-164
-170
-177
-184
-191
-199
-205
-213
-220
-226
-233
-240
-245
-248
-245
-239
-233
-226
-219
-212
-205
-198
-192
-185
-177
-170
-163
-157
-150
-142
-136
-129
-121
-114
-107
-100
-93
-86
-80
-73
-65
-58
-51
-44
-37
-30
-23
-16
-9
-2
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-2
-8
-16
-22
-30
-37
-43
-51
-57
-64
-72
-79
-86
-92
-100
-106
-114
-121
-128
-135
-142
-149
-156
-163
-169
-176
-183
-190
-197
-204
-210
-217
-223
-229
-235
-240
-241
-239
-235
-230
-223
-217
-211
-204
-197
-190
-183
-176
-169
-162
-156
-149
-142
-135
-128
-121
-114
-106
-100
-93
-86
-78
-72
-65
-58
-50
-44
-37
-29
-23
-16
-8
-2
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-1
-8
-15
-22
-29
-36
-43
-50
-57
-64
-71
-78
-85
-92
-99
-106
-113
-120
-126
-134
-141
-148
-154
-161
-168
-174
-181
-189
-195
-201
-208
-214
-220
-226
-230
-233
-234
-232
-229
-225
-220
-214
-208
-201
-195
-189
-182
-175
-168
-161
-155
-147
-140
-134
-127
-120
-113
-106
-98
-92
-85
-78
-71
-64
-57
-50
-43
-36
-29
-22
-15
-8
-1
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-1
-8
-14
-21
-29
-36
-42
-50
-56
-64
-70
-77
-84
-91
-98
-105
-111
-119
-125
-132
-139
-146
-153
-159
-166
-173
-180
-185
-192
-198
-204
-210
-216
-220
-223
-226
-227
-226
-224
-220
-215
-210
-204
-199
-192
-186
-179
-173
-166
-159
-153
-146
-139
-132
-126
-119
-111
-105
-98
-91
-84
-77
-70
-63
-56
-50
-42
-36
-29
-21
-15
-7
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-6
-13
-21
-27
-34
-41
-48
-55
-62
-69
-75
-82
-90
-97
-103
-110
-117
-123
-131
-137
-143
-151
-158
-163
-170
-176
-183
-189
-194
-200
-206
-210
-214
-217
-219
-219
-219
-217
-214
-210
-205
-200
-195
-189
-183
-176
-170
-164
-157
-151
-144
-138
-131
-124
-117
-110
-103
-97
-90
-82
-75
-69
-62
-55
-48
-41
-35
-27
-21
-13
-6
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-5
-12
-20
-26
-33
-40
-47
-54
-61
-68
-74
-81
-88
-95
-102
-109
-115
-122
-128
-135
-141
-148
-154
-161
-167
-173
-179
-184
-190
-195
-200
-205
-208
-211
-212
-213
-212
-211
-208
-204
-200
-196
-190
-184
-179
-173
-167
-161
-154
-148
-142
-135
-128
-121
-115
-108
-101
-95
-87
-81
-74
-68
-61
-53
-47
-39
-33
-26
-20
-13
-5
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-4
-11
-18
-25
-31
-39
-45
-53
-58
-66
-72
-79
-86
-93
-99
-106
-113
-120
-125
-132
-139
-145
-151
-157
-163
-169
-175
-181
-185
-190
-194
-198
-202
-204
-205
-206
-205
-204
-201
-199
-194
-190
-186
-180
-175
-170
-163
-158
-151
-145
-139
-132
-126
-119
-113
-106
-100
-93
-86
-80
-73
-65
-59
-52
-45
-39
-31
-25
-18
-11
-4
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-3
-10
-17
-23
-30
-37
-44
-50
-57
-64
-70
-77
-83
-90
-97
-103
-110
-116
-123
-129
-135
-142
-147
-154
-160
-165
-170
-176
-180
-185
-189
-192
-195
-197
-199
-199
-198
-197
-195
-192
-189
-185
-180
-175
-170
-165
-159
-154
-148
-142
-135
-129
-123
-116
-110
-103
-97
-90
-84
-77
-70
-64
-57
-50
-44
-36
-30
-23
-16
-9
-3
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-1
-8
-15
-22
-29
-35
-42
-48
-55
-61
-69
-75
-81
-88
-95
-101
-107
-114
-119
-126
-132
-138
-144
-149
-155
-160
-165
-170
-175
-179
-183
-186
-188
-190
-191
-192
-191
-190
-189
-186
-182
-179
-175
-170
-166
-160
-155
-149
-144
-138
-132
-126
-119
-113
-108
-101
-95
-88
-81
-75
-68
-62
-55
-48
-41
-35
-29
-21
-15
-7
-1
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-6
-13
-20
-26
-32
-39
-46
-52
-60
-65
-73
-79
-85
-92
-97
-104
-111
-117
-122
-128
-134
-140
-145
-151
-156
-160
-165
-169
-173
-177
-179
-182
-183
-184
-185
-184
-183
-182
-179
-176
-173
-169
-165
-161
-156
-150
-146
-140
-134
-128
-122
-117
-111
-104
-98
-91
-86
-79
-72
-66
-59
-52
-46
-39
-32
-26
-19
-12
-6
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-3
-10
-18
-24
-30
-36
-44
-50
-57
-63
-69
-76
-82
-88
-95
-101
-107
-113
-119
-125
-129
-135
-140
-146
-150
-155
-159
-163
-167
-170
-173
-174
-177
-178
-177
-177
-176
-175
-173
-170
-167
-163
-159
-155
-151
-146
-141
-136
-130
-124
-118
-112
-107
-100
-95
-88
-82
-76
-70
-63
-57
-50
-44
-37
-31
-24
-17
-11
-4
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-2
-8
-15
-21
-28
-34
-41
-47
-54
-60
-67
-73
-79
-85
-91
-97
-103
-108
-115
-120
-125
-131
-136
-141
-146
-150
-154
-158
-161
-163
-166
-169
-169
-170
-171
-170
-169
-168
-166
-164
-161
-158
-153
-150
-145
-141
-136
-131
-125
-120
-114
-109
-102
-97
-91
-85
-78
-72
-66
-60
-54
-47
-40
-35
-28
-21
-14
-8
-1
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-5
-13
-18
-25
-32
-38
-45
-51
-57
-63
-69
-75
-81
-88
-93
-99
-104
-110
-115
-121
-126
-130
-135
-140
-144
-148
-151
-154
-157
-159
-161
-163
-163
-164
-163
-162
-161
-160
-157
-155
-151
-147
-143
-139
-135
-131
-126
-120
-115
-110
-104
-99
-93
-87
-82
-76
-69
-63
-57
-51
-45
-38
-32
-25
-18
-12
-5
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-3
-9
-16
-22
-29
-35
-41
-47
-53
-60
-66
-72
-78
-83
-89
-95
-100
-105
-111
-116
-121
-126
-130
-134
-138
-142
-145
-147
-151
-152
-154
-156
-156
-156
-157
-156
-154
-153
-151
-148
-145
-141
-138
-134
-130
-125
-121
-116
-111
-105
-100
-95
-89
-83
-78
-72
-65
-60
-53
-48
-41
-35
-29
-23
-15
-9
-3
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-7
-13
-19
-25
-32
-38
-44
-50
-57
-62
-68
-73
-79
-85
-91
-96
-100
-105
-111
-115
-120
-124
-128
-132
-135
-138
-142
-143
-146
-147
-149
-150
-149
-150
-149
-148
-146
-144
-141
-139
-136
-133
-128
-124
-120
-115
-111
-106
-100
-95
-90
-85
-79
-74
-68
-62
-56
-50
-44
-38
-32
-25
-19
-12
-6
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-3
-10
-16
-22
-29
-35
-41
-47
-52
-58
-63
-70
-75
-80
-85
-91
-96
-101
-106
-110
-115
-119
-123
-126
-129
-132
-135
-137
-139
-140
-142
-142
-143
-142
-142
-141
-139
-137
-135
-133
-129
-126
-123
-118
-114
-110
-105
-101
-96
-91
-85
-81
-75
-70
-64
-58
-52
-46
-40
-34
-29
-22
-16
-10
-3
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-1
-6
-13
-18
-24
-31
-36
-42
-48
-54
-59
-65
-70
-76
-81
-86
-91
-96
-100
-105
-109
-113
-116
-120
-123
-126
-128
-130
-132
-134
-134
-135
-136
-135
-135
-133
-132
-130
-128
-126
-123
-119
-116
-113
-109
-105
-100
-95
-91
-86
-81
-76
-70
-65
-60
-54
-49
-43
-36
-31
-25
-19
-12
-7
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-3
-9
-15
-21
-27
-33
-39
-44
-50
-55
-60
-66
-71
-76
-81
-85
-90
-94
-99
-103
-107
-110
-113
-116
-119
-122
-124
-125
-127
-128
-128
-129
-128
-128
-127
-126
-124
-122
-119
-116
-113
-110
-106
-103
-99
-95
-91
-86
-81
-76
-71
-66
-61
-56
-50
-44
-39
-32
-27
-21
-15
-9
-3
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-5
-11
-17
-22
-29
-34
-40
-46
-51
-56
-61
-66
-71
-76
-81
-85
-89
-93
-97
-101
-104
-107
-110
-113
-114
-117
-118
-120
-121
-121
-122
-121
-121
-120
-119
-117
-115
-113
-110
-107
-105
-100
-97
-94
-89
-85
-80
-76
-71
-66
-61
-56
-50
-46
-40
-34
-29
-23
-17
-11
-5
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-1
-7
-13
-19
-24
-30
-35
-41
-46
-51
-56
-61
-66
-71
-75
-79
-83
-87
-91
-94
-98
-101
-104
-106
-108
-110
-112
-113
-114
-114
-114
-114
-114
-113
-111
-110
-108
-106
-104
-101
-98
-95
-92
-87
-83
-79
-75
-71
-66
-61
-56
-52
-46
-41
-36
-30
-24
-18
-13
-7
-2
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-4
-9
-15
-20
-25
-31
-36
-41
-46
-51
-56
-61
-65
-69
-73
-78
-81
-85
-88
-91
-94
-97
-100
-101
-103
-104
-106
-106
-107
-108
-107
-106
-106
-105
-103
-101
-100
-97
-94
-91
-88
-84
-82
-77
-74
-69
-65
-61
-56
-51
-46
-41
-36
-30
-25
-20
-15
-9
-3
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-4
-10
-16
-21
-26
-31
-37
-41
-46
-50
-55
-59
-64
-68
-72
-75
-79
-82
-85
-88
-91
-93
-95
-97
-98
-99
-100
-100
-100
-100
-100
-99
-98
-96
-94
-93
-91
-88
-85
-82
-79
-75
-71
-68
-64
-59
-56
-50
-46
-41
-36
-31
-26
-21
-15
-10
-4
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-6
-11
-16
-21
-26
-31
-36
-41
-45
-50
-54
-58
-62
-66
-70
-72
-75
-79
-81
-84
-86
-88
-90
-91
-92
-93
-93
-93
-93
-93
-91
-91
-90
-88
-85
-84
-81
-78
-75
-72
-70
-66
-62
-58
-54
-50
-46
-41
-36
-31
-26
-21
-16
-11
-6
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-1
-6
-11
-17
-22
-27
-31
-36
-39
-44
-49
-53
-56
-59
-63
-66
-69
-72
-75
-77
-79
-81
-82
-84
-85
-86
-86
-86
-86
-86
-84
-84
-83
-81
-79
-77
-74
-72
-70
-66
-63
-59
-56
-52
-48
-45
-40
-35
-31
-26
-21
-16
-11
-6
-1
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-2
-6
-12
-16
-21
-26
-30
-34
-38
-42
-46
-50
-54
-57
-60
-63
-65
-68
-70
-73
-75
-76
-77
-78
-79
-80
-79
-79
-78
-78
-77
-76
-74
-72
-70
-68
-66
-63
-60
-57
-54
-50
-46
-43
-38
-34
-30
-26
-21
-16
-11
-6
-1
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-1
-6
-11
-16
-20
-24
-28
-33
-37
-41
-44
-48
-51
-54
-56
-59
-61
-63
-66
-67
-68
-70
-71
-71
-72
-72
-72
-71
-71
-70
-69
-67
-66
-64
-62
-59
-57
-54
-51
-47
-44
-41
-37
-33
-29
-24
-20
-15
-11
-6
-1
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-1
-5
-10
-15
-19
-23
-27
-31
-35
-38
-41
-45
-47
-51
-52
-55
-57
-59
-61
-62
-63
-64
-64
-65
-65
-65
-64
-64
-63
-62
-60
-58
-57
-55
-53
-51
-47
-44
-41
-38
-34
-31
-27
-23
-19
-14
-10
-5
-1
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-5
-9
-13
-17
-21
-25
-29
-32
-35
-38
-41
-44
-46
-48
-50
-52
-53
-55
-56
-58
-58
-58
-58
-58
-58
-57
-56
-55
-54
-52
-50
-48
-46
-44
-41
-38
-35
-31
-29
-25
-21
-17
-13
-9
-4
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-4
-8
-12
-15
-18
-22
-25
-28
-32
-35
-37
-40
-41
-44
-46
-47
-48
-49
-50
-51
-51
-51
-51
-51
-50
-49
-48
-47
-45
-43
-41
-39
-37
-34
-32
-29
-25
-22
-19
-15
-11
-7
-4
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-1
-5
-9
-12
-16
-20
-22
-25
-28
-30
-33
-35
-37
-39
-40
-41
-42
-43
-44
-44
-45
-44
-44
-43
-43
-41
-40
-38
-36
-35
-32
-30
-28
-25
-23
-19
-16
-12
-9
-6
-1
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-3
-7
-10
-13
-16
-18
-21
-23
-26
-28
-30
-31
-33
-35
-36
-36
-36
-37
-37
-37
-37
-36
-35
-35
-34
-31
-30
-28
-26
-23
-22
-19
-16
-13
-10
-7
-3
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-4
-6
-10
-12
-15
-17
-19
-21
-24
-25
-26
-28
-28
-29
-30
-30
-30
-30
-29
-29
-28
-28
-26
-25
-23
-22
-19
-17
-15
-12
-10
-6
-3
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-3
-6
-8
-10
-13
-15
-16
-18
-19
-21
-21
-22
-23
-23
-23
-23
-22
-23
-21
-20
-19
-17
-16
-14
-13
-11
-8
-6
-3
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-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
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
http://repo.or.cz/w/gfxprim.git/commit/047ce730dcb1c40acf586439be2fc64352e7…
commit 047ce730dcb1c40acf586439be2fc64352e74621
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Wed Nov 21 23:33:27 2012 +0100
backends: Add GP_BackendUpdateXYWH().
diff --git a/include/backends/GP_Backend.h b/include/backends/GP_Backend.h
index 159892d..64b504d 100644
--- a/include/backends/GP_Backend.h
+++ b/include/backends/GP_Backend.h
@@ -139,9 +139,23 @@ static inline void GP_BackendFlip(GP_Backend *backend)
/*
* Calls backend->UpdateRect().
*/
-void GP_BackendUpdateRect(GP_Backend *backend,
- GP_Coord x0, GP_Coord y0,
- GP_Coord x1, GP_Coord y1);
+void GP_BackendUpdateRectXYXY(GP_Backend *backend,
+ GP_Coord x0, GP_Coord y0,
+ GP_Coord x1, GP_Coord y1);
+
+static inline void GP_BackendUpdateRect(GP_Backend *backend,
+ GP_Coord x0, GP_Coord y0,
+ GP_Coord x1, GP_Coord y1)
+{
+ return GP_BackendUpdateRectXYXY(backend, x0, y0, x1, y1);
+}
+
+static inline void GP_BackendUpdateRectXYWH(GP_Backend *backend,
+ GP_Coord x, GP_Coord y,
+ GP_Size w, GP_Size h)
+{
+ GP_BackendUpdateRectXYXY(backend, x, y, x + w, y + h);
+}
/*
* Calls backend->Exit().
diff --git a/libs/backends/GP_Backend.c b/libs/backends/GP_Backend.c
index 88b52a3..036fd56 100644
--- a/libs/backends/GP_Backend.c
+++ b/libs/backends/GP_Backend.c
@@ -25,16 +25,16 @@
#include "backends/GP_Backend.h"
-void GP_BackendUpdateRect(GP_Backend *backend,
- GP_Coord x0, GP_Coord y0,
- GP_Coord x1, GP_Coord y1)
+void GP_BackendUpdateRectXYXY(GP_Backend *backend,
+ GP_Coord x0, GP_Coord y0,
+ GP_Coord x1, GP_Coord y1)
{
GP_TRANSFORM_POINT(backend->context, x0, y0);
GP_TRANSFORM_POINT(backend->context, x1, y1);
if (x1 < x0)
GP_SWAP(x0, x1);
-
+
if (y1 < y0)
GP_SWAP(y0, y1);
http://repo.or.cz/w/gfxprim.git/commit/0ddba05bdb8c901c75b4797e9d281ce1d630…
commit 0ddba05bdb8c901c75b4797e9d281ce1d6307e5e
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Wed Nov 21 20:55:17 2012 +0100
tests: SDL: Remove aatest.c.
diff --git a/tests/SDL/Makefile b/tests/SDL/Makefile
index 1a27121..bea9cd3 100644
--- a/tests/SDL/Makefile
+++ b/tests/SDL/Makefile
@@ -8,7 +8,7 @@ ifeq ($(HAVE_LIBSDL),yes)
CSOURCES=$(shell echo *.c)
APPS=textaligntest blittest subcontext- aatest mixpixeltest
+ mixpixeltest
endif
include $(TOPDIR)/app.mk
diff --git a/tests/SDL/aatest.c b/tests/SDL/aatest.c
deleted file mode 100644
index 6eba9a6..0000000
--- a/tests/SDL/aatest.c
+++ /dev/null
@@ -1,168 +0,0 @@
-/*****************************************************************************
- * This file is part of gfxprim library. *
- * *
- * Gfxprim is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU Lesser General Public *
- * License as published by the Free Software Foundation; either *
- * version 2.1 of the License, or (at your option) any later version. *
- * *
- * Gfxprim is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with gfxprim; if not, write to the Free Software *
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
- * Boston, MA 02110-1301 USA *
- * *
- * Copyright (C) 2009-2010 Jiri "BlueBear" Dluhos *
- * <jiri.bluebear.dluhos(a)gmail.com> *
- * *
- * Copyright (C) 2009-2012 Cyril Hrubis <metan(a)ucw.cz> *
- * *
- *****************************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <SDL/SDL.h>
-
-#include "GP.h"
-#include "GP_SDL.h"
-
-SDL_Surface *display = NULL;
-GP_Context context;
-
-static GP_Coord x = 10 * GP_FP_1 + GP_FP_1_2;
-static GP_Coord y = 10 * GP_FP_1 + GP_FP_1_2;
-
-SDL_UserEvent timer_event;
-
-GP_Pixel red_pixel, green_pixel, blue_pixel, white_pixel;
-
-static void draw(void)
-{
- GP_Context *ctx = &context;
-
- GP_Fill(ctx, white_pixel);
-
- GP_Coord i;
-
- for (i = 0; i < 24; i++) {
- // GP_FillRect(ctx, (x>>8), (y + (10*i<<8) - 128)>>8,
- // (x>>8) + 60, (y + ((10*i)<<8) + 64*i + 64 + 128)>>8, green_pixel);
-
- GP_FillRect_AA(ctx, x, y + ((10*i)<<8),
- x + (60<<8), y + ((10*i)<<8) + 64*i + 64, 0);
-
- GP_FillRect_AA(ctx, x + (80<<8), y + ((10*i)<<8) + 64,
- x + (140<<8), y + ((10*i)<<8) + 64*i + 128, 0);
-
- GP_FillRect_AA(ctx, x + (160<<8), y + ((10*i)<<8) + 128,
- x + (220<<8), y + ((10*i)<<8) + 64*i + 192, 0);
-
- GP_FillRect_AA(ctx, x + (240<<8), y + ((10*i)<<8) + 192,
- x + (300<<8), y + ((10*i)<<8) + 64*i + 256, 0);
- printf("%i --------------------------------------------------------n", i);
- }
-
- SDL_Flip(display);
-}
-
-void event_loop(void)
-{
- SDL_Event event;
-
- while (SDL_WaitEvent(&event) > 0) {
- switch (event.type) {
- case SDL_KEYDOWN:
- switch (event.key.keysym.sym) {
- case SDLK_DOWN:
- y += 64;
- draw();
- break;
- case SDLK_UP:
- y -= 64;
- draw();
- break;
- case SDLK_LEFT:
- x -= 64;
- draw();
- break;
- case SDLK_RIGHT:
- x += 64;
- draw();
- break;
- case SDLK_x:
- context.x_swap = !context.x_swap;
- draw();
- break;
- case SDLK_y:
- context.y_swap = !context.y_swap;
- draw();
- break;
- case SDLK_r:
- context.axes_swap = !context.axes_swap;
- draw();
- break;
- case SDLK_ESCAPE:
- case SDLK_q:
- return;
- default:
- break;
- }
- break;
- case SDL_QUIT:
- return;
- }
- }
-}
-
-int main(int argc, char **argv)
-{
- int display_bpp = 0;
-
- int i;
- for (i = 1; i < argc; i++) {
- if (strcmp(argv[i], "-16") == 0) {
- display_bpp = 16;
- } else if (strcmp(argv[i], "-24") == 0) {
- display_bpp = 24;
- }
- }
-
- if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) != 0) {
- fprintf(stderr, "Could not initialize SDL: %sn", SDL_GetError());
- return 1;
- }
-
- display = SDL_SetVideoMode(320, 320, display_bpp, SDL_SWSURFACE);
- if (display == NULL) {
- fprintf(stderr, "Could not open display: %sn", SDL_GetError());
- goto fail;
- }
-
-
- printf("Display surface properties:n");
- printf(" width: %4d, height: %4d, pitch: %4dn",
- display->w, display->h, display->pitch);
- printf(" bits per pixel: %2d, bytes per pixel: %2dn",
- display->format->BitsPerPixel, display->format->BytesPerPixel);
-
- GP_SDL_ContextFromSurface(&context, display);
-
- red_pixel = GP_ColorToContextPixel(GP_COL_RED, &context);
- green_pixel = GP_ColorToContextPixel(GP_COL_GREEN, &context);
- blue_pixel = GP_ColorToContextPixel(GP_COL_BLUE, &context);
- white_pixel = GP_ColorToContextPixel(GP_COL_WHITE, &context);
-
- draw();
-
- event_loop();
- SDL_Quit();
- return 0;
-
-fail:
- SDL_Quit();
- return 1;
-}
-----------------------------------------------------------------------
Summary of changes:
demos/c_simple/Makefile | 2 +-
{tests/SDL => demos/c_simple}/ball.ppm | Bin 30054 -> 30054 bytes
{tests/SDL => demos/c_simple}/blittest.c | 195 +-
include/backends/GP_Backend.h | 20 +-
libs/backends/GP_Backend.c | 8 +-
tests/SDL/Makefile | 4 +-
tests/SDL/aatest.c | 168 -
tests/SDL/ball.pgm |10004 ------------------------------
8 files changed, 95 insertions(+), 10306 deletions(-)
rename {tests/SDL => demos/c_simple}/ball.ppm (100%)
rename {tests/SDL => demos/c_simple}/blittest.c (51%)
delete mode 100644 tests/SDL/aatest.c
delete mode 100644 tests/SDL/ball.pgm
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos(a)gmail.com
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
gfxprim.git ("A simple 2D graphics library with emphasis on correctness and well-defined operation.")
1
0