Search code examples
androidsurfaceflinger

Why does SurfaceFlinger render layers upside down


Recently, when digging into the SurfaceFlinger code, I discovered it renders its layers upside down, using the method like 1.0f minus vertex Y coordinate. I feel confused. Why do they do this?


Solution

  • Could be because OpenGL's (0,0) point is at the bottom-left of the screen.. whereas the higher-level windowing API assumes (0,0) is the top-left.