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

Unified Diff: Source/platform/fonts/shaping/HarfBuzzShaper.cpp

Issue 1108663003: Always initialize |m_totalWidth| in HarfBuzzShaper::shape. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Initialize in ctor Created 5 years, 8 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 | « LayoutTests/fast/text/shaping/shaping-width-initialized-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/shaping/HarfBuzzShaper.cpp
diff --git a/Source/platform/fonts/shaping/HarfBuzzShaper.cpp b/Source/platform/fonts/shaping/HarfBuzzShaper.cpp
index 5a8d259d135af7f7dc8974cb8232cf9c2d9bbded..eec3af9436aa107a6c25c393621f8498b3cc246b 100644
--- a/Source/platform/fonts/shaping/HarfBuzzShaper.cpp
+++ b/Source/platform/fonts/shaping/HarfBuzzShaper.cpp
@@ -385,6 +385,7 @@ HarfBuzzShaper::HarfBuzzShaper(const Font* font, const TextRun& run, const Glyph
, m_expansionOpportunityCount(0)
, m_fromIndex(0)
, m_toIndex(m_run.length())
+ , m_totalWidth(0)
{
m_normalizedBuffer = adoptArrayPtr(new UChar[m_run.length() + 1]);
normalizeCharacters(m_run, m_run.length(), m_normalizedBuffer.get(), &m_normalizedBufferLength);
@@ -538,10 +539,10 @@ void HarfBuzzShaper::setFontFeatures()
bool HarfBuzzShaper::shape(GlyphBuffer* glyphBuffer)
{
+ m_totalWidth = 0;
leviw_travelin_and_unemployed 2015/04/27 18:19:35 This should be redundant now that it's in the c'to
if (!createHarfBuzzRuns())
return false;
- m_totalWidth = 0;
if (!shapeHarfBuzzRuns())
return false;
« no previous file with comments | « LayoutTests/fast/text/shaping/shaping-width-initialized-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698