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

Side by Side Diff: Source/core/rendering/InlineTextBox.cpp

Issue 608083003: Don't populate GlyphBuffer in InlineTextBox::characterWidths (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * (C) 1999 Lars Knoll (knoll@kde.org) 2 * (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Dirk Mueller (mueller@kde.org) 3 * (C) 2000 Dirk Mueller (mueller@kde.org)
4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after
1230 1230
1231 void InlineTextBox::characterWidths(Vector<float>& widths) const 1231 void InlineTextBox::characterWidths(Vector<float>& widths) const
1232 { 1232 {
1233 FontCachePurgePreventer fontCachePurgePreventer; 1233 FontCachePurgePreventer fontCachePurgePreventer;
1234 1234
1235 RenderStyle* styleToUse = renderer().style(isFirstLineStyle()); 1235 RenderStyle* styleToUse = renderer().style(isFirstLineStyle());
1236 const Font& font = styleToUse->font(); 1236 const Font& font = styleToUse->font();
1237 1237
1238 TextRun textRun = constructTextRun(styleToUse, font); 1238 TextRun textRun = constructTextRun(styleToUse, font);
1239 1239
1240 GlyphBuffer glyphBuffer;
1241 SimpleShaper shaper(&font, textRun); 1240 SimpleShaper shaper(&font, textRun);
1242 float lastWidth = 0; 1241 float lastWidth = 0;
1243 widths.resize(m_len); 1242 widths.resize(m_len);
1244 for (unsigned i = 0; i < m_len; i++) { 1243 for (unsigned i = 0; i < m_len; i++) {
1245 shaper.advance(i + 1, &glyphBuffer); 1244 shaper.advance(i + 1);
1246 widths[i] = shaper.m_runWidthSoFar - lastWidth; 1245 widths[i] = shaper.m_runWidthSoFar - lastWidth;
1247 lastWidth = shaper.m_runWidthSoFar; 1246 lastWidth = shaper.m_runWidthSoFar;
1248 } 1247 }
1249 } 1248 }
1250 1249
1251 TextRun InlineTextBox::constructTextRun(RenderStyle* style, const Font& font, St ringBuilder* charactersWithHyphen) const 1250 TextRun InlineTextBox::constructTextRun(RenderStyle* style, const Font& font, St ringBuilder* charactersWithHyphen) const
1252 { 1251 {
1253 ASSERT(style); 1252 ASSERT(style);
1254 ASSERT(renderer().text()); 1253 ASSERT(renderer().text());
1255 1254
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
1315 printedCharacters = fprintf(stderr, "\t%s %p", obj.renderName(), &obj); 1314 printedCharacters = fprintf(stderr, "\t%s %p", obj.renderName(), &obj);
1316 const int rendererCharacterOffset = 24; 1315 const int rendererCharacterOffset = 24;
1317 for (; printedCharacters < rendererCharacterOffset; printedCharacters++) 1316 for (; printedCharacters < rendererCharacterOffset; printedCharacters++)
1318 fputc(' ', stderr); 1317 fputc(' ', stderr);
1319 fprintf(stderr, "(%d,%d) \"%s\"\n", start(), start() + len(), value.utf8().d ata()); 1318 fprintf(stderr, "(%d,%d) \"%s\"\n", start(), start() + len(), value.utf8().d ata());
1320 } 1319 }
1321 1320
1322 #endif 1321 #endif
1323 1322
1324 } // namespace blink 1323 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698