Bug 1688144 - Add more error logs to WebRenderBridgeParent::UpdateResources() r=nical,aosmond
authorsotaro <sotaro.ikeda.g@gmail.com>
Fri, 22 Jan 2021 12:42:28 +0000
changeset 564584 4ca34406a2a41497d0252f39ea98442291f84875
parent 564583 386af39381f3950a3aed13600a9f67a9b28d1c0a
child 564585 35dfcecc73e3d48eb91f3e5e6608064a8abfaf2d
push id134933
push usersikeda.birchill@mozilla.com
push dateTue, 26 Jan 2021 00:18:37 +0000
treeherderautoland@4ca34406a2a4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical, aosmond
bugs1688144
milestone87.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 1688144 - Add more error logs to WebRenderBridgeParent::UpdateResources() r=nical,aosmond It seems better to add more error logs to WebRenderBridgeParent::UpdateResources(). Differential Revision: https://phabricator.services.mozilla.com/D102691
gfx/layers/wr/WebRenderBridgeParent.cpp
gfx/layers/wr/WebRenderBridgeParent.h
--- a/gfx/layers/wr/WebRenderBridgeParent.cpp
+++ b/gfx/layers/wr/WebRenderBridgeParent.cpp
@@ -495,119 +495,124 @@ bool WebRenderBridgeParent::UpdateResour
   UniquePtr<ScheduleSharedSurfaceRelease> scheduleRelease;
 
   for (const auto& cmd : aResourceUpdates) {
     switch (cmd.type()) {
       case OpUpdateResource::TOpAddImage: {
         const auto& op = cmd.get_OpAddImage();
         wr::Vec<uint8_t> bytes;
         if (!reader.Read(op.bytes(), bytes)) {
+          gfxCriticalNote << "TOpAddImage failed";
           return false;
         }
         aUpdates.AddImage(op.key(), op.descriptor(), bytes);
         break;
       }
       case OpUpdateResource::TOpUpdateImage: {
         const auto& op = cmd.get_OpUpdateImage();
         wr::Vec<uint8_t> bytes;
         if (!reader.Read(op.bytes(), bytes)) {
+          gfxCriticalNote << "TOpUpdateImage failed";
           return false;
         }
         aUpdates.UpdateImageBuffer(op.key(), op.descriptor(), bytes);
         break;
       }
       case OpUpdateResource::TOpAddBlobImage: {
         const auto& op = cmd.get_OpAddBlobImage();
         wr::Vec<uint8_t> bytes;
         if (!reader.Read(op.bytes(), bytes)) {
+          gfxCriticalNote << "TOpAddBlobImage failed";
           return false;
         }
         aUpdates.AddBlobImage(op.key(), op.descriptor(), bytes,
                               wr::ToDeviceIntRect(op.visibleRect()));
         break;
       }
       case OpUpdateResource::TOpUpdateBlobImage: {
         const auto& op = cmd.get_OpUpdateBlobImage();
         wr::Vec<uint8_t> bytes;
         if (!reader.Read(op.bytes(), bytes)) {
+          gfxCriticalNote << "TOpUpdateBlobImage failed";
           return false;
         }
         aUpdates.UpdateBlobImage(op.key(), op.descriptor(), bytes,
                                  wr::ToDeviceIntRect(op.visibleRect()),
                                  wr::ToLayoutIntRect(op.dirtyRect()));
         break;
       }
       case OpUpdateResource::TOpSetBlobImageVisibleArea: {
         const auto& op = cmd.get_OpSetBlobImageVisibleArea();
         aUpdates.SetBlobImageVisibleArea(op.key(),
                                          wr::ToDeviceIntRect(op.area()));
         break;
       }
       case OpUpdateResource::TOpAddPrivateExternalImage: {
         const auto& op = cmd.get_OpAddPrivateExternalImage();
-        if (!AddPrivateExternalImage(op.externalImageId(), op.key(),
-                                     op.descriptor(), aUpdates)) {
-          return false;
-        }
+        AddPrivateExternalImage(op.externalImageId(), op.key(), op.descriptor(),
+                                aUpdates);
         break;
       }
       case OpUpdateResource::TOpAddSharedExternalImage: {
         const auto& op = cmd.get_OpAddSharedExternalImage();
+        // gfxCriticalNote is called on error
         if (!AddSharedExternalImage(op.externalImageId(), op.key(), aUpdates)) {
           return false;
         }
         break;
       }
       case OpUpdateResource::TOpPushExternalImageForTexture: {
         const auto& op = cmd.get_OpPushExternalImageForTexture();
         CompositableTextureHostRef texture;
         texture = TextureHost::AsTextureHost(op.textureParent());
+        // gfxCriticalNote is called on error
         if (!PushExternalImageForTexture(op.externalImageId(), op.key(),
                                          texture, op.isUpdate(), aUpdates)) {
           return false;
         }
         break;
       }
       case OpUpdateResource::TOpUpdatePrivateExternalImage: {
         const auto& op = cmd.get_OpUpdatePrivateExternalImage();
-        if (!UpdatePrivateExternalImage(op.externalImageId(), op.key(),
-                                        op.descriptor(), op.dirtyRect(),
-                                        aUpdates)) {
-          return false;
-        }
+        UpdatePrivateExternalImage(op.externalImageId(), op.key(),
+                                   op.descriptor(), op.dirtyRect(), aUpdates);
         break;
       }
       case OpUpdateResource::TOpUpdateSharedExternalImage: {
         const auto& op = cmd.get_OpUpdateSharedExternalImage();
+        // gfxCriticalNote is called on error
         if (!UpdateSharedExternalImage(op.externalImageId(), op.key(),
                                        op.dirtyRect(), aUpdates,
                                        scheduleRelease)) {
           return false;
         }
         break;
       }
       case OpUpdateResource::TOpAddRawFont: {
         if (!ReadRawFont(cmd.get_OpAddRawFont(), reader, aUpdates)) {
+          gfxCriticalNote << "TOpAddRawFont failed";
           return false;
         }
         break;
       }
       case OpUpdateResource::TOpAddFontDescriptor: {
         const auto& op = cmd.get_OpAddFontDescriptor();
         wr::Vec<uint8_t> bytes;
         if (!reader.Read(op.bytes(), bytes)) {
+          gfxCriticalNote << "TOpAddFontDescriptor failed";
           return false;
         }
         aUpdates.AddFontDescriptor(op.key(), bytes, op.fontIndex());
         break;
       }
       case OpUpdateResource::TOpAddFontInstance: {
         const auto& op = cmd.get_OpAddFontInstance();
         wr::Vec<uint8_t> variations;
         if (!reader.Read(op.variations(), variations)) {
+          gfxCriticalNote << "TOpAddFontInstance failed";
           return false;
         }
         aUpdates.AddFontInstance(op.instanceKey(), op.fontKey(), op.glyphSize(),
                                  op.options().ptrOr(nullptr),
                                  op.platformOptions().ptrOr(nullptr),
                                  variations);
         break;
       }
@@ -642,46 +647,42 @@ bool WebRenderBridgeParent::UpdateResour
     wr::Checkpoint when = mApi->GetBackendType() == WebRenderBackend::SOFTWARE
                               ? wr::Checkpoint::FrameRendered
                               : wr::Checkpoint::FrameTexturesUpdated;
     aUpdates.Notify(when, std::move(scheduleRelease));
   }
   return true;
 }
 
