Bug 1529795 - Record profiler markers when we drop video frames. r=mstange
authorMatt Woodrow <mwoodrow@mozilla.com>
Wed, 27 Feb 2019 17:35:05 +0000
changeset 519444 4b6ea94397b45153eccfddfac342d3076773975a
parent 519443 20fcf9d9494ac77d9c8166444e5fa8346ff13be1
child 519445 21c7deb32a777b484039c8f85d748b75a47f5b95
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1529795
milestone67.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 1529795 - Record profiler markers when we drop video frames. r=mstange Differential Revision: https://phabricator.services.mozilla.com/D20755
gfx/layers/composite/ImageComposite.cpp
gfx/layers/ipc/ImageBridgeParent.cpp
--- a/gfx/layers/composite/ImageComposite.cpp
+++ b/gfx/layers/composite/ImageComposite.cpp
@@ -107,16 +107,17 @@ int ImageComposite::ChooseImageIndex() {
          GetBiasedTime(mImages[result + 1].mTimeStamp) <= now) {
     ++result;
   }
   if (result - mLastChosenImageIndex > 1) {
     // We're not returning the same image as the last call to ChooseImageIndex
     // or the immediately next one. We can assume that the frames not returned
     // have been dropped as they were too late to be displayed
     mDroppedFrames += result - mLastChosenImageIndex - 1;
+    PROFILER_ADD_MARKER("Video frames dropped", GRAPHICS);
   }
   mLastChosenImageIndex = result;
   return result;
 }
 
 const ImageComposite::TimedImage* ImageComposite::ChooseImage() {
   int index = ChooseImageIndex();
   return index >= 0 ? &mImages[index] : nullptr;
@@ -177,16 +178,17 @@ uint32_t ImageComposite::ScanForLastFram
       }
       break;
     }
     i++;
     j++;
   }
   if (dropped > 0) {
     mDroppedFrames += dropped;
+    PROFILER_ADD_MARKER("Video frames dropped", GRAPHICS);
   }
   if (newIndex >= aNewImages.Length()) {
     // Somehow none of those images should be rendered (can this happen?)
     // We will always return the last one for now.
     newIndex = aNewImages.Length() - 1;
   }
   return newIndex;
 }
--- a/gfx/layers/ipc/ImageBridgeParent.cpp
+++ b/gfx/layers/ipc/ImageBridgeParent.cpp
@@ -165,16 +165,20 @@ class MOZ_STACK_CLASS AutoImageBridgePar
  private:
   ImageBridgeParent* mImageBridge;
   InfallibleTArray<OpDestroy>* mToDestroy;
 };
 
 mozilla::ipc::IPCResult ImageBridgeParent::RecvUpdate(
     EditArray&& aEdits, OpDestroyArray&& aToDestroy,
     const uint64_t& aFwdTransactionId) {
+
+  AUTO_PROFILER_TRACING("Paint", "ImageBridgeTransaction", GRAPHICS);
+  AUTO_PROFILER_LABEL("ImageBridgeParent::RecvUpdate", GRAPHICS);
+
   // This ensures that destroy operations are always processed. It is not safe
   // to early-return from RecvUpdate without doing so.
   AutoImageBridgeParentAsyncMessageSender autoAsyncMessageSender(this,
                                                                  &aToDestroy);
   UpdateFwdTransactionId(aFwdTransactionId);
 
   for (const auto& edit : aEdits) {
     RefPtr<CompositableHost> compositable =