• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
CALayer composition changes with frame position
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: CALayer composition changes with frame position
      • From: "T.J. Usiyan" <email@hidden>
    • Re: CALayer composition changes with frame position
      • From: James Bucanek <email@hidden>
  • Prev by Date: [Solved] Re: Storing UTF8 Umlauts in Postgres using PGSQLKit
  • Next by Date: Re: asynchronous nsurlconnection in nsoperation
  • Previous by thread: Re: [Solved] Re: Storing UTF8 Umlauts in Postgres using PGSQLKit
  • Next by thread: Re: CALayer composition changes with frame position
  • Index(es):
    • Date
    • Thread