Bug 1281680 - Add telemetry for image optimizations that may no longer be useful. r=edwin

This commit is contained in:
Seth Fowler 2016-06-24 23:22:29 -07:00
Родитель c92db2d7ab
Коммит 5bb4252ff6
2 изменённых файлов: 26 добавлений и 4 удалений

Просмотреть файл

@ -16,13 +16,14 @@
#include "gfxAlphaRecovery.h"
#include "GeckoProfiler.h"
#include "mozilla/Likely.h"
#include "MainThreadUtils.h"
#include "mozilla/MemoryReporting.h"
#include "nsMargin.h"
#include "nsThreadUtils.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 {
@ -397,12 +398,19 @@ imgFrame::Optimize()
// moment
}
const bool usedSingleColorOptimizationUsefully = mSinglePixel &&
mFrameRect.Area() > 1;
Telemetry::Accumulate(Telemetry::IMAGE_OPTIMIZE_TO_SINGLE_COLOR_USED,
usedSingleColorOptimizationUsefully);
#ifdef ANDROID
SurfaceFormat optFormat = gfxPlatform::GetPlatform()
->Optimal2DFormatForContent(gfxContentType::COLOR);
if (mFormat != SurfaceFormat::B8G8R8A8 &&
optFormat == SurfaceFormat::R5G6B5_UINT16) {
Telemetry::Accumulate(Telemetry::IMAGE_OPTIMIZE_TO_565_USED, true);
RefPtr<VolatileBuffer> buf =
AllocateBufferForImage(mFrameRect.Size(), optFormat);
if (!buf) {

Просмотреть файл

@ -1058,6 +1058,20 @@
"n_buckets": 50,
"description": "PNG image decode speed (Kbytes/sec)"
},
"IMAGE_OPTIMIZE_TO_SINGLE_COLOR_USED": {
"expires_in_version": "54",
"kind": "boolean",
"description": "Records true each time a decoded image is optimized to a single color.",
"alert_emails": ["seth@mozilla.com"],
"bug_numbers": [1281680]
},
"IMAGE_OPTIMIZE_TO_565_USED": {
"expires_in_version": "54",
"kind": "boolean",
"description": "Records true each time a decoded image is optimized to R5G6B5 format.",
"alert_emails": ["seth@mozilla.com"],
"bug_numbers": [1281680]
},
"CANVAS_2D_USED": {
"expires_in_version": "never",
"kind": "boolean",