free(im->rendered_image);
}
- mutex_lock(im->fontmap_mutex);
if (im->layout) {
g_object_unref(im->layout);
}
- mutex_unlock(im->fontmap_mutex);
}
if (im->ylegend)
{
unsigned int i;
char *deffont = getenv("RRD_DEFAULT_FONT");
- static PangoFontMap *fontmap = NULL;
- static mutex_t fontmap_mutex = MUTEX_INITIALIZER;
PangoContext *context;
/* zero the whole structure first */
im->font_options = cairo_font_options_create();
im->surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 10, 10);
im->cr = cairo_create(im->surface);
- im->fontmap_mutex = &fontmap_mutex;
for (i = 0; i < DIM(text_prop); i++) {
im->text_prop[i].size = -1;
text_prop[i].size);
}
- mutex_lock(im->fontmap_mutex);
-
- if (fontmap == NULL) {
- fontmap = pango_cairo_font_map_new();
- }
+ PangoFontMap *fontmap = pango_cairo_font_map_get_default();
#ifdef HAVE_PANGO_FONT_MAP_CREATE_CONTEXT
context = pango_font_map_create_context((PangoFontMap *) fontmap);
(im->font_options, CAIRO_HINT_METRICS_ON);
cairo_font_options_set_antialias(im->font_options,
CAIRO_ANTIALIAS_GRAY);
-
- mutex_unlock(im->fontmap_mutex);
}
for (i = 0; i < DIM(graph_col); i++)
}
} /* while (opt != -1) */
- mutex_lock(im->fontmap_mutex);
pango_cairo_context_set_font_options(pango_layout_get_context(im->layout),
im->font_options);
pango_layout_context_changed(im->layout);
- mutex_unlock(im->fontmap_mutex);
if (im->primary_axis_format != NULL && im->primary_axis_format[0] != '\0') {
#include "rrd_tool.h"
#include "rrd_rpncalc.h"
-#include "mutex.h"
#include <glib.h>
rrd_info_t *grinfo_current; /* pointing to current entry */
GHashTable* gdef_map; /* a map of all *def gdef entries for quick access */
GHashTable* rrd_map; /* a map of all rrd files in use for gdef entries */
- mutex_t *fontmap_mutex; /* Mutex for locking the global fontmap */
enum image_init_en init_mode; /* do we need Cairo/Pango? */
double x_pixie; /* scale for X (see xtr() for reference) */
double y_pixie; /* scale for Y (see ytr() for reference) */