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, generate has been updated via 1a194b0be00177f64b07ebc7b37f474c1625d12d (commit) via fefd3418defdf1a85898c8718927e4edde8fedec (commit) via f172f952d6cd25be836e5c3f353246ae49e95b89 (commit) via 13152d697784f7cd03f92396f17ad3c98452b9b5 (commit) from 6d5f5d2abd2ff4494d7c38418e4bdf686acb3f89 (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/1a194b0be00177f64b07ebc7b37f474c1625d...
commit 1a194b0be00177f64b07ebc7b37f474c1625d12d Author: Cyril Hrubis metan@ucw.cz Date: Sat Aug 20 18:00:39 2011 +0200
Fix wrong parameters order (first pixel then pixel_type).
diff --git a/include/core/GP_Convert.h b/include/core/GP_Convert.h index d33d417..8b5fb6a 100644 --- a/include/core/GP_Convert.h +++ b/include/core/GP_Convert.h @@ -113,7 +113,7 @@ static inline GP_Pixel GP_ConvertContextPixel(GP_Pixel pixel, const GP_Context *from, const GP_Context *to) { - return GP_RGBA8888ToPixel(GP_PixelToRGBA8888(from->pixel_type, pixel), + return GP_RGBA8888ToPixel(GP_PixelToRGBA8888(pixel, from->pixel_type), to->pixel_type); }
http://repo.or.cz/w/gfxprim.git/commit/fefd3418defdf1a85898c8718927e4edde8fe...
commit fefd3418defdf1a85898c8718927e4edde8fedec Author: Cyril Hrubis metan@ucw.cz Date: Sat Aug 20 17:54:35 2011 +0200
Minor coding style fix.
diff --git a/libs/core/GP_Convert.gen.c.t b/libs/core/GP_Convert.gen.c.t index 2969066..86560b5 100644 --- a/libs/core/GP_Convert.gen.c.t +++ b/libs/core/GP_Convert.gen.c.t @@ -14,7 +14,7 @@ GP_Pixel GP_{{ pt.name }}ToPixel(GP_Pixel pixel, GP_PixelType type) { GP_Pixel p = 0; - switch(type) { + switch (type) { %% for tf in pixeltypes %% if tf.is_unknown() case GP_PIXEL_UNKNOWN: @@ -40,7 +40,7 @@ GP_Pixel GP_{{ pt.name }}ToPixel(GP_Pixel pixel, GP_PixelType type) GP_Pixel GP_PixelTo{{ pt.name }}(GP_Pixel pixel, GP_PixelType type) { GP_Pixel p = 0; - switch(type) { + switch (type) { %% for sf in pixeltypes %% if sf.is_unknown() case GP_PIXEL_UNKNOWN:
http://repo.or.cz/w/gfxprim.git/commit/f172f952d6cd25be836e5c3f353246ae49e95...
commit f172f952d6cd25be836e5c3f353246ae49e95b89 Author: Cyril Hrubis metan@ucw.cz Date: Sat Aug 20 17:24:18 2011 +0200
Pixel matching now uses debug interface.
diff --git a/libs/core/GP_Pixel.c b/libs/core/GP_Pixel.c index 0132c7a..bd9f463 100644 --- a/libs/core/GP_Pixel.c +++ b/libs/core/GP_Pixel.c @@ -19,12 +19,13 @@ * Copyright (C) 2009-2010 Jiri "BlueBear" Dluhos * * jiri.bluebear.dluhos@gmail.com * * * - * Copyright (C) 2009-2010 Cyril Hrubis metan@ucw.cz * + * Copyright (C) 2009-2011 Cyril Hrubis metan@ucw.cz * * * *****************************************************************************/
#include <string.h>
+#include "GP_Debug.h" #include "GP_Pixel.h"
static const GP_PixelTypeChannel *get_channel(const GP_PixelTypeDescription *desc, @@ -42,7 +43,7 @@ static const GP_PixelTypeChannel *get_channel(const GP_PixelTypeDescription *des static int match(const GP_PixelTypeChannel *channel, GP_Pixel mask) { if (channel == NULL) { - printf("%s gen %08x pass %08xn", channel->name, 0, mask); + GP_DEBUG(3, "%s gen %08x pass %08x", channel->name, 0, mask); return !mask; }
@@ -50,8 +51,7 @@ static int match(const GP_PixelTypeChannel *channel, GP_Pixel mask)
chmask >>= (GP_PIXEL_BITS - channel->size); chmask <<= channel->offset; - - printf("%s gen %08x pass %08xn", channel->name, chmask, mask); + GP_DEBUG(3, "%s gen %08x pass %08x", channel->name, chmask, mask);
return (chmask == mask); } @@ -62,6 +62,9 @@ GP_PixelType GP_PixelRGBMatch(GP_Pixel rmask, GP_Pixel gmask, { unsigned int i;
+ GP_DEBUG(1, "Matching Pixel R %08x G %08x B %08x A %08x size %u", + rmask, gmask, bmask, amask, pixel_size); + for (i = 0; i < GP_PIXEL_MAX; i++) { int res;
@@ -75,25 +78,29 @@ GP_PixelType GP_PixelRGBMatch(GP_Pixel rmask, GP_Pixel gmask, b = get_channel(&GP_PixelTypes[i], "B"); a = get_channel(&GP_PixelTypes[i], "A");
- printf("------------------------ %s %un", GP_PixelTypes[i].name, pixel_size); + GP_DEBUG(2, "Trying Pixel %s %u", + GP_PixelTypes[i].name, pixel_size);
if (r) - printf("Matching R %i %in", r->size, r->offset); + GP_DEBUG(3, "Matching R %i %i", r->size, r->offset); if (g) - printf("Matching G %i %in", g->size, g->offset); + GP_DEBUG(3, "Matching G %i %i", g->size, g->offset); if (b) - printf("Matching B %i %in", b->size, b->offset); + GP_DEBUG(3, "Matching B %i %i", b->size, b->offset); if (a) - printf("Matching A %i %in", a->size, a->offset); + GP_DEBUG(3, "Matching A %i %i", a->size, a->offset); res = match(r, rmask) && match(g, gmask) && match(b, bmask) && match(a, amask);
- if (res) + if (res) { + GP_DEBUG(1, "Pixel found type id %u name '%s'", + GP_PixelTypes[i].type, GP_PixelTypes[i].name); return GP_PixelTypes[i].type; + } }
return GP_PIXEL_UNKNOWN;
http://repo.or.cz/w/gfxprim.git/commit/13152d697784f7cd03f92396f17ad3c98452b...
commit 13152d697784f7cd03f92396f17ad3c98452b9b5 Author: Cyril Hrubis metan@ucw.cz Date: Sat Aug 20 17:12:18 2011 +0200
Added simple debug print functionality.
diff --git a/include/core/GP_Core.h b/include/core/GP_Core.h index f4d8e46..705ceb3 100644 --- a/include/core/GP_Core.h +++ b/include/core/GP_Core.h @@ -50,4 +50,7 @@ /* Individual pixel access */ #include "core/GP_GetPutPixel.h"
+/* Debug and debug level */ +#include "core/GP_Debug.h" + #endif /* GP_CORE_H */ diff --git a/include/core/GP_Core.h b/include/core/GP_Debug.h similarity index 57% copy from include/core/GP_Core.h copy to include/core/GP_Debug.h index f4d8e46..2c935ee 100644 --- a/include/core/GP_Core.h +++ b/include/core/GP_Debug.h @@ -16,38 +16,45 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301 USA * * * - * Copyright (C) 2009-2010 Jiri "BlueBear" Dluhos * - * jiri.bluebear.dluhos@gmail.com * - * * - * Copyright (C) 2009-2010 Cyril Hrubis metan@ucw.cz * + * Copyright (C) 2009-2011 Cyril Hrubis metan@ucw.cz * * * *****************************************************************************/
-/* + /* + + Debug messages and debug level. Debug level is an unsigned integer. + + Messages with debug level 0 are always printed (you should generally avoid + using them unless you wan't user to see the message.)
- This is header file for public core API. + Debug level 1 should be used on object initalization and generally rare and + important events.
- */ + Debug level > 1 is intended for more verbose reporting, like inner cycles + or loop debugging.
-#ifndef GP_CORE_H -#define GP_CORE_H + */
-/* Common building blocks */ -#include "core/GP_Common.h" +#ifndef GP_DEBUG_H +#define GP_DEBUG_H
-/* Context ... */ -#include "core/GP_Context.h" +#include <stdio.h> +#include <stdint.h> +#include <stdlib.h> +#include <unistd.h>
-/* ... and it's trasformations */ -#include "core/GP_Transform.h" +#define GP_DEFAULT_DEBUG_LEVEL 0
-/* Pixeltypes */ -#include "core/GP_Pixel.h" +#define GP_DEBUG(level, ...) do { + if (level <= GP_GetDebugLevel()) { + fprintf(stderr, "%s:%s():%u: ", __FILE__, __FUNCTION__, __LINE__); + fprintf(stderr, __VA_ARGS__); + fputc('n', stderr); + } +} while (0)
-/* Pixel conversions */ -#include "core/GP_Convert.h" +void GP_SetDebugLevel(unsigned int level);
-/* Individual pixel access */ -#include "core/GP_GetPutPixel.h" +unsigned int GP_GetDebugLevel(void);
-#endif /* GP_CORE_H */ +#endif /* GP_DEBUG_H */ diff --git a/include/core/GP_Core.h b/libs/core/GP_Debug.c similarity index 68% copy from include/core/GP_Core.h copy to libs/core/GP_Debug.c index f4d8e46..d3b8cbe 100644 --- a/include/core/GP_Core.h +++ b/libs/core/GP_Debug.c @@ -16,38 +16,20 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301 USA * * * - * Copyright (C) 2009-2010 Jiri "BlueBear" Dluhos * - * jiri.bluebear.dluhos@gmail.com * - * * - * Copyright (C) 2009-2010 Cyril Hrubis metan@ucw.cz * + * Copyright (C) 2009-2011 Cyril Hrubis metan@ucw.cz * * * *****************************************************************************/
-/* - - This is header file for public core API. - - */ - -#ifndef GP_CORE_H -#define GP_CORE_H - -/* Common building blocks */ -#include "core/GP_Common.h" - -/* Context ... */ -#include "core/GP_Context.h" - -/* ... and it's trasformations */ -#include "core/GP_Transform.h" - -/* Pixeltypes */ -#include "core/GP_Pixel.h" +#include "GP_Debug.h"
-/* Pixel conversions */ -#include "core/GP_Convert.h" +static unsigned int GP_debug_level = GP_DEFAULT_DEBUG_LEVEL;
-/* Individual pixel access */ -#include "core/GP_GetPutPixel.h" +void GP_SetDebugLevel(unsigned int level) +{ + GP_debug_level = level; +}
-#endif /* GP_CORE_H */ +unsigned int GP_GetDebugLevel(void) +{ + return GP_debug_level; +}
-----------------------------------------------------------------------
Summary of changes: include/core/GP_Convert.h | 2 +- include/core/GP_Core.h | 3 + .../{input/GP_InputDriverSDL.h => core/GP_Debug.h} | 41 +++++++++++++++----- libs/core/GP_Convert.gen.c.t | 4 +- include/core/GP_Types.h => libs/core/GP_Debug.c | 20 +++++----- libs/core/GP_Pixel.c | 27 ++++++++----- 6 files changed, 64 insertions(+), 33 deletions(-) copy include/{input/GP_InputDriverSDL.h => core/GP_Debug.h} (60%) copy include/core/GP_Types.h => libs/core/GP_Debug.c (86%)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply.