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..b9d17694124d388799e1bcbdac9319757b23d283 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)) { |
|
eae
2017/02/27 23:24:59
Please don't use auto here and instead specify the
f(malita)
2017/02/28 03:27:47
Now that we return a struct and access named field
eae
2017/02/28 03:31:19
Agreed, with a struct the use of auto is perfectly
|
| + const auto* simpleFontData = std::get<0>(runFontData); |
| 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)); |
| } |
| } |
| } |