Skip navigation.
 
mlRe: replacing NSViewAnimation with CoreAnimation
FROM : haller
DATE : Fri Nov 23 17:05:08 2007

Stefan Haller <<email_removed>> wrote:

> It's in <http://developer.apple.com/releasenotes/Cocoa/AppKit.html>:
>
> : Basic default animation parameters are provided for the following
> : NSView and NSWindow properties, such that they will animate
> : automatically when assigned a new target value via the view or
> : window's animator:
> :
> : for NSView: alphaValue, frame, frameOrigin, frameSize, frameRotation,
> : frameCenterRotation, bounds, boundsOrigin, boundsSize,
> : backgroundFilters, contentFilters, compositingFilter, shadow
>
> This sounds to me as if it should be possible to animate the
> boundsOrigin of an NSClipView.  However, it says this under the heading
> "Using Layer-Backed Views"; does that mean that I have to make the
> NSClipView layer-backed for this to work?  Do I want to?  I certainly
> don't want to make the scroll view's document view layer-backed, as it
> can become pretty large.


I tried it, and yes, setWantsLayer:YES on the scroll view makes it work.
However, it only works for reasonably small document views; for larger
views, I get either

  -[_NSViewBackingLayer(0x172c0cf0) p={0, 0} b=(0,0,817,1.00355e+06)
  superlayer=0x15f9b400 display]: Ignoring bogus layer size
  (817.000000, 1003552.000000)

or

  CoreAnimation: 817 by 6848 image is too large for GPU, ignoring
  CoreAnimation: rendering error 500


So it seems that the CATiledLayers feature which the release notes talk
about doesn't seem to work.  Or is there something I have to do to
enable it?

For now I'm back to animating it manually using NSAnimation, which works
just fine; although it does look a little less smooth (and results in a
lot more CPU load, of course).


--
Stefan Haller
Ableton
http://www.ableton.com/

Related mailsAuthorDate
mlreplacing NSViewAnimation with CoreAnimation Christoph Vogelbus… Nov 21, 14:25
mlRe: replacing NSViewAnimation with CoreAnimation Nick Zitzmann Nov 21, 16:29
mlRe: replacing NSViewAnimation with CoreAnimation Scott Anguish Nov 21, 21:10
mlRe: replacing NSViewAnimation with CoreAnimation Christoph Vogelbus… Nov 21, 22:05
mlRe: replacing NSViewAnimation with CoreAnimation Scott Anguish Nov 21, 23:17
mlRe: replacing NSViewAnimation with CoreAnimation haller Nov 22, 12:11
mlRe: replacing NSViewAnimation with CoreAnimation Scott Anguish Nov 22, 22:28
mlRe: replacing NSViewAnimation with CoreAnimation haller Nov 23, 09:27
mlRe: replacing NSViewAnimation with CoreAnimation Scott Anguish Nov 23, 10:37
mlRe: replacing NSViewAnimation with CoreAnimation haller Nov 23, 17:05