Skip to content
Snippets Groups Projects
Commit fd8a4fd8 authored by Romain Vimont's avatar Romain Vimont Committed by Jean-Baptiste Kempf
Browse files

opengl: fix transform order

The TransformMatrix is provided by Android to apply its internal
coordinates transformations to sample the texture at the correct
location, so it must be applied last, after the orientation/crop from
the picture_t.

The fact that their internal transform is exposed as an explicit matrix
is an arbitrary design choice from Android. Instead they could have
exposed a GLSL function "android_texture2D(vec2 coords)":

    vec2 tex_coords = TexCoordsMap * OrientationMatrix * pic_coords;
    vec4 texel = android_texture2D(tex_coords);

In that case, it is obvious that their transform would be applied last.

Refs <https://developer.android.com/reference/android/graphics/SurfaceTexture#getTransformMatrix(float%5B%5D)>
parent 9d00bf29
No related branches found
No related tags found
1 merge request!670opengl: fix transform order
Pipeline #143810 passed with stage
in 11 minutes and 8 seconds
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment