- Revision
- 205771
- Author
- mmaxfi...@apple.com
- Date
- 2016-09-09 14:54:31 -0700 (Fri, 09 Sep 2016)
Log Message
Remove unused member of GlyphBuffer
https://bugs.webkit.org/show_bug.cgi?id=161814
Reviewed by Simon Fraser.
This m_offsets member never actually affected anything. It just made
FontCascade::drawGlyphBuffer() slower.
No new tests because there is no behavior change.
* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::drawGlyphBuffer):
* platform/graphics/GlyphBuffer.h:
(WebCore::GlyphBuffer::clear):
(WebCore::GlyphBuffer::advanceAt):
(WebCore::GlyphBuffer::add):
(WebCore::GlyphBuffer::shrink):
(WebCore::GlyphBuffer::swap):
(WebCore::GlyphBuffer::offsetAt): Deleted.
* platform/graphics/win/UniscribeController.cpp:
(WebCore::UniscribeController::shapeAndPlaceItem):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (205770 => 205771)
--- trunk/Source/WebCore/ChangeLog 2016-09-09 21:44:55 UTC (rev 205770)
+++ trunk/Source/WebCore/ChangeLog 2016-09-09 21:54:31 UTC (rev 205771)
@@ -1,3 +1,27 @@
+2016-09-09 Myles C. Maxfield <mmaxfi...@apple.com>
+
+ Remove unused member of GlyphBuffer
+ https://bugs.webkit.org/show_bug.cgi?id=161814
+
+ Reviewed by Simon Fraser.
+
+ This m_offsets member never actually affected anything. It just made
+ FontCascade::drawGlyphBuffer() slower.
+
+ No new tests because there is no behavior change.
+
+ * platform/graphics/FontCascade.cpp:
+ (WebCore::FontCascade::drawGlyphBuffer):
+ * platform/graphics/GlyphBuffer.h:
+ (WebCore::GlyphBuffer::clear):
+ (WebCore::GlyphBuffer::advanceAt):
+ (WebCore::GlyphBuffer::add):
+ (WebCore::GlyphBuffer::shrink):
+ (WebCore::GlyphBuffer::swap):
+ (WebCore::GlyphBuffer::offsetAt): Deleted.
+ * platform/graphics/win/UniscribeController.cpp:
+ (WebCore::UniscribeController::shapeAndPlaceItem):
+
2016-09-09 Tim Horton <timothy_hor...@apple.com>
Text replacement candidates don't always overwrite the entire original string
Modified: trunk/Source/WebCore/platform/graphics/FontCascade.cpp (205770 => 205771)
--- trunk/Source/WebCore/platform/graphics/FontCascade.cpp 2016-09-09 21:44:55 UTC (rev 205770)
+++ trunk/Source/WebCore/platform/graphics/FontCascade.cpp 2016-09-09 21:54:31 UTC (rev 205771)
@@ -1284,7 +1284,6 @@
{
// Draw each contiguous run of glyphs that use the same font data.
const Font* fontData = glyphBuffer.fontAt(0);
- FloatSize offset = glyphBuffer.offsetAt(0);
FloatPoint startPoint(point.x(), point.y() - glyphBuffer.initialAdvance().height());
float nextX = startPoint.x() + glyphBuffer.advanceAt(0).width();
float nextY = startPoint.y() + glyphBuffer.advanceAt(0).height();
@@ -1292,14 +1291,12 @@
unsigned nextGlyph = 1;
while (nextGlyph < glyphBuffer.size()) {
const Font* nextFontData = glyphBuffer.fontAt(nextGlyph);
- FloatSize nextOffset = glyphBuffer.offsetAt(nextGlyph);
- if (nextFontData != fontData || nextOffset != offset) {
+ if (nextFontData != fontData) {
context.drawGlyphs(*this, *fontData, glyphBuffer, lastFrom, nextGlyph - lastFrom, startPoint);
lastFrom = nextGlyph;
fontData = nextFontData;
- offset = nextOffset;
startPoint.setX(nextX);
startPoint.setY(nextY);
}
Modified: trunk/Source/WebCore/platform/graphics/GlyphBuffer.h (205770 => 205771)
--- trunk/Source/WebCore/platform/graphics/GlyphBuffer.h 2016-09-09 21:44:55 UTC (rev 205770)
+++ trunk/Source/WebCore/platform/graphics/GlyphBuffer.h 2016-09-09 21:54:31 UTC (rev 205771)
@@ -87,9 +87,6 @@
m_advances.clear();
if (m_offsetsInString)
m_offsetsInString->clear();
-#if PLATFORM(WIN)
- m_offsets.clear();
-#endif
}
GlyphBufferGlyph* glyphs(unsigned from) { return m_glyphs.data() + from; }
@@ -118,19 +115,9 @@
{
return m_advances[index];
}
-
- FloatSize offsetAt(unsigned index) const
- {
-#if PLATFORM(WIN)
- return m_offsets[index];
-#else
- UNUSED_PARAM(index);
- return FloatSize();
-#endif
- }
static const unsigned noOffset = UINT_MAX;
- void add(Glyph glyph, const Font* font, float width, unsigned offsetInString = noOffset, const FloatSize* offset = 0)
+ void add(Glyph glyph, const Font* font, float width, unsigned offsetInString = noOffset)
{
m_font.append(font);
@@ -148,15 +135,6 @@
#else
m_advances.append(FloatSize(width, 0));
#endif
-
-#if PLATFORM(WIN)
- if (offset)
- m_offsets.append(*offset);
- else
- m_offsets.append(FloatSize());
-#else
- UNUSED_PARAM(offset);
-#endif
if (offsetInString != noOffset && m_offsetsInString)
m_offsetsInString->append(offsetInString);
@@ -212,9 +190,6 @@
m_advances.shrink(truncationPoint);
if (m_offsetsInString)
m_offsetsInString->shrink(truncationPoint);
-#if PLATFORM(WIN)
- m_offsets.shrink(truncationPoint);
-#endif
}
private:
@@ -231,12 +206,6 @@
GlyphBufferAdvance s = m_advances[index1];
m_advances[index1] = m_advances[index2];
m_advances[index2] = s;
-
-#if PLATFORM(WIN)
- FloatSize offset = m_offsets[index1];
- m_offsets[index1] = m_offsets[index2];
- m_offsets[index2] = offset;
-#endif
}
Vector<const Font*, 2048> m_font;
@@ -244,9 +213,6 @@
Vector<GlyphBufferAdvance, 2048> m_advances;
GlyphBufferAdvance m_initialAdvance;
std::unique_ptr<Vector<unsigned, 2048>> m_offsetsInString;
-#if PLATFORM(WIN)
- Vector<FloatSize, 2048> m_offsets;
-#endif
float m_leadingExpansion;
};
Modified: trunk/Source/WebCore/platform/graphics/win/UniscribeController.cpp (205770 => 205771)
--- trunk/Source/WebCore/platform/graphics/win/UniscribeController.cpp 2016-09-09 21:44:55 UTC (rev 205770)
+++ trunk/Source/WebCore/platform/graphics/win/UniscribeController.cpp 2016-09-09 21:54:31 UTC (rev 205771)
@@ -365,7 +365,7 @@
// translation.
if (glyphBuffer) {
FloatSize size(offsetX, -offsetY);
- glyphBuffer->add(glyph, fontData, advance, GlyphBuffer::noOffset, &size);
+ glyphBuffer->add(glyph, fontData, advance, GlyphBuffer::noOffset);
}
FloatRect glyphBounds = fontData->boundsForGlyph(glyph);