64 lines
1.9 KiB
Diff
64 lines
1.9 KiB
Diff
From 57c0e9be6e96afd1e5d2887ae374d551dc375b2f Mon Sep 17 00:00:00 2001
|
|
From: Alon Levy <alevy@redhat.com>
|
|
Date: Fri, 18 Oct 2013 14:36:22 +0300
|
|
Subject: [PATCH 10/11] cursor-channel.c: add cursor print function for
|
|
debugging only (ifdefed)
|
|
|
|
---
|
|
gtk/channel-cursor.c | 32 ++++++++++++++++++++++++++++++++
|
|
1 file changed, 32 insertions(+)
|
|
|
|
diff --git a/gtk/channel-cursor.c b/gtk/channel-cursor.c
|
|
index 7a985a4..7407521 100644
|
|
--- a/gtk/channel-cursor.c
|
|
+++ b/gtk/channel-cursor.c
|
|
@@ -244,6 +244,35 @@ static void do_emit_main_context(GObject *object, int signum, gpointer params)
|
|
|
|
/* ------------------------------------------------------------------ */
|
|
|
|
+#ifdef DEBUG_CURSOR
|
|
+static void print_cursor(display_cursor *cursor, const guint8 *data)
|
|
+{
|
|
+ int x, y, bpl;
|
|
+ const guint8 *xor, *and;
|
|
+
|
|
+ bpl = (cursor->hdr.width + 7) / 8;
|
|
+ and = data;
|
|
+ xor = and + bpl * cursor->hdr.height;
|
|
+
|
|
+ printf("data (%d x %d):\n", cursor->hdr.width, cursor->hdr.height);
|
|
+ for (y = 0 ; y < cursor->hdr.height; ++y) {
|
|
+ for (x = 0 ; x < cursor->hdr.width / 8; x++) {
|
|
+ printf("%02X", and[x]);
|
|
+ }
|
|
+ and += bpl;
|
|
+ printf("\n");
|
|
+ }
|
|
+ printf("xor:\n");
|
|
+ for (y = 0 ; y < cursor->hdr.height; ++y) {
|
|
+ for (x = 0 ; x < cursor->hdr.width / 8; ++x) {
|
|
+ printf("%02X", xor[x]);
|
|
+ }
|
|
+ xor += bpl;
|
|
+ printf("\n");
|
|
+ }
|
|
+}
|
|
+#endif
|
|
+
|
|
static void mono_cursor(display_cursor *cursor, const guint8 *data)
|
|
{
|
|
const guint8 *xor, *and;
|
|
@@ -254,6 +283,9 @@ static void mono_cursor(display_cursor *cursor, const guint8 *data)
|
|
and = data;
|
|
xor = and + bpl * cursor->hdr.height;
|
|
dest = (uint8_t *)cursor->data;
|
|
+#ifdef DEBUG_CURSOR
|
|
+ print_cursor(cursor, data);
|
|
+#endif
|
|
for (y = 0; y < cursor->hdr.height; y++) {
|
|
bit = 0x80;
|
|
for (x = 0; x < cursor->hdr.width; x++, dest += 4) {
|
|
--
|
|
1.8.3.1
|
|
|