Connection between android.graphics and SurfaceFlinger

I am trying to understand the relationship between android.graphics package and SurfaceFlinger .

Based on the Android Graphics Documentation, there are two ways to draw 2D graphics. One uses a VIEW object, and the other by drawing directly on canvas. When I read from the documentation, by accessing the canvas directly, you can create a stream that controls the SurfaceView that is associated with SurfaceFlinger . I also noticed in the code that the android.graphics package is just a shell of the SKIA library. SKIA functions are called using the JNI. So, I canโ€™t determine if calls to SurfaceFlinger continue.

Does this mean that when using the View object for simple 2D graphics, there is no need for SurfaceFlinger? Or is Surfaceflinger always used when drawing any graphics on the screen? Any inputs?

+4
source share
1 answer

This question was given in my other post.

Android SurfaceFlinger

According to @hackbod (I also proved this when I further analyzed the source code)

SurfaceFlinger is not what draws your window. It allocates a frame buffer for your window, to which the framework running in your application works, without interacting with SurfaceFlinger. SurfaceFlingerโ€™s only interaction is when you draw your window to compose the last buffer of the new frame onto the screen as soon as you finish drawing the frame.

+1
source

Source: https://habr.com/ru/post/1348019/


All Articles