ViewRootImpl和WindowManagerService笔记

2020-12-13 05:58

阅读:312

标签:style   java   for   ar   代码   div   window   view   

1、每一个窗口的ViewRootImpl都有一个mWindowAttributes窗口属性,该属性在WindowManagerGlobal.updateViewLayout()->ViewRootImpl.setView()和WindowManagerGlobal.updateViewLayout->ViewRootImpl.setLayoutParams()中赋值,同时ViewRootImpl.mWindowAttributesChanged也会设为true表示窗口属性已更改,当窗口属性更改时,surfaceChanged也会设置为true

 if (mWindowAttributesChanged) {
            mWindowAttributesChanged = false;
            surfaceChanged = true;
            params = lp;
        }

当surfaceChanged设置为true时,下面这段代码会调用

if (surfaceChanged) {
                        mSurfaceHolderCallback.surfaceChanged(mSurfaceHolder,
                                lp.format, mWidth, mHeight);
                        SurfaceHolder.Callback callbacks[] = mSurfaceHolder.getCallbacks();
                        if (callbacks != null) {
                            for (SurfaceHolder.Callback c : callbacks) {
                                c.surfaceChanged(mSurfaceHolder, lp.format,
                                        mWidth, mHeight);
                            }
                        }
                    }

ViewRootImpl和WindowManagerService笔记,搜素材,soscw.com

ViewRootImpl和WindowManagerService笔记

标签:style   java   for   ar   代码   div   window   view   

原文地址:http://blog.csdn.net/guoqifa29/article/details/38382365


评论


亲,登录后才可以留言!