[cairo] cairo-1.13 finally opens
Henry (Yu) Song - SISA
henry.song at samsung.com
Thu Sep 5 09:27:27 PDT 2013
Hi, Chris
I have APIs for blur and shadow so far:
Blur APIs
cairo_pattern_set_filter (pattern, CAIRO_PATTERN_FILTER_GAUSSIAN); // this is existing, no change
cairo_pattern_set_sigma (pattern, x, y);
cairo_pattern_get_sigma (pattern, &x, &y);
Shadow APIs
cairo_set_shadow (cr, CAIRO_SHADOW_DROP/CAIRO_SHADOW_INSET);
cairo_set_shadow_offset (cr, x, y);
cairo_set_shadow_rgb/rgba (cr, r, g, b,..);
cairo_set_shadow_blur (cr, x, y);
cairo_set_draw_shadow_only (cr, TRUE/FALSE); // this controls whether to draw shadow only or not, can be used to draw arbitrary shadow
cairo_shadow_enable_cache (cr, TRUE/FALSE); // this controls whether to cache the shadow
cairo_set_path_is_inset_shadow_with_spread (cr, TRUE/FALSE); // I am not happy about this, this api turns path into inset shadow path instead of as a bound path. This is to enable CSS3 inset shadow with spread, but more generic effect.
Thanks
Henry
________________________________________
From: Chris Wilson [chris at chris-wilson.co.uk]
Sent: Thursday, September 05, 2013 9:08 AM
To: Henry (Yu) Song - SISA
Cc: cairo at cairographics.org
Subject: Re: [cairo] cairo-1.13 finally opens
On Thu, Sep 05, 2013 at 03:54:43PM +0000, Henry (Yu) Song - SISA wrote:
> Hi, Chris
>
> I have added Guassian blur and shadow support in cairo. It is available in filters-wip branch from https://github.com/SRA-SiliconValley/cairogles
>
> The gaussian blur and shadow support are available for GL/GLES, image, xcb and quartz backend.
Eek, shadow is definitely a big missing <canvas> feature. I had
an API sketched around an effects API for cairo-2.0. As you can see to
do shadows requires a lot of entry points on the context, which one of
ours goal is to keep to a minimum. I wonder if I can quickly sketch a
slightly more generic API of which the first (and only, for the time
being) consume is a shadow effect. (i.e. something closer to the
cairo_set_pattern, cairo_pattern_create_linear e.g.
cairo_set_<path?>_effect, cairo_effect_create_shadow).
Give me a couple of days... And suggestions welcome! But consider these
two penciled in for this dev cycle.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
More information about the cairo
mailing list