1.frameworks/base/cmds/bootanimation/BootAnimation.cpp
@@ -278,13 +278,18 @@ status_t BootAnimation::readyToRun() {
status_t status = SurfaceComposerClient::getDisplayInfo(mDisplayToken, &dinfo);
if (status)
return -1;
+ int orientation = 1; // landscape
+ if (orientation) {
+ if (dinfo.h > dinfo.w) {
+ int temp = dinfo.h;
+ dinfo.h= dinfo.w;
+ dinfo.w= temp;
+ }
+ }
+
// create the native surface
SurfaceComposerClient::Transaction t;
sp<SurfaceControl> control = session()->createSurface(String8("BootAnimation"),
dinfo.w, dinfo.h, PIXEL_FORMAT_RGB_565);
2.frameworks/native/services/surfaceflinger/DisplayDevice.cpp
@@ -90,7 +90,7 @@ DisplayDevice::DisplayDevice(DisplayDeviceCreationArgs&& args)
setPowerMode(args.initialPowerMode);
// initialize the display orientation transform.
- setProjection(DisplayState::eOrientationDefault, Rect::INVALID_RECT, Rect::INVALID_RECT);
+ setProjection(DisplayState::eOrientation90, Rect::INVALID_RECT, Rect::INVALID_RECT);
}
DisplayDevice::~DisplayDevice() = default;
@@ -248,6 +248,12 @@ 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);
+ int orient = 1; // landscape
+ if (orient) {
+ if (h > w) {
+ frame = Rect(h, w);
+ }
+ }
}
if (viewport.isEmpty()) {
3.frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
@@ -5210,7 +5210,7 @@ void SurfaceFlinger::onInitializeDisplays() {
DisplayState::eLayerStackChanged;
d.token = token;
d.layerStack = 0;
- d.orientation = DisplayState::eOrientationDefault;
+ d.orientation = DisplayState::eOrientation90;
d.frame.makeInvalid();
d.viewport.makeInvalid();
d.width = 0;
android 10 系统源码 (屏幕物理竖屏)默认开机动画横屏显示
最新推荐文章于 2022-10-13 22:11:49 发布