Re: CALayer's backgrounds filters having effect only on immediate parent?
Re: CALayer's backgrounds filters having effect only on immediate parent?
- Subject: Re: CALayer's backgrounds filters having effect only on immediate parent?
- From: Graham Cox <email@hidden>
- Date: Wed, 20 Feb 2013 10:51:56 +1100
On 20/02/2013, at 5:42 AM, Oleg Krupnov <email@hidden> wrote:
> In my understanding, if I apply, say, a blur filter to layer's
> background (CALayer->backgroundFilters), all layers that are behind
> that layer - that is, immediate parent, grand parent, etc. and all
> children and siblings of those parent and grandparents that are lower
> in the tree of layers - should appear blurred.
>
> An experiment however shows that it's not the case. The background
> blur filter only blurs the direct parent of the target layer, but not
> its grandparent and other layers.
>
> The same applies for compositingFilter.
>
> Am I doing something wrong?
>
> Or, if this is the way it should work as documented, how do achieve
> the effect I want?
I think your understanding is incorrect. My interpretation of the docs is simply that the background - that is to say, the background colour of the layer - is filtered. If you think about how layers are composited, this is the only interpretation that makes sense - how could a layer retroactively apply a bunch of filters to things that have already been rendered?
Setting the filters on the root layer or on some layer further up the tree should achieve the effect you want, though most likely you'll want the compositingFilters rather than the background filters property.
--Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden