zl程序教程

您现在的位置是:首页 >  移动开发

当前栏目

Android 10 如何在SurfaceFlinger中解决开机动画显示不全问题

Android动画 如何 解决 显示 10 开机 问题
2023-09-14 09:04:18 时间

代码路径:
frameworks/native/services/surfaceflinger/DisplayDevice.cpp
在DisplayDevice.cpp文件中setProjection()方法中

— a/services/surfaceflinger/DisplayDevice.cpp
+++ b/services/surfaceflinger/DisplayDevice.cpp
@@ -231,6 +231,9 @@ void DisplayDevice::setProjection(int orientation,
// the destination frame can be invalid if it has never been set,
// in that case we assume the whole display frame.
frame = Rect(w, h);

  • if ((R.getOrientation() & ui::Transform::ROT_90) || (mFlinger->primaryDisplayOrientation & DisplayState::eOrientationSwapMask)) {

  •    std::swap(frame.right, frame.bottom);
    
  • }
    }

    if (viewport.isEmpty()) {
    @@ -239,7 +242,7 @@ void DisplayDevice::setProjection(int orientation,
    // it’s also invalid to have an empty viewport, so we handle that
    // case in