-bool WebRenderBridgeParent::AddPrivateExternalImage(
+void WebRenderBridgeParent::AddPrivateExternalImage(
     wr::ExternalImageId aExtId, wr::ImageKey aKey, wr::ImageDescriptor aDesc,
     wr::TransactionBuilder& aResources) {
   Range<wr::ImageKey> keys(&aKey, 1);
   // Check if key is obsoleted.
   if (keys[0].mNamespace != mIdNamespace) {
-    return true;
+    return;
   }
 
   aResources.AddExternalImage(aKey, aDesc, aExtId,
                               wr::ExternalImageType::Buffer(), 0);
-
-  return true;
 }
 
-bool WebRenderBridgeParent::UpdatePrivateExternalImage(
+void WebRenderBridgeParent::UpdatePrivateExternalImage(
     wr::ExternalImageId aExtId, wr::ImageKey aKey,
     const wr::ImageDescriptor& aDesc, const ImageIntRect& aDirtyRect,
     wr::TransactionBuilder& aResources) {
   Range<wr::ImageKey> keys(&aKey, 1);
   // Check if key is obsoleted.
   if (keys[0].mNamespace != mIdNamespace) {
-    return true;
+    return;
   }
 
   aResources.UpdateExternalImageWithDirtyRect(
       aKey, aDesc, aExtId, wr::ExternalImageType::Buffer(),
       wr::ToDeviceIntRect(aDirtyRect), 0);
-
-  return true;
 }
 
 bool WebRenderBridgeParent::AddSharedExternalImage(
     wr::ExternalImageId aExtId, wr::ImageKey aKey,
     wr::TransactionBuilder& aResources) {
   Range<wr::ImageKey> keys(&aKey, 1);
   // Check if key is obsoleted.
   if (keys[0].mNamespace != mIdNamespace) {
--- a/gfx/layers/wr/WebRenderBridgeParent.h
+++ b/gfx/layers/wr/WebRenderBridgeParent.h
@@ -325,20 +325,20 @@ class WebRenderBridgeParent final : publ
                            WebRenderScrollData&& aData);
   void UpdateAPZScrollOffsets(ScrollUpdatesMap&& aUpdates,
                               uint32_t aPaintSequenceNumber);
 
   bool UpdateResources(const nsTArray<OpUpdateResource>& aResourceUpdates,
                        const nsTArray<RefCountedShmem>& aSmallShmems,
                        const nsTArray<ipc::Shmem>& aLargeShmems,
                        wr::TransactionBuilder& aUpdates);
-  bool AddPrivateExternalImage(wr::ExternalImageId aExtId, wr::ImageKey aKey,
+  void AddPrivateExternalImage(wr::ExternalImageId aExtId, wr::ImageKey aKey,
                                wr::ImageDescriptor aDesc,
                                wr::TransactionBuilder& aResources);
-  bool UpdatePrivateExternalImage(wr::ExternalImageId aExtId, wr::ImageKey aKey,
+  void UpdatePrivateExternalImage(wr::ExternalImageId aExtId, wr::ImageKey aKey,
                                   const wr::ImageDescriptor& aDesc,
                                   const ImageIntRect& aDirtyRect,
                                   wr::TransactionBuilder& aResources);
   bool AddSharedExternalImage(wr::ExternalImageId aExtId, wr::ImageKey aKey,
                               wr::TransactionBuilder& aResources);
   bool UpdateSharedExternalImage(
       wr::ExternalImageId aExtId, wr::ImageKey aKey,
       const ImageIntRect& aDirtyRect, wr::TransactionBuilder& aResources,