Android6.0 显示系统(六) 图像的输出过程

Android6.0 显示系统(六) 图像的输出过程

ID:38580331

大小:243.00 KB

页数:28页

时间:2019-06-15

Android6.0 显示系统(六) 图像的输出过程_第1页
Android6.0 显示系统(六) 图像的输出过程_第2页
Android6.0 显示系统(六) 图像的输出过程_第3页
Android6.0 显示系统(六) 图像的输出过程_第4页
Android6.0 显示系统(六) 图像的输出过程_第5页
资源描述:

《Android6.0 显示系统(六) 图像的输出过程》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、Android6.0显示系统(六)图像的输出过程主要就是分析这个函数,我们先看看它的代码:[cpp]viewplaincopy在CODE上查看代码片派生到我的代码片voidSurfaceFlinger::handleMessageRefresh(){ATRACE_CALL();staticnsecs_tpreviousExpectedPresent=0;nsecs_texpectedPresent=mPrimaryDispSync.computeNextRefresh(0);staticboolpreviousFrameMissed=false;boolframeMissed=(ex

2、pectedPresent==previousExpectedPresent);if(frameMissed!=previousFrameMissed){ATRACE_INT("FrameMissed",static_cast(frameMissed));}previousFrameMissed=frameMissed;if(CC_UNLIKELY(mDropMissedFrames&&frameMissed)){//Latchbuffers,butdon'tsendanythingtoHWC,thensignalanother//wakeupforthenextvsync

3、preComposition();repaintEverything();}else{preComposition();rebuildLayerStacks();setUpHWComposer();doDebugFlashRegions();doComposition();postComposition();}previousExpectedPresent=mPrimaryDispSync.computeNextRefresh(0);}我们主要看下下面几个函数。[cpp]viewplaincopy在CODE上查看代码片派生到我的代码片preComposition();rebuildL

4、ayerStacks();setUpHWComposer();doDebugFlashRegions();doComposition();postComposition();一、preComposition函数我们先来看第一个函数preComposition[cpp]viewplaincopy在CODE上查看代码片派生到我的代码片voidSurfaceFlinger::preComposition(){boolneedExtraInvalidate=false;constLayerVector&layers(mDrawingState.layersSortedByZ);constsi

5、ze_tcount=layers.size();for(size_ti=0;ionPreComposition()){needExtraInvalidate=true;}}if(needExtraInvalidate){signalLayerUpdate();}}上面函数先是调用了mDrawingState的layersSortedByZ来得到上次绘图的Layer层列表。并不是所有的Layer都会参与屏幕图像的绘制,因此SurfaceFlinger用state对象来记录参与绘制的Layer对象。记得在之前的博客,我们分析过creat

6、eLayer函数来创建Layer,创建之后会调用addClientLayer函数。[cpp]viewplaincopy在CODE上查看代码片派生到我的代码片status_tSurfaceFlinger::createLayer(constString8&name,constsp&client,uint32_tw,uint32_th,PixelFormatformat,uint32_tflags,sp*handle,sp*gbp){//ALOGD("createLayerfor(%dx%d),name=%

7、s",w,h,name.string());if(int32_t(w

8、h)<0){ALOGE("createLayer()failed,worhisnegative(w=%d,h=%d)",int(w),int(h));returnBAD_VALUE;}status_tresult=NO_ERROR;splayer;switch(flags&ISurfaceComposerClient::eFXSurfaceMask){caseISurfac

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。