Your Question is too broad. Still I will try to make some of its clear.
Application will either draw on Canvas or Its an OpenGL ES based app. Canvas based app may or may not use Hardware Rendering. In case of Hardware Rendering and OpenGL app final image is written to a buffer called "Surface" using GPU. Same buffer is written using CPU in case of Canvas and Software Rendering.
There can be multiple such buffers. Which are sent to Surface Flinger for compositing. Surface Flinger again; may or may not use OpenGL(or GPU) for compositing. SurfaceFlinger can also offload this compositing task to HardwareComposer depending upon different various conditions.
GrAlloc is used to allocate contiguous chunk of memory for graphics purpose.
Thus Final composited buffer is sent to LCD Display for final Display.
Edit How OpenGL Works ?
So Open GL is just a soecification. GPU venodors provide implementation of that specification in GPU drivers. LibGLES will hav all function declarations and its Graphics Drivers job to convert libgl calls to GPU instructions.
If you want in depth understanding of Surface Flinger and Hardware Composer read about Android Graphics Architecture on android source code site.