一、DisplayHardware介绍
DisplayHardware是SurfaceFlinger中的组件,它代表了物理的显示硬件设备。它负责与显示设备进行通信,并提供了一些操作接口,如设置显示模式、刷新显示缓冲区等。DisplayHardware还负责管理显示缓冲区的内存,及处理与硬件相关的图形操作。
二、DisplayHardware相关类
VirtualDisplaySurface
负责管理和渲染虚拟显示器的图像内容。
VirtualDisplaySurface代码位于:
frameworks/native/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp
frameworks/native/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.h
VirtualDisplaySurface的定义:
class VirtualDisplaySurface : public compositionengine::DisplaySurface,
public BnGraphicBufferProducer,
private ConsumerBase {}
FramebufferSurface
用于表示一个基于帧缓冲区的Surface。
FramebufferSurface代码位于:
frameworks/native/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp
frameworks/native/services/surfaceflinger/DisplayHardware/FramebufferSurface.h
FramebufferSurface的定义:
class FramebufferSurface : public ConsumerBase, public compositionengine::DisplaySurface {}
HWComposer
surfaceflinger中用来于HWComposer交互的类。
HWComposer代码位于:
frameworks/native/services/surfaceflinger/DisplayHardware/HWComposer.cpp
frameworks/native/services/surfaceflinger/DisplayHardware/HWComposer.h
HWComposer的定义:
class HWComposer {}
class HWComposer final : public android::HWComposer {}
Composer
Composer代码位于:
frameworks/native/services/surfaceflinger/DisplayHardware/ComposerHal.cpp
frameworks/native/services/surfaceflinger/DisplayHardware/ComposerHal.h
Composer的定义:
class Composer {}
AidlComposer
AidlComposer代码位于:
frameworks/native/services/surfaceflinger/DisplayHardware/AidlComposer.cpp
frameworks/native/services/surfaceflinger/DisplayHardware/AidlComposer.h
AidlComposer的定义:
class AidlComposer final : public Hwc2::Composer {}