[gegl] bin: add commmand to toggle mipmap rendering
- From: Øyvind "pippin" Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] bin: add commmand to toggle mipmap rendering
- Date: Wed, 16 Jan 2019 15:46:02 +0000 (UTC)
commit d8ba8a467c35a5ae9434ebb8262cd7c79ed8b7ca
Author: Øyvind Kolås <pippin gimp org>
Date: Sun Jan 13 23:23:21 2019 +0100
bin: add commmand to toggle mipmap rendering
bin/ui.c | 39 ++++++++++++++++++++++++++++++++++++++-
1 file changed, 38 insertions(+), 1 deletion(-)
---
diff --git a/bin/ui.c b/bin/ui.c
index 8db072339..f07547038 100644
--- a/bin/ui.c
+++ b/bin/ui.c
@@ -482,6 +482,11 @@ static gboolean renderer_task (gpointer data)
static gdouble progress = 0.0;
void *old_processor = o->processor;
GeglBuffer *old_buffer = o->processor_buffer;
+
+ if (renderer == GEGL_RENDERER_BLIT||
+ renderer == GEGL_RENDERER_BLIT_MIPMAP)
+ o->renderer_state = 4;
+
switch (o->renderer_state)
{
case 0:
@@ -1008,6 +1013,38 @@ int cmd_dir_pgdn (COMMAND_ARGS) /* "dir-pgdn", 0, "", ""*/
return 0;
}
+
+ int cmd_mipmap (COMMAND_ARGS);
+int cmd_mipmap (COMMAND_ARGS) /* "mipmap", -1, "", ""*/
+{
+ gboolean curval;
+ State *o = hack_state;
+ if (argv[1])
+ {
+ if (!strcmp (argv[1], "on")||
+ !strcmp (argv[1], "true")||
+ !strcmp (argv[1], "1"))
+ {
+ g_object_set (gegl_config(), "mipmap-rendering", TRUE, NULL);
+ renderer = GEGL_RENDERER_BLIT_MIPMAP;
+ }
+ else
+ {
+ g_object_set (gegl_config(), "mipmap-rendering", FALSE, NULL);
+ renderer = GEGL_RENDERER_IDLE;
+ }
+ }
+ else
+ {
+ //printf ("mipmap rendering is %s\n", curval?"on":"off");
+ }
+ g_object_get (gegl_config(), "mipmap-rendering", &curval, NULL);
+ printf ("mipmap rendering is %s\n", curval?"on":"off");
+ renderer_dirty ++;
+ mrg_queue_draw (o->mrg, NULL);
+ return 0;
+}
+
int cmd_dir_pgup (COMMAND_ARGS);
int cmd_dir_pgup (COMMAND_ARGS) /* "dir-pgup", 0, "", ""*/
{
@@ -2630,7 +2667,7 @@ static void load_path (State *o)
o->u = 0;
o->v = 0;
o->is_video = 0;
- o->frame_no = 0;
+ o->frame_no = -1;
o->prev_frame_played = 0;
if (g_str_has_suffix (path, ".gif"))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]