Is SurfaceView hardware-accelerated?

2k Views Asked by At

I am displaying Bitmaps in my SurfaceView using Canvas.drawBitmap. My phone has GPU.

Then I've changed from SurfaceView to GLSurfaceView , displaying bitmaps with GLUtils.texImage2D from Renderer's onDrawFrame() every time.

I didn't notice any difference in speed (although I didn't do exact measurements, just by observation).

Shall there be a difference or is it meaningless to use GLSurfaceView for textures only, does SurfaceView provide the necessary hardware acceleration support?

2

There are 2 best solutions below

2
On BEST ANSWER

Apparently it is not, and adding HW acceleration is not planned for the next Android release.

Cf. https://groups.google.com/d/msg/android-developers/ly-DqqZyPTw/XZNJmHpVBGoJ

If you do more thorough benchmarking you should see the difference.

0
On

Years later this has changed. Android's SurfaceView does offer hardware acceleration since Android 8 via SurfaceHolder.lockHardwareCanvas.