зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1281680 - Add telemetry for image optimizations that may no longer be useful. r=edwin
This commit is contained in:
Родитель
c92db2d7ab
Коммит
5bb4252ff6
|
@ -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",
|
||||
|
|
Загрузка…
Ссылка в новой задаче