summaryrefslogtreecommitdiff
path: root/libs/ultrahdr/jpegencoderhelper.cpp
diff options
context:
space:
mode:
author Yiwei Zhang <zzyiwei@google.com> 2024-03-11 21:35:06 +0000
committer Yiwei Zhang <zzyiwei@google.com> 2024-03-12 03:22:42 +0000
commitd5b1690f4eb8587c3ec6f6fec5df01a1c10b8c2c (patch)
tree8ea0c65411aafc76db9b1bc2ae1bbc22c43b46a5 /libs/ultrahdr/jpegencoderhelper.cpp
parent959f5184636c98d1b98ccf7c22a354ef9fb45006 (diff)
swapchain: support RGBX backed opaque swapchain for offscreen
When a swapchain is connected to SurfaceFlinger, it makes sense to only advertise INHERIT bit on Android. However, for offscreen scenarios, e.g. a video encoder surface, that currently shuts the door for preferring RGBX over RGBA for the requested VK_FORMAT_R8G8B8A8_* format, ending up with suboptimal performance when using Vulkan swapchain. This change advertises the OPAQUE bit for offscreen scenarios, and adds the code path to prefer RGBX as the backing storage when OPAQUE is used. This bridges a gap against EGL where GL_RGB8 is used for such encoder surface, which internally picks RGBX. This casts no regressions for anything currently going to the display via KHR_swapchain. Bug: b/328125698, b/328122401 Test: below tests pass with ANGLE on Zork device (AMD chromebook) 1. android.media.encoder.cts.SurfaceEncodeTimestampTest 2. android.media.codec.cts.EncodeDecodeTest - testEncodeDecodeVideoFromSurfaceToPersistentSurface - testEncodeDecodeVideoFromSurfaceToPersistentSurfaceNdk Change-Id: I82a7ac741dc70a3e3b5fdd4f7499c937c4dce6d8
Diffstat (limited to 'libs/ultrahdr/jpegencoderhelper.cpp')
0 files changed, 0 insertions, 0 deletions