Disable overlay support when the overlay swap chain creation fails.

The current way to handle the overlay swap chain creation failure might cause
a complet black browser window, which is a very bad user experience. If we
disable overlay when the creation fails, the video playback will be able to
continue through GL composition if there is no other issue.

Bug: 954661
Change-Id: I5f1355f9ff46d7c9a88a1ff0ccad4ed229710eb5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1576034
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Commit-Queue: Maggie Chen <magchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#652733}
diff --git a/gpu/ipc/service/direct_composition_surface_win.cc b/gpu/ipc/service/direct_composition_surface_win.cc
index 265f5a45..e867e82 100644
--- a/gpu/ipc/service/direct_composition_surface_win.cc
+++ b/gpu/ipc/service/direct_composition_surface_win.cc
@@ -1688,9 +1688,12 @@
                              hr);
 
     if (FAILED(hr)) {
+      // Disable overlay support so dc_layer_overlay will stop sending down
+      // overlay frames here and uses GL Composition instead.
+      g_supports_overlays = false;
       DLOG(ERROR) << "Failed to create BGRA swap chain of size "
                   << swap_chain_size.ToString() << " with error 0x" << std::hex
-                  << hr;
+                  << hr << ". Disable overlay swap chains";
       return false;
     }
   }