Skip to content
Commit ad62bda3 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Do not set report-orientation-changed for window without surface

Otherwise the state may remain to the next new surface when
the window becomes visible, and it will get ViewRootImpl
#mForceNextWindowRelayout=true from WindowState#resize. And then
its pre-allocated buffers from ThreadedRenderer#allocateBuffers
will be dropped by ThreadedRenderer#updateSurface. And then
allocate again in each frame, which is very wasteful.

Bug: 228223340
Test: 1. Launch a landscape app from portrait launcher.
      2. Use command "record_android_trace sched view wm am gfx".
      3. Swipe up to return to launcher.
      4. The trace of launcher should not show "setSurface".
         And there should not have "allocateHelper" in "DrawFrames".
Change-Id: If66cde35837b0362ca51eee018d8828416d118ec
parent 7b0f4e57
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment