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 6fb527824eda1a4f749d1212a1fcadd680b4bd36 (commit)
from 132863aa4d50fefb0bd28f05de4e816e56c87e77 (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/6fb527824eda1a4f749d1212a1fcadd680b4…
commit 6fb527824eda1a4f749d1212a1fcadd680b4bd36
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Wed Dec 18 22:40:51 2013 +0100
libs: backend: Set timer event timestamp correctly
The time in timer event wasn't initialized.
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/libs/backends/GP_Backend.c b/libs/backends/GP_Backend.c
index 9af3c63..454cb11 100644
--- a/libs/backends/GP_Backend.c
+++ b/libs/backends/GP_Backend.c
@@ -114,6 +114,7 @@ static uint32_t pushevent_callback(GP_Timer *self)
GP_Event ev;
ev.type = GP_EV_TMR;
+ gettimeofday(&ev.time, NULL);
ev.val.tmr = self;
GP_EventQueuePut(self->priv, &ev);
-----------------------------------------------------------------------
Summary of changes:
libs/backends/GP_Backend.c | 1 +
1 files changed, 1 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.")
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 132863aa4d50fefb0bd28f05de4e816e56c87e77 (commit)
via 8a1ac4fff755c365067ea30dc801ecaf0b525113 (commit)
via 994b268f4aba098c33b97c2f0eaf5b24fc42df1e (commit)
from 982f9d91035c3562536ea524b9d16aac1719ce13 (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/132863aa4d50fefb0bd28f05de4e816e56c8…
commit 132863aa4d50fefb0bd28f05de4e816e56c87e77
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Wed Dec 18 11:45:36 2013 +0100
demos: c_simple: Remove abort.c
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/demos/c_simple/Makefile b/demos/c_simple/Makefile
index c32d873..2d91834 100644
--- a/demos/c_simple/Makefile
+++ b/demos/c_simple/Makefile
@@ -17,7 +17,7 @@ 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_example fileview linetest randomshapetest fonttest- loaders_register blittest textaligntest abort sin_AA x11_windows+ loaders_register blittest textaligntest sin_AA x11_windows debug_handler gaussian_noise byte_utils version pretty_print timers zip_container backend_timers_example
diff --git a/demos/c_simple/abort.c b/demos/c_simple/abort.c
deleted file mode 100644
index d9c3e18..0000000
--- a/demos/c_simple/abort.c
+++ /dev/null
@@ -1,33 +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 <GP.h>
-
-int main(void)
-{
- GP_Context *ctx;
-
- /* this call causes library to abort because of invalid parameters */
- ctx = GP_ContextAlloc(0, 0, -1);
-
- return 0;
-}
http://repo.or.cz/w/gfxprim.git/commit/8a1ac4fff755c365067ea30dc801ecaf0b52…
commit 8a1ac4fff755c365067ea30dc801ecaf0b525113
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Wed Dec 18 11:44:00 2013 +0100
doc: text: Fix API docs.
* The GP_Text() function prototype wasn't updated
when background color was added to the parameters.
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/doc/text.txt b/doc/text.txt
index 2ade0f5..3acdd81 100644
--- a/doc/text.txt
+++ b/doc/text.txt
@@ -25,16 +25,17 @@ typedef enum GP_TextAlign {
} GP_TextAlign;
void GP_Text(GP_Context *context, const GP_TextStyle *style,
- int x, int y, int align, const char *str, GP_Pixel pixel);
+ GP_Coord x, GP_Coord y, int align,
+ GP_Pixel fg, GP_Pixel bg, const char *str);
GP_Size GP_Print(GP_Context *context, const GP_TextStyle *style,
GP_Coord x, GP_Coord y, int align,
- GP_Pixel fg_color, GP_Pixel bg_color, const char *fmt, ...);
+ GP_Pixel fg, GP_Pixel bg, const char *fmt, ...);
GP_Size GP_VPrint(GP_Context *context, const GP_TextStyle *style,
GP_Coord x, GP_Coord y, int align,
- GP_Pixel fg_color, GP_Pixel bg_color,
+ GP_Pixel fg, GP_Pixel bg,
const char *fmt, va_list va);
--------------------------------------------------------------------------------
http://repo.or.cz/w/gfxprim.git/commit/994b268f4aba098c33b97c2f0eaf5b24fc42…
commit 994b268f4aba098c33b97c2f0eaf5b24fc42df1e
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Tue Dec 17 23:25:37 2013 +0100
doc: Add two more examples.
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/doc/example_convolution.txt b/doc/example_convolution.txt
new file mode 100644
index 0000000..42321af
--- /dev/null
+++ b/doc/example_convolution.txt
@@ -0,0 +1,7 @@
+2D Linear Convolution
+---------------------
+
+[source,c]
+------------------------------------------------------------------
+include::../demos/c_simple/convolution.c[]
+------------------------------------------------------------------
diff --git a/doc/example_showimage.txt b/doc/example_showimage.txt
new file mode 100644
index 0000000..b363353
--- /dev/null
+++ b/doc/example_showimage.txt
@@ -0,0 +1,8 @@
+Showimage
+---------
+A simple example that loads an image and shows it in X11 window.
+
+[source,c]
+------------------------------------------------------------------
+include::../demos/c_simple/showimage.c[]
+------------------------------------------------------------------
-----------------------------------------------------------------------
Summary of changes:
demos/c_simple/Makefile | 2 +-
demos/c_simple/abort.c | 33 --------------------
doc/{example_input.txt => example_convolution.txt} | 5 +--
...mple_py_showimage.txt => example_showimage.txt} | 6 ++--
doc/text.txt | 7 ++--
5 files changed, 10 insertions(+), 43 deletions(-)
delete mode 100644 demos/c_simple/abort.c
copy doc/{example_input.txt => example_convolution.txt} (54%)
copy doc/{example_py_showimage.txt => example_showimage.txt} (54%)
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.")
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 982f9d91035c3562536ea524b9d16aac1719ce13 (commit)
from 10ef775932c40eaa18aa171b43d2c77450d93e43 (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/982f9d91035c3562536ea524b9d16aac1719…
commit 982f9d91035c3562536ea524b9d16aac1719ce13
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Tue Dec 17 23:25:47 2013 +0100
spiv: cfg: Two fixes.
* Fix opt_by_key() SegFault on config entry without key or name space
* Fix read_key() to stop on '='
(so that parsing key=value (without spaces around the '=') works too)
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/demos/spiv/cfg.c b/demos/spiv/cfg.c
index 629929d..b110e07 100644
--- a/demos/spiv/cfg.c
+++ b/demos/spiv/cfg.c
@@ -39,22 +39,27 @@ struct cfg_opt *opt_by_key(struct cfg_opt *cfg_opts, const char *name_space,
{
struct cfg_opt *i;
- GP_DEBUG(1, "Looking for key '%s' in name space '%s'",
- key, name_space);
+ GP_DEBUG(1, "Looking for key '%s' in [%s]", key, name_space);
for (i = cfg_opts; !terminal(i); i++) {
- if (name_space == NULL) {
- if (i->name_space == NULL && !strcmp(key, i->key))
- break;
- } else {
- if (i->name_space != NULL && !strcmp(key, i->key))
- break;
- }
+ if (!i->key)
+ continue;
+
+ if (name_space && !i->name_space)
+ continue;
+
+ if (name_space && strcmp(i->name_space, name_space))
+ continue;
+
+ if (!strcmp(key, i->key))
+ break;
}
if (terminal(i))
return NULL;
+ GP_DEBUG(1, "Found key '%s' in [%s]", i->key, i->name_space);
+
return i;
}
@@ -215,6 +220,7 @@ static int parse_namespace(struct parser_state *state)
return 1;
case ']':
state->name_space[len] = '0';
+ GP_DEBUG(1, "In namespace [%s]", state->name_space);
return 0;
default:
state->name_space[len++] = c;
@@ -226,9 +232,6 @@ static int parse_namespace(struct parser_state *state)
break;
}
}
-
-
- GP_DEBUG(1, "In namespace '%s'", state->name_space);
}
static int read_key(struct parser_state *state)
@@ -245,6 +248,8 @@ static int read_key(struct parser_state *state)
case EOF:
case ' ':
case 't':
+ case '=':
+ ungetc(c, state->f);
state->buf[len] = '0';
GP_DEBUG(1, "Have key '%s'", state->buf);
return 0;
@@ -352,7 +357,7 @@ static int parse_cfg(struct parser_state *state)
switch (c) {
case EOF:
- GP_DEBUG(1, "End of config reached at %u",
+ GP_DEBUG(1, "End of config reached at line %u",
state->lineno);
return 0;
case 'n':
-----------------------------------------------------------------------
Summary of changes:
demos/spiv/cfg.c | 31 ++++++++++++++++++-------------
1 files changed, 18 insertions(+), 13 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.")
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 10ef775932c40eaa18aa171b43d2c77450d93e43 (commit)
from f960d6c1cdf7c20a15e0227fe54de099acff13e5 (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/10ef775932c40eaa18aa171b43d2c77450d9…
commit 10ef775932c40eaa18aa171b43d2c77450d93e43
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Tue Dec 17 13:03:03 2013 +0100
tests: input: Fix and enable TimeStamp tests.
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/tests/input/TimeStamp.c b/tests/input/TimeStamp.c
index 5ab2dc2..157ed5d 100644
--- a/tests/input/TimeStamp.c
+++ b/tests/input/TimeStamp.c
@@ -27,6 +27,7 @@
*/
#include <stdlib.h>
+#include <unistd.h>
#include <input/GP_TimeStamp.h>
#include "tst_test.h"
@@ -35,9 +36,11 @@
static int time_stamp_monotonicity(void)
{
- uint64_t ts = 0, nts;
+ uint64_t ts = 0, nts, fts;
int i, fail = 0;
+ fts = GP_GetTimeStamp();
+
for (i = 0; i < MAX; i++) {
nts = GP_GetTimeStamp();
if (nts < ts) {
@@ -46,8 +49,11 @@ static int time_stamp_monotonicity(void)
(long long unsigned) ts);
fail++;
}
+ usleep(10);
}
+ tst_msg("Difference %llu", (long long unsigned)(nts - fts));
+
if (fail)
return TST_FAILED;
diff --git a/tests/input/test_list.txt b/tests/input/test_list.txt
index 777c39b..f3fac95 100644
--- a/tests/input/test_list.txt
+++ b/tests/input/test_list.txt
@@ -1,3 +1,4 @@
# Input test list
Timer
+TimeStamp
-----------------------------------------------------------------------
Summary of changes:
tests/input/TimeStamp.c | 8 +++++++-
tests/input/test_list.txt | 1 +
2 files changed, 8 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.")
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 f960d6c1cdf7c20a15e0227fe54de099acff13e5 (commit)
from 407c969f354f0d0234750ec1d6ac07b1a3de7140 (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/f960d6c1cdf7c20a15e0227fe54de099acff…
commit f960d6c1cdf7c20a15e0227fe54de099acff13e5
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Thu Dec 12 23:48:44 2013 +0100
demos: spiv: Fix typo in spiv help.
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/demos/spiv/spiv_help.c b/demos/spiv/spiv_help.c
index 72be0bc..736756d 100644
--- a/demos/spiv/spiv_help.c
+++ b/demos/spiv/spiv_help.c
@@ -89,7 +89,7 @@ static const struct examples examples[] = {
"Shows all images stored in zip file"},
{"spiv .",
"Shows all loadable images in current directory"},
- {"spiv -t 5 vacation/",
+ {"spiv -s 5 vacation/",
"Runs slideshow with 5 second delay"},
{"spiv -1 'cp %F sorted' images/",
"Copies currently loaded image into directory 'sorted/' on pressing F1"},
-----------------------------------------------------------------------
Summary of changes:
demos/spiv/spiv_help.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.")
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 407c969f354f0d0234750ec1d6ac07b1a3de7140 (commit)
from 0d4b41e7f7e0e3df0c3c05e5bdb4ef4aa7f1a678 (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/407c969f354f0d0234750ec1d6ac07b1a3de…
commit 407c969f354f0d0234750ec1d6ac07b1a3de7140
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Thu Dec 12 22:04:42 2013 +0100
input: TimeStamp: Fallback to CLOCK_MONOTOMIC if available
On some machines no clock is precise enough to have 1ms resolution
(notably small ARM machines). This commit makes the TimeStamp to
fallback to CLOCK_MONOTONIC to have at least some timestamps.
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/libs/input/GP_TimeStamp.c b/libs/input/GP_TimeStamp.c
index c22b478..4c33b5e 100644
--- a/libs/input/GP_TimeStamp.c
+++ b/libs/input/GP_TimeStamp.c
@@ -57,6 +57,7 @@ static int choose_clock(clockid_t *clock)
if (clock_getres(CLOCK_MONOTONIC, &ts)) {
GP_DEBUG(1, "CLOCK_MONOTONIC: %s", strerror(errno));
+ //TODO: Fallback to gettimeofday?
return 1;
}
@@ -68,8 +69,15 @@ static int choose_clock(clockid_t *clock)
return 0;
}
- GP_DEBUG(1, "No suitable clock id found.");
- //TODO: Fallback to gettimeofday?
+ if (ts.tv_sec) {
+ GP_FATAL("No suitable clock found");
+ return 1;
+ }
+
+ GP_WARN("Timers running with %lims granularityn",
+ ts.tv_nsec/MS_IN_US);
+
+ *clock = CLOCK_MONOTONIC;
return 1;
}
-----------------------------------------------------------------------
Summary of changes:
libs/input/GP_TimeStamp.c | 12 ++++++++++--
1 files changed, 10 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.")
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 0d4b41e7f7e0e3df0c3c05e5bdb4ef4aa7f1a678 (commit)
via c5be07c4673b42da89470346a5db21e74897e2cf (commit)
from c1a5214d616c7d155bd00f602c1b4f861b5ca7ef (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/0d4b41e7f7e0e3df0c3c05e5bdb4ef4aa7f1…
commit 0d4b41e7f7e0e3df0c3c05e5bdb4ef4aa7f1a678
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Wed Dec 11 22:47:46 2013 +0100
spiv: Fix image cache limits.
The problem was that one part of the code was expecting the limits as
kilo-bytes while the second as bytes. (I'm very ashamed that I have done
such lousy mistake.)
Resulting in excessively large image cache limit (larger than actual
ram) which triggered swapping after large number of images was viewed.
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/demos/spiv/image_cache.c b/demos/spiv/image_cache.c
index 509d507..c030405 100644
--- a/demos/spiv/image_cache.c
+++ b/demos/spiv/image_cache.c
@@ -66,7 +66,7 @@ size_t image_cache_get_ram_size(void)
fclose(f);
- return ret * 1024 / 10;
+ return ret;
}
/*
@@ -83,7 +83,7 @@ static size_t image_size(struct image *img)
return image_size2(img->ctx, img->path);
}
-struct image_cache *image_cache_create(unsigned int max_size_bytes)
+struct image_cache *image_cache_create(unsigned int max_size_kbytes)
{
struct image_cache *self;
@@ -92,13 +92,13 @@ struct image_cache *image_cache_create(unsigned int max_size_bytes)
if (self == NULL)
return NULL;
- self->max_size = max_size_bytes;
+ self->max_size = max_size_kbytes * 1024;
self->cur_size = sizeof(struct image_cache);
self->root = NULL;
self->end = NULL;
- GP_DEBUG(1, "Created image cache size %u bytes", self->max_size);
+ GP_DEBUG(1, "Created image cache max size %ukB", max_size_kbytes);
return self;
}
diff --git a/demos/spiv/image_cache.h b/demos/spiv/image_cache.h
index 84cec1d..b08ed48 100644
--- a/demos/spiv/image_cache.h
+++ b/demos/spiv/image_cache.h
@@ -16,7 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, *
* Boston, MA 02110-1301 USA *
* *
- * Copyright (C) 2009-2012 Cyril Hrubis <metan(a)ucw.cz> *
+ * Copyright (C) 2009-2013 Cyril Hrubis <metan(a)ucw.cz> *
* *
*****************************************************************************/
@@ -37,9 +37,9 @@ struct image_cache;
size_t image_cache_get_ram_size(void);
/*
- * Creates an image cache with maximal memory size.
+ * Creates an image cache with maximal memory size of max_size_kbytes.
*/
-struct image_cache *image_cache_create(unsigned int max_size_bytes);
+struct image_cache *image_cache_create(unsigned int max_size_kbytes);
/*
* Returns cached image, or NULL.
diff --git a/demos/spiv/spiv.c b/demos/spiv/spiv.c
index 74a45a4..b3139d9 100644
--- a/demos/spiv/spiv.c
+++ b/demos/spiv/spiv.c
@@ -651,6 +651,9 @@ static void init_backend(const char *backend_opts)
}
}
+#define RESIZED_CACHE_MAX 400 * 1024
+#define ORIG_CACHE_MAX 80 * 1024
+
/*
* Figure out cache size depending on the size of RAM.
*
@@ -659,13 +662,17 @@ static void init_backend(const char *backend_opts)
static int init_loader(struct loader_params *params, const char **argv)
{
size_t size = image_cache_get_ram_size();
- unsigned int resized_size = (1024 * size)/10;
- unsigned int orig_size = (1024 * size)/50;
+ size_t resized_size = size/10;
+ size_t orig_size = size/50;
+
+ if (resized_size > RESIZED_CACHE_MAX)
+ resized_size = RESIZED_CACHE_MAX;
- if (resized_size > 100 * 1024 * 1024)
- resized_size = 100 * 1024 * 1024;
+ if (orig_size > ORIG_CACHE_MAX)
+ orig_size = ORIG_CACHE_MAX;
- GP_DEBUG(1, "Resized cache size = %u", resized_size);
+ GP_DEBUG(1, "Resized cache size = %zukB", resized_size);
+ GP_DEBUG(1, "Orig cache size = %zukB", orig_size);
if (image_loader_init(argv, orig_size))
return 1;
http://repo.or.cz/w/gfxprim.git/commit/c5be07c4673b42da89470346a5db21e74897…
commit c5be07c4673b42da89470346a5db21e74897e2cf
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Wed Dec 11 21:52:01 2013 +0100
backends: X11: Fix window bitmap buffer init
The w and h may be modified upon the window creation so we must use
wreq.w and wreq.h instead of the user requested w and h.
This fixes bug for X11 backend when root window is used and the image
size was wrongly initialized to whatever user supplied instead of the
root window size.
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/libs/backends/GP_X11.c b/libs/backends/GP_X11.c
index bda3bac..14f6ec2 100644
--- a/libs/backends/GP_X11.c
+++ b/libs/backends/GP_X11.c
@@ -613,8 +613,8 @@ GP_Backend *GP_BackendX11Init(const char *display, int x, int y,
backend->context = NULL;
if ((flags & GP_X11_DISABLE_SHM || !x11_conn.local)
- || create_shm_ximage(backend, w, h)) {
- if (create_ximage(backend, w, h))
+ || create_shm_ximage(backend, wreq.w, wreq.h)) {
+ if (create_ximage(backend, wreq.w, wreq.h))
goto err1;
}
-----------------------------------------------------------------------
Summary of changes:
demos/spiv/image_cache.c | 8 ++++----
demos/spiv/image_cache.h | 6 +++---
demos/spiv/spiv.c | 17 ++++++++++++-----
libs/backends/GP_X11.c | 4 ++--
4 files changed, 21 insertions(+), 14 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.")
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 5152d5c9e93aeedb1b114de10e6e11392bc17bbc (commit)
from d05bcd076fd9c8539d48030a2153444fb7602cb5 (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/5152d5c9e93aeedb1b114de10e6e11392bc1…
commit 5152d5c9e93aeedb1b114de10e6e11392bc17bbc
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Sun Dec 8 20:39:43 2013 +0100
backends: X11: Don't use SHM for remote X11.
Disable SHM if the DISPLAY points to remote machine.
Signed-off-by: Cyril Hrubis <metan(a)ucw.cz>
diff --git a/libs/backends/GP_X11.c b/libs/backends/GP_X11.c
index b938db4..bda3bac 100644
--- a/libs/backends/GP_X11.c
+++ b/libs/backends/GP_X11.c
@@ -612,9 +612,11 @@ GP_Backend *GP_BackendX11Init(const char *display, int x, int y,
backend->context = NULL;
- if ((flags & GP_X11_DISABLE_SHM) || create_shm_ximage(backend, w, h))
+ if ((flags & GP_X11_DISABLE_SHM || !x11_conn.local)
+ || create_shm_ximage(backend, w, h)) {
if (create_ximage(backend, w, h))
goto err1;
+ }
XFlush(win->dpy);
diff --git a/libs/backends/GP_X11_Conn.h b/libs/backends/GP_X11_Conn.h
index 4c5d732..e9e3773 100644
--- a/libs/backends/GP_X11_Conn.h
+++ b/libs/backends/GP_X11_Conn.h
@@ -37,6 +37,9 @@ struct x11_conn {
int S__NET_WM_STATE:1;
int S__NET_WM_STATE_FULLSCREEN:1;
+ /* Is set to 1 if connection is local -> we can use SHM */
+ int local:1;
+
/* reference counter, incremented on window creation */
unsigned int ref_cnt;
};
@@ -98,11 +101,23 @@ static void x11_input_init(void);
static unsigned int x11_open(const char *display)
{
+ const char *disp;
+
if (x11_conn.ref_cnt != 0)
return ++x11_conn.ref_cnt;
GP_DEBUG(1, "Opening X11 display '%s'", display);
+ disp = XDisplayName(display);
+
+ if (disp && disp[0] == ':')
+ x11_conn.local = 1;
+ else
+ x11_conn.local = 0;
+
+ GP_DEBUG(1, "Connection is %s (%s)",
+ x11_conn.local ? "local" : "remote", disp);
+
if (!XInitThreads()) {
GP_DEBUG(2, "XInitThreads failed");
return 0;
-----------------------------------------------------------------------
Summary of changes:
libs/backends/GP_X11.c | 4 +++-
libs/backends/GP_X11_Conn.h | 15 +++++++++++++++
2 files changed, 18 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.")