WebGL is rendered as upside down on android

RESOLVED FIXED in Firefox 68

Status

()

defect
RESOLVED FIXED
a month ago
29 days ago

People

(Reporter: sotaro, Assigned: sotaro)

Tracking

(Blocks 1 bug)

unspecified
mozilla68
Unspecified
Android
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox68 fixed)

Details

(Whiteboard: [wr-amvp][wr-q2])

Attachments

(1 attachment)

Assignee

Description

a month ago

On WebGL, a rotation info is delivered by GeckoSurfaceTexture. It is not handled yet with WebRender.

Bug 1507076 is related.

Assignee

Updated

a month ago
Assignee: nobody → sotaro.ikeda.g
Assignee

Updated

a month ago
Assignee

Updated

a month ago
OS: Unspecified → Android
Whiteboard: [wr-amvp][wr-q2]
Assignee

Comment 1

a month ago

SurfaceTexture is expected to be used with SurfaceTexture.getTransformMatrix(). With the matrix, SurfaceTexture's gl texture worked as bottom left origin. But current WebRender does not use the getTransformMatrix(). Then the gl texture worked as top left origin. Then WebGL rendering was flipped. Then Bug 1507076 is related.

On android, GLConsumer::computeTransformMatrix() calculate a matrix for the getTransformMatrix(). If there is no transform, it jut multiply y-flip.
http://androidxref.com/9.0.0_r3/xref/frameworks/native/libs/gui/GLConsumer.cpp#866
https://developer.android.com/reference/android/graphics/SurfaceTexture

Assignee

Comment 2

a month ago

On android, SurfaceTextureImage is created as gl::OriginPos::BottomLeft. The origin is not handled by WebRender. But it does not cause rendering problem, since getTransformMatrix() is also not handled and texture origin effectively worked as gl::OriginPos::TopLeft.

https://searchfox.org/mozilla-central/source/dom/media/platforms/android/RemoteDataDecoder.cpp#283

Assignee

Comment 3

a month ago

On android WebGL, y-flip is handled by nsDisplayCanvas::CreateWebRenderCommands(). But with WebRender, the getTransformMatrix() is not handled yet. Gl texture of SurfaceTexture is rendered as top left origin, then texture rendering result became y-flipped.
https://searchfox.org/mozilla-central/source/layout/generic/nsHTMLCanvasFrame.cpp#178

Assignee

Comment 4

a month ago

If SurfaceTexture usage is only Video decoding and WebGL, it is not necessary to handle getTransformMatrix() for now.

Long term solution is going to be handled by Bug 1507076.

Comment 7

29 days ago
Pushed by sikeda@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b2a8685b55e1
Move Y flip handling to AsyncImagePipelineManager::ApplyAsyncImageForPipeline() r=nical

Comment 8

29 days ago
bugherder
Status: NEW → RESOLVED
Last Resolved: 29 days ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
You need to log in before you can comment on or make changes to this bug.