Chromium Code Reviews| 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..9c4ea4dba8c21bcc7ddc99d736f1d2a4fe881d13 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.getRunFontData(run)) { |
| + const auto simpleFontData = std::get<0>(runFontData); |
|
jbroman
2017/02/27 22:00:57
drive-by: please use "const auto*" (it's nicer to
f(malita)
2017/02/27 22:10:04
Indeed, I try to stick to that rule too but this o
|
| 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), |
| + std::get<1>(runFontData)); |
| } |
| } |
| } |