Commit 0edbea47 authored by Julien Isorce's avatar Julien Isorce Committed by Commit Bot

Make sure to init Mac's VideoToolBox before GL

Otherwise this leads to crashes in VTDecompressionSessionCreate.

The CL http://crrev.com/c/2013806 changed the order but
the intention was to fix an issue on Linux/Wayland. So
restore the previous behavior on Mac. Also restore the
previous behavior on other operating systems to make the
change safer. And guard the new order with OS_LINUX.

Bug: 1047643
Change-Id: I9637a684996ee095d32a336610cb65a7d0d20370
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2068207Reviewed-by: default avatarMaggie Chen <magchen@chromium.org>
Reviewed-by: default avatarKenneth Russell <kbr@chromium.org>
Commit-Queue: Julien Isorce <julien.isorce@chromium.org>
Cr-Commit-Position: refs/heads/master@{#744001}
parent 96d0561c
......@@ -217,6 +217,12 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line,
// execute the pre-sandbox steps now.
sandbox_helper_->PreSandboxStartup();
}
#else
// For some reasons MacOSX's VideoToolbox might crash when called after
// initializing GL, see crbug.com/1047643 and crbug.com/871280. On other
// operating systems like Windows and Android the pre-sandbox steps have
// always been executed before initializing GL so keep it this way.
sandbox_helper_->PreSandboxStartup();
#endif
// Start the GPU watchdog only after anything that is expected to be time
......@@ -313,6 +319,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line,
}
}
#if defined(OS_LINUX)
// The ContentSandboxHelper is currently the only one implementation of
// gpu::GpuSandboxHelper and it has no dependency. Except on Linux where
// VaapiWrapper checks the GL implementation to determine which display
......@@ -329,6 +336,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line,
if (watchdog_thread_)
watchdog_thread_->ResumeWatchdog();
}
#endif
bool gl_disabled = gl::GetGLImplementation() == gl::kGLImplementationDisabled;
......
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