Bug 1486619 - Handle empty regions when drawing in recording/replaying processes, r=nical.
authorBrian Hackett <bhackett1024@gmail.com>
Fri, 31 Aug 2018 05:36:12 -1000
changeset 434431 5830b5e072d00c8ece17d1f7ec92cc7ee3c64b57
parent 434430 d8447a4c32e7d4d991773f478f9dd2996628c51c
child 434432 dedd5c14209a8a120ad837784362c5c8539d8784
push id34557
push userdluca@mozilla.com
push dateSun, 02 Sep 2018 21:34:34 +0000
treeherdermozilla-central@634b562ae2c3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs1486619
milestone63.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 1486619 - Handle empty regions when drawing in recording/replaying processes, r=nical.
toolkit/recordreplay/ipc/ChildIPC.cpp
--- a/toolkit/recordreplay/ipc/ChildIPC.cpp
+++ b/toolkit/recordreplay/ipc/ChildIPC.cpp
@@ -404,16 +404,20 @@ static bool gPendingPaint;
 static void* gDrawTargetBuffer;
 static size_t gDrawTargetBufferSize;
 
 already_AddRefed<gfx::DrawTarget>
 DrawTargetForRemoteDrawing(LayoutDeviceIntSize aSize)
 {
   MOZ_RELEASE_ASSERT(!NS_IsMainThread());
 
+  if (aSize.IsEmpty()) {
+    return nullptr;
+  }
+
   gPaintMessage = Some(PaintMessage(aSize.width, aSize.height));
 
   gfx::IntSize size(aSize.width, aSize.height);
   size_t bufferSize = layers::ImageDataSerializer::ComputeRGBBufferSize(size, gSurfaceFormat);
   MOZ_RELEASE_ASSERT(bufferSize <= parent::GraphicsMemorySize);
 
   if (bufferSize != gDrawTargetBufferSize) {
     free(gDrawTargetBuffer);