Closed Bug 1507076 Opened 6 years ago Closed 4 years ago

Add mIgnoreTransform handling for SurfaceTextureHost with WebRender

Categories

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

Unspecified
Android
enhancement

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: sotaro, Assigned: sotaro)

References

(Blocks 1 open bug)

Details

This bug is created by Bug 1499255 Comment 8.
Priority: -- → P3

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.

In 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

On WebRender, the getTransformMatrix() is not handled yet. Then it worked as mIgnoreTransform == true.

On android, SurfaceTextureImage is created as gl::OriginPos::BottomLeft, though it is not handled by WebRender yet.
https://searchfox.org/mozilla-central/source/dom/media/platforms/android/RemoteDataDecoder.cpp#283

On android, SurfaceTexture is used only for video decoding and WebGL, if android frameworks as expected, it seems not necessary to handle getTransformMatrix().

But if we use SurfaceTexture for camera frame rendering, it might cause the problem. Further, there might be a device that change rotation at ANativeWindow side.

Assignee: nobody → sotaro.ikeda.g

@sotaro: What issues is this currently causing? Or is this a performance issue?

Flags: needinfo?(sotaro.ikeda.g)

For now, we do not have a issue by it. Then we could close this bug for now. When the problem happens, this bug could be re-opened.

This is not a performance issue. When transform is set by android platform, image is just rendered as rotated.

Status: NEW → RESOLVED
Closed: 4 years ago
Flags: needinfo?(sotaro.ikeda.g)
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.