Bug 1611743 - Handle IDCompositionSurface::BeginDraw() error r=nical
authorsotaro <sotaro.ikeda.g@gmail.com>
Tue, 28 Jan 2020 15:22:23 +0000
changeset 512040 31e91b3d071e6b7a1453b8a89e2e60e60a7a6760
parent 512039 8d7f2651eed8d29a9ba7bf65094e4bc2061419ff
child 512041 b94005dcae8194883459523083392cee0f67e2a4
push id37066
push usershindli@mozilla.com
push dateWed, 29 Jan 2020 03:50:12 +0000
treeherdermozilla-central@31e91b3d071e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs1611743
milestone74.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1611743 - Handle IDCompositionSurface::BeginDraw() error r=nical Differential Revision: https://phabricator.services.mozilla.com/D61101
gfx/webrender_bindings/DCLayerTree.cpp
--- a/gfx/webrender_bindings/DCLayerTree.cpp
+++ b/gfx/webrender_bindings/DCLayerTree.cpp
@@ -5,16 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "DCLayerTree.h"
 
 #include "GLContext.h"
 #include "GLContextEGL.h"
 #include "mozilla/gfx/DeviceManagerDx.h"
 #include "mozilla/StaticPrefs_gfx.h"
+#include "mozilla/webrender/RenderThread.h"
 
 #undef _WIN32_WINNT
 #define _WIN32_WINNT _WIN32_WINNT_WINBLUE
 #undef NTDDI_VERSION
 #define NTDDI_VERSION NTDDI_WINBLUE
 
 #include <d3d11.h>
 #include <dcomp.h>
@@ -550,16 +551,17 @@ GLuint DCLayerTree::CreateEGLSurfaceForC
   update_rect.right = update_rect.left + aDirtyRect.size.width;
   update_rect.bottom = update_rect.top + aDirtyRect.size.height;
 
   hr = aCompositionSurface->BeginDraw(&update_rect, __uuidof(ID3D11Texture2D),
                                       (void**)getter_AddRefs(backBuf), &offset);
   if (FAILED(hr)) {
     gfxCriticalNote << "DCompositionSurface::BeginDraw failed: "
                     << gfx::hexa(hr);
+    RenderThread::Get()->HandleWebRenderError(WebRenderError::NEW_SURFACE);
     return false;
   }
 
   // DC includes the origin of the dirty / update rect in the draw offset,
   // undo that here since WR expects it to be an absolute offset.
   offset.x -= aDirtyRect.origin.x;
   offset.y -= aDirtyRect.origin.y;