Index: Source/platform/fonts/harfbuzz/FontHarfBuzz.cpp |
diff --git a/Source/platform/fonts/harfbuzz/FontHarfBuzz.cpp b/Source/platform/fonts/harfbuzz/FontHarfBuzz.cpp |
index 2af3aba2ec31e3eb2dd68cda77a4d08ebc791535..e0c466650f17d1b4b2a1bec8214f5f0a16527d8f 100644 |
--- a/Source/platform/fonts/harfbuzz/FontHarfBuzz.cpp |
+++ b/Source/platform/fonts/harfbuzz/FontHarfBuzz.cpp |
@@ -57,7 +57,7 @@ bool FontPlatformFeatures::canExpandAroundIdeographsInComplexText() |
} |
static void paintGlyphs(GraphicsContext* gc, const SimpleFontData* font, |
- const GlyphBufferGlyph* glyphs, unsigned numGlyphs, |
+ const Glyph* glyphs, unsigned numGlyphs, |
SkPoint* pos, const FloatRect& textRect) |
{ |
TextDrawingModeFlags textMode = gc->textDrawingMode(); |
@@ -69,7 +69,7 @@ static void paintGlyphs(GraphicsContext* gc, const SimpleFontData* font, |
gc->adjustTextRenderMode(&paint); |
paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding); |
- gc->drawPosText(glyphs, numGlyphs << 1, pos, textRect, paint); |
+ gc->drawPosText(glyphs, numGlyphs * sizeof(Glyph), pos, textRect, paint); |
} |
if ((textMode & TextModeStroke) |
@@ -94,7 +94,7 @@ static void paintGlyphs(GraphicsContext* gc, const SimpleFontData* font, |
paint.setLooper(0); |
} |
- gc->drawPosText(glyphs, numGlyphs << 1, pos, textRect, paint); |
+ gc->drawPosText(glyphs, numGlyphs * sizeof(Glyph), pos, textRect, paint); |
} |
} |
@@ -102,8 +102,6 @@ void Font::drawGlyphs(GraphicsContext* gc, const SimpleFontData* font, |
const GlyphBuffer& glyphBuffer, unsigned from, unsigned numGlyphs, |
const FloatPoint& point, const FloatRect& textRect) const |
{ |
- SkASSERT(sizeof(GlyphBufferGlyph) == sizeof(uint16_t)); // compile-time assert |
- |
SkScalar x = SkFloatToScalar(point.x()); |
SkScalar y = SkFloatToScalar(point.y()); |
@@ -127,7 +125,7 @@ void Font::drawGlyphs(GraphicsContext* gc, const SimpleFontData* font, |
while (glyphIndex < numGlyphs) { |
unsigned chunkLength = std::min(kMaxBufferLength, numGlyphs - glyphIndex); |
- const GlyphBufferGlyph* glyphs = glyphBuffer.glyphs(from + glyphIndex); |
+ const Glyph* glyphs = glyphBuffer.glyphs(from + glyphIndex); |
translations.resize(chunkLength); |
verticalData->getVerticalTranslationsForGlyphs(font, &glyphs[0], chunkLength, reinterpret_cast<float*>(&translations[0])); |
@@ -162,7 +160,7 @@ void Font::drawGlyphs(GraphicsContext* gc, const SimpleFontData* font, |
y += SkFloatToScalar(adv[i].height()); |
} |
- const GlyphBufferGlyph* glyphs = glyphBuffer.glyphs(from); |
+ const Glyph* glyphs = glyphBuffer.glyphs(from); |
paintGlyphs(gc, font, glyphs, numGlyphs, pos, textRect); |
} |