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

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

Issue 1379473005: Determine used fonts based on the correct font code path (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 5 years, 2 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 | « third_party/WebKit/LayoutTests/TestExpectations ('k') | 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 ae0346ac52cb820480b22e85061f3bb905b9bd67..ccabca73f8025629b7aead76fc05749f2ed7e002 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
@@ -69,6 +69,7 @@
#include "core/loader/DocumentLoader.h"
#include "core/page/Page.h"
#include "platform/fonts/Font.h"
+#include "platform/fonts/FontCache.h"
#include "platform/fonts/GlyphBuffer.h"
#include "platform/fonts/shaping/SimpleShaper.h"
#include "platform/text/TextRun.h"
@@ -817,14 +818,16 @@ void InspectorCSSAgent::collectPlatformFontsForLayoutObject(LayoutObject* layout
{
if (!layoutObject->isText())
return;
+
+ FontCachePurgePreventer preventer;
LayoutText* layoutText = toLayoutText(layoutObject);
for (InlineTextBox* box = layoutText->firstTextBox(); box; box = box->nextTextBox()) {
const ComputedStyle& style = layoutText->styleRef(box->isFirstLineStyle());
const Font& font = style.font();
TextRun run = box->constructTextRunForInspector(style, font);
- SimpleShaper shaper(&font, run);
+ TextRunPaintInfo paintInfo(run);
GlyphBuffer glyphBuffer;
- shaper.advance(run.length(), &glyphBuffer);
+ font.buildGlyphBuffer(paintInfo, glyphBuffer);
for (unsigned i = 0; i < glyphBuffer.size(); ++i) {
String familyName = glyphBuffer.fontDataAt(i)->platformData().fontFamilyName();
if (familyName.isNull())
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | third_party/WebKit/Source/platform/fonts/Font.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698