diff --git a/app/core/gimp-scratch.c b/app/core/gimp-scratch.c index 4dcef4ed5c..75fe302951 100644 --- a/app/core/gimp-scratch.c +++ b/app/core/gimp-scratch.c @@ -88,3 +88,13 @@ gimp_scratch_context_free (GimpScratchContext *context) g_slice_free (GimpScratchContext, context); } + + +/* public functions (stats) */ + + +gsize +gimp_scratch_get_total (void) +{ + return gimp_scratch_total; +} diff --git a/app/core/gimp-scratch.h b/app/core/gimp-scratch.h index e47f372a56..f87473ef75 100644 --- a/app/core/gimp-scratch.h +++ b/app/core/gimp-scratch.h @@ -161,4 +161,9 @@ gimp_scratch_free (gpointer ptr) ((type *) (gimp_scratch_alloc0 (sizeof (type) * (n)))) +/* stats */ + +guint64 gimp_scratch_get_total (void); + + #endif /* __GIMP_SCRATCH_H__ */ diff --git a/app/widgets/gimpdashboard.c b/app/widgets/gimpdashboard.c index 4a83f27211..be3e259bd2 100644 --- a/app/widgets/gimpdashboard.c +++ b/app/widgets/gimpdashboard.c @@ -57,6 +57,7 @@ #include "core/gimp-gui.h" #include "core/gimp-utils.h" #include "core/gimp-parallel.h" +#include "core/gimp-scratch.h" #include "core/gimpasync.h" #include "core/gimpbacktrace.h" #include "core/gimpwaitable.h" @@ -138,6 +139,7 @@ typedef enum /* misc */ VARIABLE_MIPMAPED, VARIABLE_ASYNC_RUNNING, + VARIABLE_SCRATCH_TOTAL, N_VARIABLES, @@ -693,6 +695,15 @@ static const VariableInfo variables[] = .type = VARIABLE_TYPE_INTEGER, .sample_func = gimp_dashboard_sample_function, .data = gimp_async_get_n_running + }, + + [VARIABLE_SCRATCH_TOTAL] = + { .name = "scratch-total", + .title = NC_("dashboard-variable", "Scratch"), + .description = N_("Total size of scratch memory"), + .type = VARIABLE_TYPE_SIZE, + .sample_func = gimp_dashboard_sample_function, + .data = gimp_scratch_get_total } }; @@ -891,6 +902,9 @@ static const GroupInfo groups[] = { .variable = VARIABLE_ASYNC_RUNNING, .default_active = TRUE }, + { .variable = VARIABLE_SCRATCH_TOTAL, + .default_active = TRUE + }, {} }