Re: cairo-1.13 finally opens

"Henry (Yu) Song - SISA" <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <3955FA337689574EB32F94B12A7E6E9E59F1406B@sisaex01sj>
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 [[email protected]]
Sent: Thursday, September 05, 2013 9:08 AM
To: Henry (Yu) Song - SISA
Cc: [email protected]
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
-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.