Closed Bug 665192 Opened 14 years ago Closed 14 years ago

CAOpenGLLayer support for plugin InvalidatingCoreAnimation model broken in FF5+

Categories

(Core Graveyard :: Plug-ins, defect)

5 Branch
x86
macOS
defect
Not set
major

Tracking

(Not tracked)

RESOLVED INVALID
mozilla5

People

(Reporter: mark, Unassigned)

Details

Attachments

(1 file)

User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_6) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.100 Safari/534.30 Build Identifier: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:5.0) Gecko/20100101 Firefox/5.0 Hi all -- we're working on getting the Cooliris plugin to work on Mac FF5 Mac, and we're using the InvalidatingCoreAnimation drawing model. All is well on FF4, but on FF5, our CAOpenGLLayer never gets refreshed, even though we're setNeedsDisplay on it. These methods never end up getting called. - (CGLPixelFormatObj)copyCGLPixelFormatForDisplayMask:(uint32_t)mask - (void)drawInCGLContext:(CGLContextObj)glContext pixelFormat:(CGLPixelFormatObj)pixelFormat forLayerTime:(CFTimeInterval)timeInterval displayTime:(const CVTimeStamp *)timeStamp - (CGLContextObj)copyCGLContextForPixelFormat:(CGLPixelFormatObj)pf presumably because CA doesn't think it needs redrawing; even after explicitly telling it to after we refresh our internal 3D scene. Reproducible: Always Actual Results: After we pass in the pointer to CAOpenGLLayer via NPN_GetValue, it doesn't get refreshed or displayed. Expected Results: CA should call methods to redraw, eg drawInCGLContext:(CGLContextObj)glContext pixelFormat:(CGLPixelFormatObj)pixelFormat forLayerTime:(CFTimeInterval)timeInterval displayTime:(const CVTimeStamp *)timeStamp
Version: unspecified → 5 Branch
Christian, who can we get to look into this?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Target Milestone: --- → mozilla5
I noticed your build identifier does not appear to have the correct date. Can you check the behavior with a trunk build from June 1st? A significant change happened during June 6th however other major plugins that use CAOpenGLLayer are still working (i.e. Flash/Quicktime). Let me know if you can reproduce with those trunks and if Flash/Quicktime is working for you, this should narrow down the regression. In the past a lot of the confusion comes from that fact that CAOpenGLLayer defaults to asynchronous which is very different from how other layers behave.
Sorry, build identifier we tested with is the one corresponding to this revision: http://hg.mozilla.org/releases/mozilla-release/rev/7b56ff900c2a (June 15th.) Also tried with versions going back to Firefox 5.0b1 (http://hg.mozilla.org/releases/mozilla-beta/rev/9df9078bc469) and still get the same issue. I've tried setting the asynchronous property when the CAOpenGLLayer is created to both YES/NO and it doesn't seem to work. I'm not sure how trunk relates exactly wrt the Firefox 5 release branch; does the FF5 release branch get integrated regularly from track on an ongoing basis through the beta period? However, Flash and Quicktime do work.
Some more observations: in FF5, everytime after we call NPN_InvalidateRect(), the browser always calls NPP_GetValue() to get the CALayer*. On FF4, this doesn't happen (NPP_GetValue() for NPPVpluginCoreAnimationLayer only happens once). Also, if we don't set the frame of the CALayer in FF5, it's always zero-size (but manually setting it didn't solve the issue). On FF4, the frame size is set automatically. Is there something different about the CALayer hierarchy in FF5 vs FF4?
(In reply to comment #2) > I noticed your build identifier does not appear to have the correct date. > Can you check the behavior with a trunk build from June 1st? A significant > change happened during June 6th however other major plugins that use > CAOpenGLLayer are still working (i.e. Flash/Quicktime). Let me know if you > can reproduce with those trunks and if Flash/Quicktime is working for you, > this should narrow down the regression. > > In the past a lot of the confusion comes from that fact that CAOpenGLLayer > defaults to asynchronous which is very different from how other layers > behave. Mark is working on Cooliris compatibility for Firefox 5. It's a top 25 add-on that we'd like to be compatible for 5 by Tuesday, as such recent changes don't apply. Based on comment 4, sounds like this could be a regression between Firefox 4 and Firefox 5, which would be bad indeed.
Attached file ICASample
I just tried a sample implementation of a ICA plugin in firefox 4.0 and firefox 5.0 and both are working. The sample will require CASamplePlug.h to point to npapi.h, npfunctions.h from within the mozilla tree to build. I'm afraid I am unable to reproduce the problem.
(In reply to comment #5) > Based on comment 4, sounds like this could be a regression between Firefox 4 > and Firefox 5, which would be bad indeed. I don't believe this is a regression since the changes I was concerned about are still on trunk and not on aurora/beta.
I should add that I just tested with a CAOpenGLLayer based sample it still renders well. This is also the type of layer that Flash uses. I believe the problem isn't with CAOpenGLLayer but rather that you have something different in your setup. On an unrelated note: CALayers have default animations when repositioning the layer, it is recommended to disable them before passing the layer to the browser: // Get rid of nasty default animations NSMutableDictionary *newActions = [[NSMutableDictionary alloc] initWithObjectsAndKeys:[NSNull null], @"onOrderIn", [NSNull null], @"onOrderOut", [NSNull null], @"sublayers", [NSNull null], @"contents", [NSNull null], @"position", [NSNull null], @"bounds", nil]; text.actions = newActions; [newActions release];
Mark, do you have all the information you need? We can get Benoit on the phone or on IRC if you need 1 on 1 help.
I'm looking at the sample now; this is helpful. I'll let you know if I need more. Thanks!
Sure, feel free to email me for my contact information if you need more help.
OK, false alarm. It looks like we were returning NPERR_GENERIC_ERROR in our NPP_GetValue for NPPVpluginCoreAnimationLayer when we shouldn't have, and for some reason it didn't break FF4. Fixing this solved our issue. Thanks for the help!
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → INVALID
Great, please consider removing default actions as well on the layer. You'll notice their effect when resizing the plugin window such as zooming in/out.
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: