W3C home > Mailing lists > Public > public-fx@w3.org > July to September 2013

Re: [css-images][css-compositing] Blurring an elementís backdrop

From: Dean Jackson <dino@apple.com>
Date: Thu, 19 Sep 2013 11:19:47 -0700
Cc: Dirk Schulze <dschulze@adobe.com>, Lea Verou <leaverou@gmail.com>, "public-fx@w3.org" <public-fx@w3.org>, www-style list <www-style@w3.org>
Message-id: <260292B4-78B5-47E2-A00F-7EC87ABCC5B6@apple.com>
To: Rik Cabanier <cabanier@gmail.com>

On 19 Sep 2013, at 11:01 am, Rik Cabanier <cabanier@gmail.com> wrote:

> So, here is where it gets tricky. Background/drop filtering is quite expensive, and sometimes extremely expensive in some compositing set ups. In the worst case a browser will have to draw the tree twice, possibly reading back pixels before applying the effect. And that could be per element that has a filter. We can define isolation groups to make this easier, but this will be quite difficult to understand.
> 
> Well, we're already there with CSS filters and blending:-)
> 

Yes. But this is why weíre hesitant to add blending even though it would be extremely useful.

Itís quite funny really. Typically in these standards discussions we mostly understand how to implement and spend all our time arguing over the way to expose it to CSS/HTML/JS/etc. In the case of blending and backgdrop filters, the exposition is pretty uncontroversial - itís the implementation details that are difficult and which either severely limit or confuse the feature.

> 
> In our experimentation itís quite confusing that changes in sibling elements or random properties can trigger a situation where the background becomes difficult to obtain or radically slower.
> 
> Window servers often do these effects with tricky hacks. Their content is also nowhere near the complexity that a Web page can be.
> 
> I guess Iím saying that, like blending/compositing, Iíd really love to expose this, but it could be a pain to implement and difficult to author.
> 
> Would it be possible to implement this practically on Safari? I thought there was an API to do apply a filter during compositing but I can't find it in the documentation.

Sure itís possible. But the question is whether or not it is practical. Iíd really like to expose this feature but I think it needs a bit of experimentation first.

BTW, I think youíre looking for CALayer.backgroundFilters [1]. 

Two things of note:

- "Typically this content belongs to the superlayer that acts as the parent of the layer.Ē This explains why itís tricky in CSS. This feature is asking to apply an effect to *all* the content behind the element, not just its parent. (Also, due to complexities in CSS, an elementís parent in the compositing tree might not be itís direct DOM parent).

- This does not apply on iOS (like I said, the window server does special magic to achieve the effect)

Dean

[1] https://developer.apple.com/library/mac/documentation/GraphicsImaging/Reference/CALayer_class/Introduction/Introduction.html#//apple_ref/occ/instp/CALayer/backgroundFilters
Received on Thursday, 19 September 2013 18:20:26 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:49:46 UTC