Comment 45 for bug 655024

Revision history for this message
Andrea Cimitan (cimi) wrote :

tried that code in murrine, low quality shadows compared to the one we have now :(

cairo_pattern_t * text_pattern;

/* Render to a temporary surface (similar to your target surface). */
cairo_push_group(cr);

cairo_translate (cr, x, y);
murrine_set_color_rgb (cr, use_text ? &colors->text[state_type] : &colors->fg[state_type]);
pango_cairo_show_layout (cr, layout);

text_pattern = cairo_pop_group(cr);

/* Drop the shadow. */
cairo_save(cr);

cairo_translate (cr, xos, yos);
murrine_set_color_rgba (cr, &temp, 0.5);
cairo_mask(cr, text_pattern);

cairo_restore(cr);

/* Paint the text on top of the shadow. */
cairo_set_source(cr, text_pattern);
cairo_paint(cr);
cairo_pattern_destroy(text_pattern);
cairo_destroy (cr);