Bug 1311779 - Part 2. Add telemetry to track optimizable opaque images decoded into B8G8R8A8 surfaces. r=tnikkel
authorAndrew Osmond <aosmond@mozilla.com>
Wed, 19 Oct 2016 12:34:30 -0400
changeset 432250 36b7546597dc6e91acbfbfd5a6e4afc98f67626f
parent 432249 1cea19368e064be9d63ccd98a0d579416dfc9717
child 432251 6a381d07b7f1570fd1f9d9980aef58d1cf5b4785
push id34240
push userbmo:ttromey@mozilla.com
push dateTue, 01 Nov 2016 14:41:32 +0000
reviewerstnikkel
bugs1311779
milestone52.0a1
Bug 1311779 - Part 2. Add telemetry to track optimizable opaque images decoded into B8G8R8A8 surfaces. r=tnikkel
image/imgFrame.cpp
toolkit/components/telemetry/Histograms.json
--- a/image/imgFrame.cpp
+++ b/image/imgFrame.cpp
@@ -17,16 +17,17 @@
 #include "gfxAlphaRecovery.h"
 
 #include "GeckoProfiler.h"
 #include "MainThreadUtils.h"
 #include "mozilla/CheckedInt.h"
 #include "mozilla/gfx/Tools.h"
 #include "mozilla/Likely.h"
 #include "mozilla/MemoryReporting.h"
+#include "mozilla/Telemetry.h"
 #include "nsMargin.h"
 #include "nsThreadUtils.h"
 
 
 namespace mozilla {
 
 using namespace gfx;
 
@@ -614,16 +615,18 @@ imgFrame::Finish(Opacity aFrameOpacity /
                  BlendMethod aBlendMethod /* = BlendMethod::OVER */,
                  const Maybe<IntRect>& aBlendRect /* = Nothing() */)
 {
   MonitorAutoLock lock(mMonitor);
   MOZ_ASSERT(mLockCount > 0, "Image data should be locked");
 
   if (aFrameOpacity == Opacity::FULLY_OPAQUE) {
     mHasNoAlpha = true;
+    Telemetry::Accumulate(Telemetry::IMAGE_DECODE_OPAQUE_BGRA,
+                          mFormat == SurfaceFormat::B8G8R8A8);
   }
 
   mDisposalMethod = aDisposalMethod;
   mTimeout = aTimeout;
   mBlendMethod = aBlendMethod;
   mBlendRect = aBlendRect;
   ImageUpdatedInternal(GetRect());
   mFinished = true;
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -1327,16 +1327,23 @@
   },
   "IMAGE_DECODE_COUNT": {
     "expires_in_version": "never",
     "kind": "exponential",
     "high": 500,
     "n_buckets": 50,
     "description": "Decode count"
   },
+  "IMAGE_DECODE_OPAQUE_BGRA": {
+    "alert_emails": ["aosmond@mozilla.com"],
+    "expires_in_version": "53",
+    "kind": "boolean",
+    "description": "Opaque images are BGRA",
+    "bug_numbers": [1311779]
+  },
   "IMAGE_DECODE_SPEED_JPEG": {
     "expires_in_version": "never",
     "kind": "exponential",
     "low": 500,
     "high": 50000000,
     "n_buckets": 50,
     "description": "JPEG image decode speed (Kbytes/sec)"
   },