Bug 1311779 - Part 2. Add telemetry to track optimizable opaque images decoded into B8G8R8A8 surfaces. r=tnikkel
--- 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)"
},