app: use the "no-cpu-accel" command line option again

Call gimp_cpu_accel_set_use() in app_run(). Add "use_cpu_accel"
parameter to gimp_new() and keep it around in the Gimp instance. Pass
the flag to plug-ins again.
This commit is contained in:
Michael Natterer 2013-06-19 20:42:56 +02:00
parent 2e8ef97c13
commit 3cf2c4dd87
5 changed files with 11 additions and 6 deletions

View File

@ -176,10 +176,13 @@ app_run (const gchar *full_prog_name,
no_fonts,
no_interface,
use_shm,
use_cpu_accel,
console_messages,
stack_trace_mode,
pdb_compat_mode);
gimp_cpu_accel_set_use (use_cpu_accel);
errors_init (gimp, full_prog_name, use_debug_handler, stack_trace_mode);
units_init (gimp);

View File

@ -198,6 +198,7 @@ gimp_init (Gimp *gimp)
gimp->no_interface = FALSE;
gimp->show_gui = TRUE;
gimp->use_shm = FALSE;
gimp->use_cpu_accel = TRUE;
gimp->message_handler = GIMP_CONSOLE;
gimp->stack_trace_mode = GIMP_STACK_TRACE_NEVER;
gimp->pdb_compat_mode = GIMP_PDB_COMPAT_OFF;
@ -759,6 +760,7 @@ gimp_new (const gchar *name,
gboolean no_fonts,
gboolean no_interface,
gboolean use_shm,
gboolean use_cpu_accel,
gboolean console_messages,
GimpStackTraceMode stack_trace_mode,
GimpPDBCompatMode pdb_compat_mode)
@ -778,6 +780,7 @@ gimp_new (const gchar *name,
gimp->no_fonts = no_fonts ? TRUE : FALSE;
gimp->no_interface = no_interface ? TRUE : FALSE;
gimp->use_shm = use_shm ? TRUE : FALSE;
gimp->use_cpu_accel = use_cpu_accel ? TRUE : FALSE;
gimp->console_messages = console_messages ? TRUE : FALSE;
gimp->stack_trace_mode = stack_trace_mode;
gimp->pdb_compat_mode = pdb_compat_mode;

View File

@ -49,6 +49,7 @@ struct _Gimp
gboolean no_interface;
gboolean show_gui;
gboolean use_shm;
gboolean use_cpu_accel;
GimpMessageHandlerType message_handler;
gboolean console_messages;
GimpStackTraceMode stack_trace_mode;
@ -151,6 +152,7 @@ Gimp * gimp_new (const gchar *name,
gboolean no_fonts,
gboolean no_interface,
gboolean use_shm,
gboolean use_cpu_accel,
gboolean console_messages,
GimpStackTraceMode stack_trace_mode,
GimpPDBCompatMode pdb_compat_mode);

View File

@ -189,10 +189,7 @@ gimp_plug_in_manager_call_run (GimpPlugInManager *manager,
config.check_type = display_config->transparency_type;
config.show_help_button = (gui_config->use_help &&
gui_config->show_help_button);
#ifdef __GNUC__
#warning FIXME what to do with config.use_cpu_accel
#endif
config.use_cpu_accel = FALSE;
config.use_cpu_accel = manager->gimp->use_cpu_accel;
config.gimp_reserved_5 = 0;
config.gimp_reserved_6 = 0;
config.gimp_reserved_7 = 0;

View File

@ -66,7 +66,7 @@ gimp_init_for_testing (void)
gegl_init (NULL, NULL);
gimp = gimp_new ("Unit Tested GIMP", NULL, NULL, FALSE, TRUE, TRUE, TRUE,
FALSE, TRUE, TRUE, FALSE);
FALSE, FALSE, TRUE, TRUE, FALSE);
units_init (gimp);
@ -99,7 +99,7 @@ gimp_init_for_gui_testing_internal (gboolean show_gui,
/* from app_run() */
gimp = gimp_new ("Unit Tested GIMP", NULL, NULL, FALSE, TRUE, TRUE, !show_gui,
FALSE, TRUE, TRUE, FALSE);
FALSE, FALSE, TRUE, TRUE, FALSE);
gimp_set_show_gui (gimp, show_gui);
units_init (gimp);
gimp_load_config (gimp, gimprc, NULL);