view、surfaceview、glsurfaceview区别

The drawing of the view must be done in the current UI thread - this is why the handler is always used when updating the view component, but the surfaceview does not have this problem. The drawing of the surfaceview is done by the surfaceholder. For the view Component, if the program takes a long time to update the drawing, the main UI thread will be blocked and cannot respond to any actions of the user, while the surfaceviewholder will start a new thread to update the drawing of the surfaceview without blocking the main thread.
The role of glsurfaceview:
establish a connection between OpenGL ES and the View system;
make OpenGL ES work in the Activity life cycle;
select the appropriate frame buffer pixel format;
create and manage a separate rendering thread, which can achieve smooth animation;
Provides debugging tools and APIs.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326990046&siteId=291194637