WebView with NSShadow slowdown

Posted by Rodrigo on Stack Overflow See other posts from Stack Overflow or by Rodrigo
Published on 2012-04-09T04:47:20Z Indexed on 2012/04/09 5:29 UTC
Read the original article Hit count: 190

Filed under:
|
|
|

I have a webview that shows some animated boxes, but it slows down and lags horribly when I put a drop shadow in the view. Without the shadow, the webview contents animate smoothly.

I achieved a similar effect as safari/chrome when you do a elastic scroll with the touchpad. Looks nice! But doesnt run as smooth as in my inspirations.

Here is the snippet of the shadow setting:

NSShadow *dropShadow = [[NSShadow alloc] init];
[dropShadow setShadowColor:[NSColor blackColor]];
[dropShadow setShadowOffset:NSMakeSize(0, 0)];
[dropShadow setShadowBlurRadius:5.0];

[webview setWantsLayer: YES];
[webview setShadow: dropShadow];

[dropShadow release];

--

My question is: How can I work around this problem?

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about osx