CAOpenGLLayer based plugins not being rendered on Firefox 9.0.1

RESOLVED FIXED

Status

()

Core
Plug-ins
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: Vishvesh, Unassigned)

Tracking

9 Branch
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

5 years ago
Created attachment 585361 [details]
modified version of NetscapeCoreAnimationPlugin which uses CAOpenGLLayer

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.63 Safari/535.7

Steps to reproduce:

1. Run any plugin using CAOpenGLLayer for drawing with either Core Animation or Invalidating Core Animation drawing model set.




Actual results:

Nothing is rendered. 

Upon investigation it looks like "- (BOOL)canDrawInCGLContext:(CGLContextObj)ctx pixelFormat:(CGLPixelFormatObj)pf forLayerTime:(CFTimeInterval)t displayTime:(const CVTimeStamp *)ts;" is not called.

This doesn't happen on all the Macintosh machines. I was able to generate this issue on machines having following graphics card.

NVIDIA GeForce 8600M GT
ATI Radeon HD 2600 Pro
Intel GMA X3100





Expected results:

Animation should render
Component: General → Plug-ins
Product: Firefox → Core
QA Contact: general → plugins
(Reporter)

Comment 1

5 years ago
It works fine on Intel HD Graphics and NVIDIA GeForce GT 330M. The attached plug-in code uses webkits NetscapeCoreAnimationPlugin with a basic CAOpenGLLayer. I was also able to generate the issue with FireBreath example plug-in(BasicMediaPlayer.plugin).
https://bugzilla.mozilla.org/attachment.cgi?id=569333
(Reporter)

Comment 2

5 years ago
Any updates on the issue?
I just moved it to the correct area in Bugzilla. You can try poking in either https://lists.mozilla.org/listinfo/dev-tech-plugins or #developers on irc.mozilla.org
I was away. I will be looking into this issue early next week.

I would recommend using ICA where available:
https://wiki.mozilla.org/NPAPI:InvalidatingCoreAnimation
(Reporter)

Comment 5

5 years ago
I see this issue with ICA too. I intend to implement ICA but right now I don't see much of an advantage since there are render problems with ICA on the above mentioned graphics card.
(Reporter)

Comment 6

5 years ago
I was able to fix the issue. I commented the property "kCGLPFAAllowOfflineRenderers" in the file nsCoreAnimationSupport.mm.

Line number 455 of Firefox 9 source code.

CGLPixelFormatAttribute attributes[] = {
    kCGLPFAAccelerated,
  //  kCGLPFAAllowOfflineRenderers,
    kCGLPFADepthSize, (CGLPixelFormatAttribute)24,
    (CGLPixelFormatAttribute)0
  };

According to Apple OpenGL mailing thread 

Quoting Apple's engineer:

""kCGLPFAAllowOfflineRenderers allows OpenGL view to work correctly if the user is on a MacPro and has two graphics cards and wants to drag the view across the monitors connected to different graphics cards."
--
Robert Chin
Apple Inc."

http://lists.apple.com/archives/mac-opengl/2010/Jan/msg00036.html

Setting this flag causes the rendering to fail on machines with single Graphics Card. All the machines I saw this issue on were machines with single graphics card.
(Reporter)

Comment 7

5 years ago
Chromium has multiple checks before setting this property, I think Firefox needs to have them to.
http://src.chromium.org/svn/trunk/src/ui/gfx/gl/gl_context_cgl.cc
Thanks for the great investigative work Vishvesh :D!

This link has more information for you:
http://developer.apple.com/library/mac/#technotes/tn2229/_index.html

We've introduced this change to support newer macbook pros with dual gpu for battery performance. This is already improved on trunk. We've only enable the kCGLPFAAllowOfflineRenderers for certain plugins that have contacted us asking for this support so your plugin will not get this flag set on trunk.

This change is in Firefox 10: http://mxr.mozilla.org/mozilla-beta/source/gfx/thebes/nsCoreAnimationSupport.mm . Can you see if this is fixed in Firefox 10 beta? I'll see if we plan on releasing an update for Firefox 9.
Blocks: 687864
Status: UNCONFIRMED → NEW
Ever confirmed: true
(Reporter)

Comment 9

5 years ago
First thing on Monday morning.
(Reporter)

Comment 10

5 years ago
It seems to be working fine on Firefox 10 beta.
(Reporter)

Comment 11

5 years ago
(In reply to Benoit Girard (:BenWa) from comment #8)
> Thanks for the great investigative work Vishvesh :D!
> 
> This link has more information for you:
> http://developer.apple.com/library/mac/#technotes/tn2229/_index.html
> 
> We've introduced this change to support newer macbook pros with dual gpu for
> battery performance. This is already improved on trunk. We've only enable
> the kCGLPFAAllowOfflineRenderers for certain plugins that have contacted us
> asking for this support so your plugin will not get this flag set on trunk.
> 
> This change is in Firefox 10:
> http://mxr.mozilla.org/mozilla-beta/source/gfx/thebes/nsCoreAnimationSupport.
> mm . Can you see if this is fixed in Firefox 10 beta? I'll see if we plan on
> releasing an update for Firefox 9.

Is there going to be an update for this issue on Firefox 9?
I've asked if this was possible. There is no planned security update for Firefox 9.0 in which I could tag this patch along. This will be released in Firefox 10 in ~3 weeks however.
(Reporter)

Comment 13

5 years ago
Okay

Updated

5 years ago
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.