It\'s really weird that in systrace tool when I saw the execution of drawing command and window composition by surfaceflinger, this is running on CPU but not on GPU. But as
There's three ways to do surface composition:
screenrecord
. On some devices, if none of the surfaces have been updated in a bit, the hardware composer will use the GPU to compose the surfaces and then just display the single buffer. This is more bandwidth-efficient than overlay planes if nothing is changing (because you don't have to run through all the surfaces, which means you need less memory bandwidth, which means you can clock things lower, which means you can use less power).What exactly it does varies between devices and has evolved over time. If you want to see exactly what it's doing, try adb shell dumpsys SurfaceFlinger
. The hardware composer details (near the bottom) are the most interesting part. You may need to actively scroll something on the device display while running the command to avoid the GLES optimization.
I would guess that you're seeing is the prepare()
and set()
calls and buffer management, not actual pixel composition, in your systrace.
Update: there's a really nice write-up in this post.
Update 2: there's now an overview of the full system in the Android System-Level Graphics doc.