码迷,mamicode.com
首页 > Windows程序 > 详细

ViewRootImpl和WindowManagerService笔记

时间:2014-08-05 14:17:29      阅读:391      评论:0      收藏:0      [点我收藏+]

标签: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笔记,布布扣,bubuko.com

ViewRootImpl和WindowManagerService笔记

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

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!