Closed Bug 1620458 Opened 4 years ago Closed 4 years ago

On Android, WebGL examples don't work when webrender is enabled

Categories

(Core :: Graphics: WebRender, defect, P3)

defect

Tracking

()

VERIFIED FIXED
mozilla78
Tracking Status
firefox-esr68 --- unaffected
firefox76 --- wontfix
firefox77 --- wontfix
firefox78 --- verified

People

(Reporter: jhlin, Assigned: sotaro)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(1 file)

The MDN example[1] and videojs-vr examples[2] show black screen. After setting the gfx.webrender.force-disabled to true, The contents plays fine.

The log show SurfaceTexture errors when copying contents from the chrome process to the content process:

03-05 23:55:08.154  1633  1664 E GLConsumer: [SurfaceTexture-0-1633-16] attachToContext: GLConsumer is already attached to a context
03-05 23:55:08.154  1633  1664 W System.err: java.lang.RuntimeException: Error during attachToGLContext (see logcat for details)
03-05 23:55:08.154  1633  1664 W System.err: 	at android.graphics.SurfaceTexture.attachToGLContext(SurfaceTexture.java:294)
03-05 23:55:08.154  1633  1664 W System.err: 	at org.mozilla.gecko.gfx.GeckoSurfaceTexture.attachToGLContext(GeckoSurfaceTexture.java:91)
03-05 23:55:08.154  1633  1664 W System.err: 	at org.mozilla.gecko.gfx.GeckoSurfaceTexture$NativeGLBlitHelper.blit(Native Method)
03-05 23:55:08.154  1633  1664 W System.err: 	at org.mozilla.gecko.gfx.GeckoSurfaceTexture.takeSnapshot(GeckoSurfaceTexture.java:307)
03-05 23:55:08.154  1633  1664 W System.err: 	at org.mozilla.gecko.gfx.SurfaceAllocatorService$1.sync(SurfaceAllocatorService.java:54)
03-05 23:55:08.155  1633  1664 W System.err: 	at org.mozilla.gecko.gfx.ISurfaceAllocator$Stub.onTransact(ISurfaceAllocator.java:94)
03-05 23:55:08.155  1633  1664 W System.err: 	at android.os.Binder.execTransact(Binder.java:743)

It appears that webrender attaches the texture no matter the video element is displayed or not, while the old compositor only attaches the texture when video element is displayed.

[1] https://mdn.github.io/webgl-examples/tutorial/sample8/
[2] https://videojs-vr.netlify.com/

Sotaro, do you know what changed there?

Flags: needinfo?(sotaro.ikeda.g)
Blocks: wr-android
Priority: -- → P3
Blocks: 1619550

It seems like a regression of Bug 1594303.

Assignee: nobody → sotaro.ikeda.g
Flags: needinfo?(sotaro.ikeda.g)
Regressed by: 1594303
Has Regression Range: --- → yes
Depends on: 1621836

@sotaro: Was this landed?

Flags: needinfo?(sotaro.ikeda.g)
Depends on: 1636352

(In reply to Kris Taeleman (:ktaeleman) from comment #5)

@sotaro: Was this landed?

It is not landed yet, since there was another problem in the STR. Video frames were not rendered to WebGL. Auto video playback was blocked at IsGVAutoplayRequestAllowed. The problem could be bypassed by setting pref "media.geckoview.autoplay.request=false".

I updated a patch today. There was one assert failure. I am going to address the failure. Then I am going to ask review soon.

Flags: needinfo?(sotaro.ikeda.g)

:jolin, IsGVAutoplayRequestAllowed() returned false with gecko_view example app, then video frames were not rendered to WebGL by default. Is it expected behavior?

Flags: needinfo?(jolin)
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla78

(In reply to Sotaro Ikeda [:sotaro] from comment #7)

:jolin, IsGVAutoplayRequestAllowed() returned false with gecko_view example app, then video frames were not rendered to WebGL by default. Is it expected behavior?

I think so. If autoplay is blocked, the video should not be played automatically without user action, and no video frame will be sent to the compositor in this case. Therefore no SurfaceTexture.updateTexImage() will be called and the texture WebGL gets is always empty.

Flags: needinfo?(jolin)

Verified as fixed on Firefox Preview Nightly 200610 (Build #21620604) Wednesday 6/10 using a OnePlus 6T (Android 9) and Huawei MediaPad M3 (Android 7.0).

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: