4

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

Based on Android Graphics Documentation there are two ways to draw 2D graphics. One is using VIEW object and the other is by directly drawing to a Canvas. As I read from the documentation, when drawing directly to a Canvas, one can create a thread which manages the SurfaceView which is linked to the SurfaceFlinger. I have also noticed in the code that android.graphics package is just a wrapper to the SKIA library. SKIA functions are called using JNI. So, I can't determine if the calls still go to the SurfaceFlinger.

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

Oak Bytes
  • 4,649
  • 4
  • 36
  • 53
artsylar
  • 2,648
  • 4
  • 34
  • 51

1 Answers1

1

This question has been answered in my other post.

Android SurfaceFlinger

According to @hackbod (I have also proved it when I further analyzed the source code),

SurfaceFlinger is not what draws your window. It allocates a frame buffer for your window, which the framework running in your application draws directly to without interacting with SurfaceFlinger. The only interaction SurfaceFlinger is involved with when you draw your window is to composite the final new frame buffer to the screen once you are done drawing a frame.

Community
  • 1
  • 1
artsylar
  • 2,648
  • 4
  • 34
  • 51