Commit 4df0e8ba authored by Wei Lee's avatar Wei Lee Committed by Commit Bot

Get supported formats before sandboxing

This CL fixes a bug that will cause camera failed to play the preview.

Bug: b/166850715
Test: Launch Chrome Camera app and preview is shown

Change-Id: If61d74dc9478bc6138389b9fa6c0dded5a6e8359
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2454592
Commit-Queue: Wei Lee <wtlee@chromium.org>
Reviewed-by: default avatarPeng Huang <penghuang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#814705}
parent 80766b8c
......@@ -316,10 +316,17 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line,
#if defined(USE_OZONE)
// Initialize Ozone GPU after the watchdog in case it hangs. The sandbox
// may also have started at this point.
std::vector<gfx::BufferFormat> supported_buffer_formats_for_texturing;
if (features::IsUsingOzonePlatform()) {
ui::OzonePlatform::InitParams params;
params.single_process = false;
ui::OzonePlatform::InitializeForGPU(params);
// We need to get supported formats before sandboxing to avoid an known
// issue which breaks the camera preview. (b/166850715)
supported_buffer_formats_for_texturing =
ui::OzonePlatform::GetInstance()
->GetSurfaceFactoryOzone()
->GetSupportedFormatsForTexturing();
}
#endif
......@@ -585,11 +592,6 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line,
#if defined(USE_OZONE)
if (features::IsUsingOzonePlatform()) {
ui::OzonePlatform::GetInstance()->AfterSandboxEntry();
const std::vector<gfx::BufferFormat>
supported_buffer_formats_for_texturing =
ui::OzonePlatform::GetInstance()
->GetSurfaceFactoryOzone()
->GetSupportedFormatsForTexturing();
gpu_feature_info_.supported_buffer_formats_for_allocation_and_texturing =
std::move(supported_buffer_formats_for_texturing);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment