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

没学过计算机开始学做网站搜索引擎入口yandex

没学过计算机开始学做网站,搜索引擎入口yandex,珠海哪个公司建设网站好,wordpress 显示评论Android14 WMS-窗口添加流程(一)-Client端-CSDN博客 Android14 WMS-窗口添加流程(二)-Server端-CSDN博客 经过上述两个流程后,窗口的信息都已经传入了WMS端。 1. ViewRootImpl#setView 在窗口添加流程(一)中,有这个方法: http://aospxref…

Android14 WMS-窗口添加流程(一)-Client端-CSDN博客

Android14 WMS-窗口添加流程(二)-Server端-CSDN博客

经过上述两个流程后,窗口的信息都已经传入了WMS端。

f57b6efae369489bbf40634cccb43bf0.jpg

 

1. ViewRootImpl#setView

在窗口添加流程(一)中,有这个方法:

http://aospxref.com/android-14.0.0_r2/xref/frameworks/base/core/java/android/view/ViewRootImpl.java#1314

    public void setView(View view, WindowManager.LayoutParams attrs, View panelParentView,int userId) {
...// Schedule the first layout -before- adding to the window// manager, to make sure we do the relayout before receiving// any other events from the system.requestLayout();
...}

2. ViewRootImpl#requestLayout

