android/DisplayHotplug
2016-06-02 18:25
351 查看
This feature is implemented as part of android version 4.2.1 and onward. The implementation is given as part of android's Surfaceflinger and HWComposer.
The call flow chart of Surfaceflinger is given below #
Surfaceflinger
Updates #
Surfacefliger in android version 4.2.1 has the implementation differences from version 4.1. Surfaceflinger.cpp: 1. SurfaceFlinger::createSurface is replaced with SurfaceFlinger::createLayer,
which intenal gives the implementation of creating a layer of type Normal, Dim or Screenshot. After successful creation of layer, it return handle to the surface.
New
classes have been introduced #
class Fence?
class Region?
class GraphicBuffer?
Control
flow #
Surfaceflinger.cpp
|
Displaydevice.cpp
|
Framwbuffersurface.cpp
|
HWComposer.cpp
|
fb device
Function
call flow #
void SurfaceFlinger::onMessageReceived(int32_t what) {
ATRACE_CALL();
switch (what) {
case MessageQueue::INVALIDATE:
handleMessageTransaction();
handleMessageInvalidate();
signalRefresh();
break;
case MessageQueue::REFRESH:
handleMessageRefresh();
break;
}
}
The main functionality of composing, distributing and displaying the framebuffer would be taken place during the execution of the below functions
void SurfaceFlinger::handleMessageRefresh() {
ATRACE_CALL();
preComposition();
rebuildLayerStacks();
setUpHWComposer();
doDebugFlashRegions();
doComposition();
postComposition();
}
preComposition
#
rebuildLayerStacks#
computeVisibleRegions for each display, transparentRegion functionality has been updated.
setUpHWComposer
#
Creates hwc for each display device connected to the system. set the perframedata for each layer in layer list of display device
doDebugFlashRegions
#
To enable debugging of surfaceflinger doComposeSurfaces() compositionComplete()
doComposition
#
getDirtyRegion()
doDisplayComposition() → doComposeSurfaces()
compositionComplete()
postFramebuffer()
doComposeSurfaces
#
const Rect& bounds(hw->getBounds());
const Transform& tr(hw->getTransform());
const Rect scissor(tr.transform(hw->getViewport()));
CompositionTypes:
HWC_OVERLAY
HWC_FRAMEBUFFER
HWC_FRAMEBUFFER_TARGET
The call flow chart of Surfaceflinger is given below #
Surfaceflinger
Updates #
Surfacefliger in android version 4.2.1 has the implementation differences from version 4.1. Surfaceflinger.cpp: 1. SurfaceFlinger::createSurface is replaced with SurfaceFlinger::createLayer,
which intenal gives the implementation of creating a layer of type Normal, Dim or Screenshot. After successful creation of layer, it return handle to the surface.
New
classes have been introduced #
class Fence?
class Region?
class GraphicBuffer?
Control
flow #
Surfaceflinger.cpp
|
Displaydevice.cpp
|
Framwbuffersurface.cpp
|
HWComposer.cpp
|
fb device
Function
call flow #
void SurfaceFlinger::onMessageReceived(int32_t what) {
ATRACE_CALL();
switch (what) {
case MessageQueue::INVALIDATE:
handleMessageTransaction();
handleMessageInvalidate();
signalRefresh();
break;
case MessageQueue::REFRESH:
handleMessageRefresh();
break;
}
}
The main functionality of composing, distributing and displaying the framebuffer would be taken place during the execution of the below functions
void SurfaceFlinger::handleMessageRefresh() {
ATRACE_CALL();
preComposition();
rebuildLayerStacks();
setUpHWComposer();
doDebugFlashRegions();
doComposition();
postComposition();
}
preComposition
#
rebuildLayerStacks#
computeVisibleRegions for each display, transparentRegion functionality has been updated.
setUpHWComposer
#
Creates hwc for each display device connected to the system. set the perframedata for each layer in layer list of display device
doDebugFlashRegions
#
To enable debugging of surfaceflinger doComposeSurfaces() compositionComplete()
doComposition
#
getDirtyRegion()
doDisplayComposition() → doComposeSurfaces()
compositionComplete()
postFramebuffer()
doComposeSurfaces
#
const Rect& bounds(hw->getBounds());
const Transform& tr(hw->getTransform());
const Rect scissor(tr.transform(hw->getViewport()));
CompositionTypes:
HWC_OVERLAY
HWC_FRAMEBUFFER
HWC_FRAMEBUFFER_TARGET
相关文章推荐
- android 瀑布流效果(仿蘑菇街)
- Android 沉浸式状态栏攻略 让你的状态栏变色吧
- Android studio常用快捷键
- 获得android 应用的版本和当前android系统版本
- 快速查看Android Docs文档
- 打包apk生成签名
- Android内存优化之OOM
- Android内存优化总结【整理】
- RecycleView之使用心得【1】
- Android调用指定浏览器,判断某个应用是否安装
- JNI多个线程中使用 android开发教程
- Android样式开发--selector
- Android单应用开多进程与单进程跑多应用
- android产品研发(四)-->减小Apk大小
- Android随笔-06.02.2016
- Android开发_资源收集
- Android样式开发---shape
- android Zxing二维码之读取手机二维码图片
- Android——Fragment实例精讲——底部导航栏+ViewPager滑动切换页面
- Android Studio下Vim的使用