Commit 71ecadd3 authored by Maggie Chen's avatar Maggie Chen Committed by Commit Bot

Return false when CreateSwapChainForComposition fails

If CreateSwapChainForComposition fails, return false after disabling
Direct Composition support. Let the Renderer handle it. Either the
GPU command buffer or the GPU process will be restarted by the Renderer.
This is the same way we handle the overlay swap chain creation failure.

Bug:1074582

Change-Id: I631e6f38581c2da9124c15bdf5b697ea049b9f7d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2226076Reviewed-by: default avatarZhenyao Mo <zmo@chromium.org>
Commit-Queue: Maggie Chen <magchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#774520}
parent 870810e0
......@@ -322,19 +322,17 @@ bool DirectCompositionChildSurfaceWin::SetDrawRectangle(
base::UmaHistogramSparse(
"GPU.DirectComposition.CreateSwapChainForComposition", hr);
// TODO (magchen@): Return fail after disabling DC support so we can restart
// a new GPU command buffer with DC disabled.
// If CreateSwapChainForComposition fails, we cannot draw to the
// browser window. Return false after disabling Direct Composition support
// and let the Renderer handle it. Either the GPU command buffer or the GPU
// process will be restarted.
if (FAILED(hr)) {
DLOG(ERROR) << "CreateSwapChainForComposition failed with error "
<< std::hex << hr;
g_direct_composition_swap_chain_failed = true;
return false;
}
// If CreateSwapChainForComposition fails, we cannot draw to the
// browser window. Failure here is indicative of an unrecoverable driver
// bug.
CHECK(SUCCEEDED(hr));
Microsoft::WRL::ComPtr<IDXGISwapChain3> swap_chain;
if (SUCCEEDED(swap_chain_.As(&swap_chain))) {
hr = swap_chain->SetColorSpace1(
......
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