CALayer composition changes with frame position
CALayer composition changes with frame position
- Subject: CALayer composition changes with frame position
- From: Markus Spoettl <email@hidden>
- Date: Thu, 22 Mar 2012 11:59:26 +0100
Hello all,
I have a super-strange issue that I have debugged for hours without
any progress. I'm at a complete loss to explain what is going on and
would appreciate ideas on getting to the bottom of this.
I have a custom layer-hosting view with a delegate-drawn hierarchy,
there are no filters involved. The hierarchy is like this:
rootLayer
|-- moveableLayer
|-- stationaryLayer
I can click-drag "movableLayer" around using the mouse. moveableLayer's
opacity is 0.5, stationaryLayer's is 1.0.
My problem is that stationaryLayer is composited differently, sometimes
opaque, sometimes semi-transparent and I cannot explain why. It's
completely reproducible and happens 100% of the time, even after rebooting.
During the mouse-drag, I'm only changing moveableLayer's position
property, wrapped in a CATransaction with +setDisableActions:YES). The
opacity properties of neither layer are changed after creating them.
To make sure no code accidentally changes opacity, I've added an
observer to the opacity property of all layers involved, so I'm sure.
I've also checked the observation works.
Here's a short video that illustrates the issue:
http://www.shiftoption.com/temp/magic-layer-transparency.mov
rootLayer drawn gray with a red rectangle in the middle, moveableLayer
consists of the transparent white rectangle and a green-to-blue
gradient. stationaryLayer is drawn with a yellow-to-red gradient. As you
can see, at a certain point during the drag stationary switches from
being composited transparently to completely opaque (relative to
moveableLayer).
All colors used have an alpha of 1.0. Also, the layers are never
re-drawn during the drag, so it's not a painting issue.
The problem goes away when setting moveableLayer's opacity to 1.0. Then
stationaryLayer is composited the same, independent of moveableLayer's
position.
I'm on Lion 10.7.3 using the 10.7 SDK with Xcode 4.3.1.
Any ideas greatly appreciated!
Thanks
Markus
--
__________________________________________
Markus Spoettl
_______________________________________________
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