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

Unified Diff: Source/platform/fonts/GlyphBuffer.h

Issue 348553003: Simplify GlyphBuffer::reverse. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 | « Source/platform/fonts/Font.cpp ('k') | Source/platform/fonts/mac/FontComplexTextMac.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/GlyphBuffer.h
diff --git a/Source/platform/fonts/GlyphBuffer.h b/Source/platform/fonts/GlyphBuffer.h
index 5e33a10d516ffb8e4c74dfc41f4cb23eb5926ec3..358ca5e80bcd1a11113cd1ae23b26af710bfd81e 100644
--- a/Source/platform/fonts/GlyphBuffer.h
+++ b/Source/platform/fonts/GlyphBuffer.h
@@ -79,10 +79,11 @@ public:
m_advances.append(advance);
}
- void reverse(unsigned from, unsigned length)
+ void reverse()
{
- for (unsigned i = from, end = from + length - 1; i < end; ++i, --end)
- swap(i, end);
+ m_fontData.reverse();
+ m_glyphs.reverse();
+ m_advances.reverse();
}
void expandLastAdvance(float width)
@@ -93,21 +94,6 @@ public:
}
private:
- void swap(unsigned index1, unsigned index2)
- {
- const SimpleFontData* f = m_fontData[index1];
- m_fontData[index1] = m_fontData[index2];
- m_fontData[index2] = f;
-
- Glyph g = m_glyphs[index1];
- m_glyphs[index1] = m_glyphs[index2];
- m_glyphs[index2] = g;
-
- FloatSize s = m_advances[index1];
- m_advances[index1] = m_advances[index2];
- m_advances[index2] = s;
- }
-
Vector<const SimpleFontData*, 2048> m_fontData;
Vector<Glyph, 2048> m_glyphs;
Vector<FloatSize, 2048> m_advances;
« no previous file with comments | « Source/platform/fonts/Font.cpp ('k') | Source/platform/fonts/mac/FontComplexTextMac.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698