Commit 698d1af7 authored by Ell's avatar Ell

app: add scratch-total variable to the dashboard

Add a scratch-total variable to the dashboard's misc group, showing
the total amount of memory used by the scratch allocator.
parent a8a86552
......@@ -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;
}
......@@ -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__ */
......@@ -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"
......@@ -137,6 +138,7 @@ typedef enum
/* misc */
VARIABLE_MIPMAPED,
VARIABLE_ASYNC_RUNNING,
VARIABLE_SCRATCH_TOTAL,
N_VARIABLES,
......@@ -686,6 +688,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
}
};
......@@ -884,6 +895,9 @@ static const GroupInfo groups[] =
{ .variable = VARIABLE_ASYNC_RUNNING,
.default_active = TRUE
},
{ .variable = VARIABLE_SCRATCH_TOTAL,
.default_active = TRUE
},
{}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment