IRC Log Viewer » #firebreath » 2013-08-29

IRC Nick Time (GMT-7) Message
GregorM 07:08 Hello, I was wondering if anyone had some experience writing plugins for OSX that use DrawingModelCoreAnimation and support Retina?
the specific issue I'm trying to solve is to listen to content scale factor changes on whatever hosts my layer (so that I can respond to it and set the scale factor of my layer to match)
taxilian 09:08 GregorM: I would assume that you would do that the same way you would in anything else that uses CoreAnimation...
GregorM 11:08 taxilian: missed your earlier msg. The way you'd usually handle scale updates with CALayer is to watch the NSView (or similar) in which the layer is hosted. This let's you detect changes to the scale factor (and others)
taxilian 11:08 ahh. well, there may not be anything you can do, then
'cause you definitely don't have a NSView :-/
it's possible it will even happen automatically? I don't know.
GregorM 11:08 I had a look through FireBreath sources and as far as I can see the CALayers it creates (so not even one of mine) aren't added anywhere
taxilian 11:08 that is correct
they are given to the browser
GregorM 11:08 I'm assuming NSAPI interfaces let the browser ask for the CALayer which then gets placed somewhere out of our control
taxilian 11:08 that deals with passing them cross-process
GregorM 11:08 yeah, so what I'm wondering about is how do plugins like flash work
they certainly work correctly on both of my monitors, one of which is retina hidpi and another standard res
taxilian 11:08 well, in chrome they use nacl; on safari/firefox they might use CoreGraphics or they might use CoreAnimation, I'm not sure
GregorM 11:08 I googled around a bit about NPAPI and retina, but couldn't find anything immediately useful
taxilian 11:08 however, CoreAnimation it's possible that they just draw as though it's retina if it's possible; my guess is that the CALayer will get scaled automatically
GregorM 11:08 yeah, good point, they might not be using CA
taxilian 11:08 thing is with CoreGraphics I think you'll have thes ame problem
all you have is a CGContextRef
no NSWindow ever
you could try asking on stackoverflow; Stuart Morgan usually monitors the npapi tag there and he might know
GregorM 11:08 that'd be a bit of an overkill, because you'd have to generate 4x as many pixels as necessary (on non-retina display)
taxilian 11:08 yeah, I realize
but it's my only idea =]
GregorM 11:08 sure, thanks the tips
taxilian 11:08 good luck