So far in this chapter, we have discussed loading the Gralloc module and the open method provided by the Gralloc module. Let's now review the points when the upper layer loads, initializes, and uses the Gralloc module:
- For example, the Gralloc module is used mostly by SurfaceFlinger. SurfaceFlinger uses Gralloc; when it creates an instance of FramebufferNativeWindow, in the FramebufferNativeWindow constructor, it will call hw_get_module to get an instance of hw_module_t.
- In the hw_module_t data structure, it has a field called methods with data type hw_module_methods_t. In hw_module_methods_t, it has an open method that returns a hw_device_t data structure.
- With hw_device_t, SurfaceFlinger can ...