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

Unified Diff: third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp

Issue 2718043003: Refactor InspectorCSSAgent to avoid an intermediate GlyphBuffer (Closed)
Patch Set: cleanup Created 3 years, 10 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 | third_party/WebKit/Source/platform/fonts/Font.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
index 53831b7384bdf227a9b69ce0e9906b72954510b3..eeec1a0ee119bb7a84418d230a56da78d6e4c868 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
@@ -84,7 +84,7 @@
#include "core/svg/SVGElement.h"
#include "platform/fonts/Font.h"
#include "platform/fonts/FontCache.h"
-#include "platform/fonts/GlyphBuffer.h"
+#include "platform/fonts/shaping/CachingWordShaper.h"
#include "platform/text/TextRun.h"
#include "wtf/CurrentTime.h"
#include "wtf/text/CString.h"
@@ -1136,16 +1136,15 @@ void InspectorCSSAgent::collectPlatformFontsForLayoutObject(
const ComputedStyle& style = layoutText->styleRef(box->isFirstLineStyle());
const Font& font = style.font();
TextRun run = box->constructTextRunForInspector(style);
- TextRunPaintInfo paintInfo(run);
- GlyphBuffer glyphBuffer;
- font.buildGlyphBuffer(paintInfo, glyphBuffer);
- for (unsigned i = 0; i < glyphBuffer.size(); ++i) {
- const SimpleFontData* simpleFontData = glyphBuffer.fontDataAt(i);
+ CachingWordShaper shaper(font);
+ for (const auto& runFontData : shaper.runFontData(run)) {
+ const auto* simpleFontData = runFontData.m_fontData;
String familyName = simpleFontData->platformData().fontFamilyName();
if (familyName.isNull())
familyName = "";
fontStats->add(
- std::make_pair(simpleFontData->isCustomFont() ? 1 : 0, familyName));
+ std::make_pair(simpleFontData->isCustomFont() ? 1 : 0, familyName),
+ runFontData.m_glyphCount);
}
}
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/fonts/Font.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698