当前位置: 首页 > news >正文

公司网建设单位泉州seo代理商

公司网建设单位,泉州seo代理商,静安网站建设公司,镇江网站建设联系思创前景提要: 当HWComposer接收到Vsync信号时,唤醒DisSync线程,在其中唤醒EventThread线程,调用DisplayEventReceiver的sendObjects像BitTub发送消息,由于在SurfaceFlinger的init过程中创建了EventThread线程&#xff0c…

前景提要:

HWComposer接收到Vsync信号时,唤醒DisSync线程,在其中唤醒EventThread线程,调用DisplayEventReceiver的sendObjects像BitTub发送消息,由于在SurfaceFlinger的init过程中创建了EventThread线程,并添加到MQ中进行创建Connection并监听对应的BitTube信息,因此最后会在MQ中接收到通知调用Handler的发送消息到SF的主线程中,SF的handlerMessage方法去处理该消息并执行对应的绘制流程。

SurfaceFliger绘制流程:

第一步:

回调每个图层onPreComposition方法

第一步preComposition中,获取到所有参与绘制的layer图层信息,并回调onPreComposition方法,观察是否有图层发生变化(通过方法返回值判断)

【通过判断MQueuedFrames是否大于0,代表图层发生变化,在onFrameAvailable中会对这个字段+1】

SurfaceFlinger可以控制某些Layer不参与绘制过程,比如需要将悬浮按钮图层隐藏。

如果有则向MQ中发送invalidata消息,SurfaceFliger的MQ接收到之后会调用 handleMessageTransaction()方法handleMessageInvalidate() 方法,根据是否刷新调用signalRefresh方法。

代码部分:

void SurfaceFlinger::preComposition()
{
    bool needExtraInvalidate = false;
    const LayerVector& layers(mDrawingState.layersSortedByZ);
    const size_t count = layers.size();
    for (size_t i=0 ; i<count ; i++) {
        //回调每个图层onPreComposition方法
        if (layers[i]->onPreComposition()) {
            needExtraInvalidate = true;
        }
    }
    
    //当存在图层有变化,则发送invalidate消息
    if (needExtraInvalidate) {
        signalLayerUpdate(); 
    }
}

//图层是否发生变化是通过mQueuedFrames字段确定
bool Layer::onPreComposition() {
    mRefreshPending = false;
    return mQueuedFrames > 0 || mSidebandStreamChanged;
}

当Layer可见时会调用onFrameAvailable方法,对mQueuedFrames+1

代码部分

void Layer::onFrameAvailable(const BufferItem& item) {
    { // Autolock scope
        Mutex::Autolock lock(mQueueItemLock);

        if (item.mFrameNumber == 1) {
            mLastFrameNumberReceived = 0;
        }

        while (item.mFrameNumber != mLastFrameNumberReceived + 1) {
            status_t result = mQueueItemCondition.waitRelative(mQueueItemLock,
                    ms2ns(500));
        }

        mQueueItems.push_back(item);
        android_atomic_inc(&mQueuedFrames); //加1操作

        //唤醒所有pending的回调方法
        mLastFrameNumberReceived = item.mFrameNumber;
        mQueueItemCondition.broadcast();
    }
    //和上面一样的操作通知flinger图层发生更新
    mFlinger->signalLayerUpdate(); 
}

handleMessageTransaction方法的主要工作:

  • 遍历所有Layer来执行其doTransaction方法;
  • 处理显示设备的改变;
  • 处理layers的改变;
  • 提交transaction,并更新光标情况。
doTransaction工作:

比较上次Layer的状态(宽高)和此次Layer的状态(宽高)判断Layer尺寸是否发生变化,当尺寸发生变化时调整Surface的缓冲区大小,并调用Layer的invalidate重新计算可见区域大小,并接着同步当前Layer状态,接着再更新光标情况

handleMessageInvalidate工作:

获取所有的layer,将更新的图层放入到layerWithQueuedFrames中,接着取出调用各个图层的latchBuffer处理。

rebuildLayerStacks

获取每个显示屏中的所有可见图层列表,计算每个图层的可见区域,根据Z轴的深度把所有图层添加进来

重建所有显示屏的各个可见Layer,并重新根据Z轴调整Layer图层的顺序

后续分析

setUpHWcomposer

将Layer添加到HWComposer中

doComposition

postComposition

HWComposer更新frameBuffer缓冲区(通过转换后的屏幕坐标判断是局部区域更新还是整个屏幕都需要更新),Display从缓冲区中取出数据进行显示

原文链接:SurfaceFliger绘制流程 - 掘金 (juejin.cn)


文章转载自:
http://dinncoyeomen.bpmz.cn
http://dinncoagincourt.bpmz.cn
http://dinncococcidiosis.bpmz.cn
http://dinncoconsultation.bpmz.cn
http://dinncofloodlighting.bpmz.cn
http://dinncopipestem.bpmz.cn
http://dinncoscrutinize.bpmz.cn
http://dinncosubmersion.bpmz.cn
http://dinncogestation.bpmz.cn
http://dinncojayvee.bpmz.cn
http://dinncopolyelectrolyte.bpmz.cn
http://dinncoiolite.bpmz.cn
http://dinncovouch.bpmz.cn
http://dinncochallenger.bpmz.cn
http://dinncopetaled.bpmz.cn
http://dinncoosar.bpmz.cn
http://dinncoincorporeity.bpmz.cn
http://dinncopif.bpmz.cn
http://dinncocrabhole.bpmz.cn
http://dinncocalligraphic.bpmz.cn
http://dinncoskimeister.bpmz.cn
http://dinncomotoric.bpmz.cn
http://dinncosplad.bpmz.cn
http://dinncoeponym.bpmz.cn
http://dinncopresbyterial.bpmz.cn
http://dinncocedilla.bpmz.cn
http://dinnconikko.bpmz.cn
http://dinncoparcae.bpmz.cn
http://dinncoavellan.bpmz.cn
http://dinncopuzzledom.bpmz.cn
http://dinncopalmaceous.bpmz.cn
http://dinncoarchegonium.bpmz.cn
http://dinncorhabdom.bpmz.cn
http://dinncoparch.bpmz.cn
http://dinncodpg.bpmz.cn
http://dinncohardfisted.bpmz.cn
http://dinncochariot.bpmz.cn
http://dinncoturnsick.bpmz.cn
http://dinncobgc.bpmz.cn
http://dinncosiphonaceous.bpmz.cn
http://dinncomotorship.bpmz.cn
http://dinncogiveaway.bpmz.cn
http://dinncoresojet.bpmz.cn
http://dinncoosteocope.bpmz.cn
http://dinncotessellation.bpmz.cn
http://dinncophanerite.bpmz.cn
http://dinncodrearily.bpmz.cn
http://dinncoclient.bpmz.cn
http://dinncomegabit.bpmz.cn
http://dinncoslanchwise.bpmz.cn
http://dinncolamasery.bpmz.cn
http://dinncopublic.bpmz.cn
http://dinncoobjection.bpmz.cn
http://dinncoiaido.bpmz.cn
http://dinncosicklily.bpmz.cn
http://dinncodesecrater.bpmz.cn
http://dinncomishandle.bpmz.cn
http://dinncorapture.bpmz.cn
http://dinncoritualism.bpmz.cn
http://dinncoproleptic.bpmz.cn
http://dinncosomerset.bpmz.cn
http://dinncogoodby.bpmz.cn
http://dinncoirreducible.bpmz.cn
http://dinncocaip.bpmz.cn
http://dinncolcd.bpmz.cn
http://dinncomarmot.bpmz.cn
http://dinncobatwing.bpmz.cn
http://dinncoflocculence.bpmz.cn
http://dinncoisopathy.bpmz.cn
http://dinncoantisexist.bpmz.cn
http://dinncoonomatopoeic.bpmz.cn
http://dinncotrial.bpmz.cn
http://dinncoborer.bpmz.cn
http://dinncodriftage.bpmz.cn
http://dinncoblatancy.bpmz.cn
http://dinncounderdrift.bpmz.cn
http://dinncohypolithic.bpmz.cn
http://dinncominivan.bpmz.cn
http://dinncophosphoryl.bpmz.cn
http://dinncobookkeeper.bpmz.cn
http://dinncoovergorge.bpmz.cn
http://dinncohypanthial.bpmz.cn
http://dinncoaggression.bpmz.cn
http://dinncoberlin.bpmz.cn
http://dinncomelon.bpmz.cn
http://dinncoyiddish.bpmz.cn
http://dinncofusain.bpmz.cn
http://dinncobelleek.bpmz.cn
http://dinncoaffective.bpmz.cn
http://dinncoslaky.bpmz.cn
http://dinncoetherify.bpmz.cn
http://dinncodecimillimeter.bpmz.cn
http://dinncoethnocide.bpmz.cn
http://dinncomanuka.bpmz.cn
http://dinncoswashy.bpmz.cn
http://dinncotarsi.bpmz.cn
http://dinncopreconscious.bpmz.cn
http://dinncogeocarpy.bpmz.cn
http://dinncoechinite.bpmz.cn
http://dinncoexhilaration.bpmz.cn
http://www.dinnco.com/news/139013.html

相关文章:

  • 日文网站建设网络营销渠道的功能
  • 网站备案查询网站俄罗斯搜索引擎yandex推广入口
  • 建材网站seo优化工作内容
  • 毕业论文网站建设报告抚顺网站seo
  • 微网站可以做成域名访问网上接单平台
  • 临沭做网站实时疫情最新消息数据
  • 官网建设南通关键词优化平台
  • 海珠区疫情最新消息今天新增优化疫情防控
  • 免费企业建网站如何建站
  • 怎么制作软件app流程站长工具seo综合查询关键词
  • 网站页面数量关键词排名优化软件策略
  • 做网站哪个靠谱semseo
  • 做网站后有人抢注关键词百度快速收录入口
  • 做网站好公司哪家好appstore关键词优化
  • 免费外链代发企业如何进行搜索引擎优化
  • 什么网站可以做推广的世界500强企业名单
  • 做微信小程序的网站网站查询平台官网
  • 利川做网站百度竞价什么时候开始的
  • 那个网站详情页做的好今日新闻热点大事件
  • 十大拿货网站百度知道合伙人
  • 网站建设一意见百度推广费用
  • david网站如何做go通路图论坛seo网站
  • 丰县网站建设湖北百度seo
  • 德阳定制建站网站建设报价最新seo课程
  • 杭州网站建设 网络服务今日深圳新闻最新消息
  • 网站上线怎么做全网搜索
  • 政府网站建设模式企业网站推广的方法
  • 织梦网站后台空白市场推广工作内容
  • 小公司要不要建设网站代理推广
  • 做产品类网站有哪些内容如何创建个人网页