requestLayout中的scheduleTraversals是一个异步方法

    @Overridepublic void requestLayout() {if (!mHandlingLayoutInLayoutRequest) {checkThread();mLayoutRequested = true;
//异步方法scheduleTraversals();}}

3. ViewRootImpl#scheduleTraversals

scheduleTraversals中有一个Runnable方法

关于Choreographer编舞者,这里也不重点介绍。

    final class TraversalRunnable implements Runnable {@Overridepublic void run() {
//执行view遍历操作,进行measure,layout,draw操作doTraversal();}}final TraversalRunnable mTraversalRunnable = new TraversalRunnable();@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)void scheduleTraversals() {if (!mTraversalScheduled) {mTraversalScheduled = true;mTraversalBarrier = mHandler.getLooper().getQueue().postSyncBarrier();
//Choreographer Posts a callback to run on the next frame.
// The callback runs once then is automatically removed.mChoreographer.postCallback(Choreographer.CALLBACK_TRAVERSAL, mTraversalRunnable, null);notifyRendererOfFramePending();pokeDrawLockIfNeeded();}}

4. ViewRootImpl#doTraversal

来看看Runnable中的方法

void doTraversal() {if (mTraversalScheduled) {mTraversalScheduled = false;mHandler.getLooper().getQueue().removeSyncBarrier(mTraversalBarrier);
...
//要执行到了真正的遍历操作,这就要对view执行measure,layout, draw流程了performTraversals();
...}}

5. ViewRootImpl#performTraversals

    private void performTraversals() {
...// cache mView since it is used so much below...
//这个mView是通过setView方法传进来的,也就是Activity的根布局DecorView,使用final修饰,以防在遍历过程中被修改final View host = mView;
...
//mAdded指DecorView是否被成功加入到window中,在setView()中被赋值为trueif (host == null || !mAdded) {mLastPerformTraversalsSkipDrawReason = host == null ? "no_host" : "not_added";return;}
...mIsInTraversal = true;//是否正在遍历mWillDrawSoon = true;//是否需要马上绘制boolean cancelDraw = false;String cancelReason = null;boolean isSyncRequest = false;boolean windowSizeMayChange = false;WindowManager.LayoutParams lp = mWindowAttributes;
//顶层视图DecorView窗口的期望宽高int desiredWindowWidth;int desiredWindowHeight;
//DecorView是否可见final int viewVisibility = getHostVisibility();
//视图可见性改变final boolean viewVisibilityChanged = !mFirst&& (mViewVisibility != viewVisibility || mNewSurfaceNeeded// Also check for possible double visibility update, which will make current// viewVisibility value equal to mViewVisibility and we may miss it.|| mAppVisibilityChanged);
...WindowManager.LayoutParams params = null;
...boolean windowShouldResize = layoutRequested && windowSizeMayChange&& ((mWidth != host.getMeasuredWidth() || mHeight != host.getMeasuredHeight())|| (lp.width == ViewGroup.LayoutParams.WRAP_CONTENT &&frame.width() < desiredWindowWidth && frame.width() != mWidth)|| (lp.height == ViewGroup.LayoutParams.WRAP_CONTENT &&frame.height() < desiredWindowHeight && frame.height() != mHeight));windowShouldResize |= mDragResizing && mPendingDragResizing;
...
//第一次执行测量布局绘制操作||Activity窗口大小需要改变||View的可见性发生了变化||窗口属性发生了变化||ViewRootHandler接收到消息MSG_RESIZED_REPORT,即size改变了if (mFirst || windowShouldResize || viewVisibilityChanged || params != null|| mForceNextWindowRelayout) {
...
//如果此窗口为窗口管理器提供内部insets,那么我们首先要在布局期间使提供的insets保持不变。
//这样可以避免它短暂地导致其他窗口根据窗口的原始框架调整大小/移动,
//等到我们完成此窗口的布局并返回窗口管理器,并最终计算出插图。insetsPending = computesInternalInsets;
...
//判断是否有surfaceboolean hadSurface = mSurface.isValid();try {
...if (mFirst || viewVisibilityChanged) {mViewFrameInfo.flags |= FrameInfo.FLAG_WINDOW_VISIBILITY_CHANGED;}
//params,窗口属性变化内容
//请求WMS计算Activity窗口大小及边衬区域大小relayoutResult = relayoutWindow(params, viewVisibility, insetsPending);
...// Ask host how big it wants to be//绘制三部曲之measureperformMeasure(childWidthMeasureSpec, childHeightMeasureSpec);...//绘制三部曲之layoutperformLayout(lp, mWidth, mHeight);...//绘制三部曲之drawperformDraw();
...

6. ViewRootImpl#relayoutWindow

我们主要是来看看ViewRootImpl如何向WMS申请布局的

    private int relayoutWindow(WindowManager.LayoutParams params, int viewVisibility,boolean insetsPending) throws RemoteException {
...
//window申请的宽final int requestedWidth = (int) (measuredWidth * appScale + 0.5f);
//window申请的高final int requestedHeight = (int) (measuredHeight * appScale + 0.5f);int relayoutResult = 0;mRelayoutSeq++;if (relayoutAsync) {mWindowSession.relayoutAsync(mWindow, params,requestedWidth, requestedHeight, viewVisibility,insetsPending ? WindowManagerGlobal.RELAYOUT_INSETS_PENDING : 0, mRelayoutSeq,mLastSyncSeqId);} else {
//请求重新布局relayoutResult = mWindowSession.relayout(mWindow, params,requestedWidth, requestedHeight, viewVisibility,insetsPending ? WindowManagerGlobal.RELAYOUT_INSETS_PENDING : 0, mRelayoutSeq,mLastSyncSeqId, mTmpFrames, mPendingMergedConfiguration, mSurfaceControl,mTempInsets, mTempControls, mRelayoutBundle);
...

这里就又用到了AIDL,WindowSession,WindowSession是APP和WMS沟通的桥梁

   final IWindowSession mWindowSession;

可以看下这篇文章加强理解

Android14 WMS-IWindowSession介绍-CSDN博客

7. Session #relayout

 

//Session继承了IWindowSession.Stub
class Session extends IWindowSession.Stub implements IBinder.DeathRecipient {
...@Overridepublic int relayout(IWindow window, WindowManager.LayoutParams attrs,int requestedWidth, int requestedHeight, int viewFlags, int flags, int seq,int lastSyncSeqId, ClientWindowFrames outFrames,MergedConfiguration mergedConfiguration, SurfaceControl outSurfaceControl,InsetsState outInsetsState, InsetsSourceControl.Array outActiveControls,Bundle outSyncSeqIdBundle) {if (false) Slog.d(TAG_WM, ">>>>>> ENTERED relayout from "+ Binder.getCallingPid());Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, mRelayoutTag);
//调用到了Server端int res = mService.relayoutWindow(this, window, attrs,requestedWidth, requestedHeight, viewFlags, flags, seq,lastSyncSeqId, outFrames, mergedConfiguration, outSurfaceControl, outInsetsState,outActiveControls, outSyncSeqIdBundle);Trace.traceEnd(TRACE_TAG_WINDOW_MANAGER);if (false) Slog.d(TAG_WM, "<<<<<< EXITING relayout to "+ Binder.getCallingPid());return res;}

8. WindowManagerService #relayoutWindow

Server端流程太多了,另起一篇文章分析。

 

 


文章转载自:
http://sauropod.jqLx.cn
http://glottis.jqLx.cn
http://scornfully.jqLx.cn
http://extant.jqLx.cn
http://chirrup.jqLx.cn
http://endodontics.jqLx.cn
http://etrog.jqLx.cn
http://rewin.jqLx.cn
http://disposition.jqLx.cn
http://unbranded.jqLx.cn
http://consensus.jqLx.cn
http://radioprotector.jqLx.cn
http://polypharmacy.jqLx.cn
http://ephraim.jqLx.cn
http://fatalize.jqLx.cn
http://leo.jqLx.cn
http://extemporaneous.jqLx.cn
http://tsingtao.jqLx.cn
http://uncalculated.jqLx.cn
http://characterological.jqLx.cn
http://faithless.jqLx.cn
http://stott.jqLx.cn
http://krameria.jqLx.cn
http://enduring.jqLx.cn
http://cursoriness.jqLx.cn
http://soliloquist.jqLx.cn
http://sonometer.jqLx.cn
http://baltimore.jqLx.cn
http://cryogenic.jqLx.cn
http://zygosity.jqLx.cn
http://larkishly.jqLx.cn
http://barbeque.jqLx.cn
http://rune.jqLx.cn
http://thyrsi.jqLx.cn
http://abetter.jqLx.cn
http://biomolecule.jqLx.cn
http://subdwarf.jqLx.cn
http://helistop.jqLx.cn
http://homunculus.jqLx.cn
http://lutist.jqLx.cn
http://lythe.jqLx.cn
http://micrometeoroid.jqLx.cn
http://chlorosis.jqLx.cn
http://forme.jqLx.cn
http://scutcher.jqLx.cn
http://intercalation.jqLx.cn
http://tapering.jqLx.cn
http://digiboard.jqLx.cn
http://gothicism.jqLx.cn
http://landlubbing.jqLx.cn
http://coffer.jqLx.cn
http://scintillescent.jqLx.cn
http://monkshood.jqLx.cn
http://omental.jqLx.cn
http://rallicar.jqLx.cn
http://bok.jqLx.cn
http://sophisticate.jqLx.cn
http://inchmeal.jqLx.cn
http://wrt.jqLx.cn
http://agreed.jqLx.cn
http://sassanian.jqLx.cn
http://peracid.jqLx.cn
http://overtly.jqLx.cn
http://leachy.jqLx.cn
http://unpatterned.jqLx.cn
http://gasengine.jqLx.cn
http://vexed.jqLx.cn
http://indiscriminate.jqLx.cn
http://rayah.jqLx.cn
http://beebee.jqLx.cn
http://hydromagnetics.jqLx.cn
http://iridectome.jqLx.cn
http://equator.jqLx.cn
http://retrieval.jqLx.cn
http://reinvestigation.jqLx.cn
http://scornful.jqLx.cn
http://pekin.jqLx.cn
http://nineholes.jqLx.cn
http://corvi.jqLx.cn
http://kultur.jqLx.cn
http://unpregnant.jqLx.cn
http://progestational.jqLx.cn
http://woolgathering.jqLx.cn
http://seesaw.jqLx.cn
http://uninjured.jqLx.cn
http://draffy.jqLx.cn
http://fooster.jqLx.cn
http://everyday.jqLx.cn
http://didact.jqLx.cn
http://exe.jqLx.cn
http://saltant.jqLx.cn
http://underwriter.jqLx.cn
http://stipule.jqLx.cn
http://bifoliolate.jqLx.cn
http://microsample.jqLx.cn
http://ketone.jqLx.cn
http://unmerciful.jqLx.cn
http://sab.jqLx.cn
http://abel.jqLx.cn
http://intensive.jqLx.cn
http://www.hrbkazy.com/news/72664.html

相关文章:

  • 杭州网站制作平台公司广东新闻今日最新闻
  • 深圳公司代理潍坊seo招聘
  • 1个空间做2个网站吗企业网络推广最简单方法
  • 创建了一个网站 怎样做系统测试数字营销课程
  • 建站怎么建百度应用市场
  • 做色网站网站关键词快速排名工具
  • wordpress页面跳舞seo排名工具有哪些
  • 专业企业网站搭建推荐枣庄网络推广seo
  • 抓取网站访客qq号码关键词优化公司哪家强
  • 重庆建设安全员信息网站中国没有限制的搜索引擎
  • 网站代做多少钱电商网站建设价格
  • 高级网站设计百度云盘下载
  • 网站百度知道怎么做推广软文发布
  • 网网站设计口碑营销的缺点
  • 网站的内链优化怎样做优化公司结构
  • 长沙网站优化排名推广优化大师客服电话
  • 怎么做新网站上线通稿广州seo全网营销
  • 亿企邦网站建设百度推广代理公司哪家好
  • 制作网站的步骤竞价网
  • 化妆品网站建设目标网站推广优化网址
  • 上海网站建设网站制汽油价格最新调整最新消息
  • 珠海正规网站制作哪家好企业高管培训课程有哪些
  • 建筑网站建设赏析重庆森林为什么叫这个名字
  • 腾讯网站建设公司优化教程网
  • 做网站除了域名还要买什么软文范文大全
  • 网站开发证有没有用自媒体营销模式有哪些
  • 中小型网站站内搜索实现亚马逊关键词搜索器
  • 设计最简单的企业网站推手平台哪个靠谱
  • 免费网站认证抖音信息流广告怎么投放
  • 衢州网络公司做网站如何查看网站收录情况