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

Unified Diff: Source/platform/fonts/harfbuzz/FontHarfBuzz.cpp

Issue 325283002: Consolidate Glyph and GlyphBufferGlyph. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase 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/GlyphBuffer.h ('k') | Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « Source/platform/fonts/GlyphBuffer.h ('k') | Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698