summaryrefslogtreecommitdiff
path: root/libs/androidfw/FileStream.cpp
diff options
context:
space:
mode:
author Hongwei Wang <hwwang@google.com> 2025-03-13 15:39:58 -0700
committer Hongwei Wang <hwwang@google.com> 2025-03-13 16:09:41 -0700
commit9f608cfa69fcf4d828bb44fc6f149a7ad3ba3263 (patch)
tree6f3dafcf1f6a67ff074734f25ada0f1acc91cffd /libs/androidfw/FileStream.cpp
parent35b49cfff5a4e6346f80690c936321d14d53365c (diff)
[1/N] Check destination against src aspect ratio
This is the fix on SystemUI side. There is a counterpart on Launcher side. PictureInPictureParams#isSameAspectRatio has 1-pixel allowance when comparing a given Rect against the aspect ratio. When we compare the source rect hint against the aspect ratio inferred from the destination bounds, the float error during the destination bounds calculation is amped. For instance: - Source rect hint: Rect(152, 0 - 2072, 1080), 1920x1080 - Destination bounds: Rect(440, 1218 - 1038, 1554), 598x336 When do the isSameAspectRatio - If we fix the height=1080, expected width=1922, it's 2 pixels off - If we fix the width=1920, expected height=1078, it's 2 pixels off The check would fail. Instead, in this change, we compare the destination bounds against the aspect ratio from the source rect hint. For the same source rect hint and destination bounds - If we fix the height=336, expected width=597, it's 1 pixel off - If we fix the width=598, expect height=336, it's 0 pixel off Note: this change applies to both PiP1 and PiP2 Flag: EXEMPT bugfix Bug: 402190788 Video: http://recall/-/aaaaaabFQoRHlzixHdtY/cUXaoJxzXDdKdSyqkQZOG1 Test: Swipe to enter PiP from landscape playback, see also Video Change-Id: I02d6ddf2d0f2ffdc2e33c52ff9577fcba07d26ce
Diffstat (limited to 'libs/androidfw/FileStream.cpp')
0 files changed, 0 insertions, 0 deletions