Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Unified Diff: third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.cpp

Issue 2088183002: Add UMA for hb_face_t instantiation type (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.cpp
diff --git a/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.cpp b/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.cpp
index 0dbb0a8b4f1384cfed17ba02bd14150f651fc3e9..06bd57d7a5814664342a06fb080c5a5832b8a8b7 100644
--- a/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.cpp
+++ b/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.cpp
@@ -30,6 +30,7 @@
#include "platform/fonts/shaping/HarfBuzzFace.h"
+#include "platform/Histogram.h"
#include "platform/fonts/FontCache.h"
#include "platform/fonts/FontPlatformData.h"
#include "platform/fonts/SimpleFontData.h"
@@ -56,6 +57,12 @@
namespace blink {
+enum HarfBuzzFaceInstantiationTypeUMA {
Mark P 2016/06/27 21:28:41 Please put the standard warning here that these va
drott 2016/06/28 07:38:47 I was initially considering reporting the differen
+ HarfBuzzFaceInstantiationTypeInplace = 0,
+ HarfBuzzFaceInstantiationTypeTableCopy,
+ MaxHarfBuzzFaceInstantiationType
+};
+
struct HbFontDeleter {
void operator()(hb_font_t* font)
{
@@ -327,6 +334,9 @@ hb_face_t* HarfBuzzFace::createFace()
#else
hb_face_t* face = nullptr;
+ DEFINE_STATIC_LOCAL(EnumerationHistogram,
+ faceInstantiationHistogram,
+ ("Blink.Fonts.HarfBuzzFaceInstantiationType", MaxHarfBuzzFaceInstantiationType));
SkTypeface* typeface = m_platformData->typeface();
int ttcIndex = 0;
SkStreamAsset* typefaceStream = typeface->openStream(&ttcIndex);
@@ -342,8 +352,12 @@ hb_face_t* HarfBuzzFace::createFace()
}
// Fallback to table copies if there is no in-memory access.
- if (!face)
+ if (!face) {
face = hb_face_create_for_tables(harfBuzzSkiaGetTable, m_platformData->typeface(), 0);
+ faceInstantiationHistogram.count(HarfBuzzFaceInstantiationTypeTableCopy);
+ } else {
+ faceInstantiationHistogram.count(HarfBuzzFaceInstantiationTypeInplace);
+ }
#endif
ASSERT(face);
return face;
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698