getWidth

open fun getWidth(): Int

Returns the surface's width, in pixels.

If this is called on a window surface, and the underlying surface is in the process of changing size, we may not see the new size right away (e.g. in the "surfaceChanged" callback). The size should match after the next buffer swap.