library / com.otaliastudios.zoom / ZoomSurfaceView / onDrawFrame
onDrawFrame
@WorkerThread open fun onDrawFrame(gl: GL10): Unit
Performs the texture and background drawing.
An old version of this acted on surfaceTextureTransformMatrix instead of the rect modelMatrix.
This has the drawback that any "background" (overscrolls, zoom < 1, ...) will draw the CLAMP_TO_BORDER
texture mess and there's no way around that.
The current version acts on textureRect.modelMatrix instead.
In both cases there are some issues here.
- We passed the video size to the engine. So we must UNDO some default behavior of SurfaceView.
This is done and documented in onContentOrContainerSizeChanged.
- OpenGL will apply translation first then scale, which is typically not what we want.
- OpenGL will scale with respect to some fixed point, which is typically not the pan origin.
(if we work on modelMatrix, this point is the translated viewport center)
- OpenGL Y coordinates are reversed.