2

Any ideas why a screen saver using just a plain ScreenSaverView subclass with a CAEmitterLayer sublayer would render fine on the primary screen and choppy (as if every 2. frame renders there..) on the secondary screen..?

This is my initialization code:

- (id)initWithFrame:(NSRect)frame isPreview:(BOOL)isPreview
{
   self = [super initWithFrame:frame isPreview:isPreview];
   if (self)
   {
      CAEmitterLayer* emitterLayer = [MyEmitterFactory emitterLayer:self];

      [self setWantsLayer:YES];
      [self.layer addSublayer:emitterLayer];
      [self setAnimationTimeInterval:1/2.0];
   }
   return self;
}

Everything else in this subclass is default (as provided by the Xcode template).

Funny enough, backingStoreType does sound like a good candidate to tweak in a ScreenSaverView subclass using CoreAnimation, alas all other modes except the default one are not to be used as per the docs..

(As the animation is powered by Core Animation it doesn't really matter what I put in setAnimationTimeInterval - or remove the call completely, as experiments have shown)

ATV
  • 4,116
  • 3
  • 23
  • 42

1 Answers1

0

According to the documentation of NSView setWantsLayer:

To create a layer-hosting view, you must call setLayer: and supply your layer object before you call the setWantsLayer: method; the order of these method calls is crucial.

Furthermore: Which OS version is it? Does the choppiness also come up when the two displays are mirrored (or vice versa)?

mahal tertin
  • 3,239
  • 24
  • 41
  • Nobody's talking about creating a layer-hosting view (which is discouraged in recent OS versions BTW). The sequence is perfectly fine for creating a layer-backed view. – ATV Aug 16 '14 at 18:36