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

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

Issue 860163004: Using FloatRect in SimpleShaper and remove GlyphBounds (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Comment fixes Created 5 years, 11 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/shaping/HarfBuzzShaper.h ('k') | Source/platform/fonts/shaping/SimpleShaper.h » ('j') | 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 dba7381e35fc88894dab22c4c1bcbb2616ff11df..ae371f2ddf861c0ac54819b6f2c595acb4d85287 100644
--- a/Source/platform/fonts/shaping/HarfBuzzShaper.cpp
+++ b/Source/platform/fonts/shaping/HarfBuzzShaper.cpp
@@ -370,7 +370,7 @@ static void normalizeCharacters(const TextRun& run, unsigned length, UChar* dest
}
}
-HarfBuzzShaper::HarfBuzzShaper(const Font* font, const TextRun& run, ForTextEmphasisOrNot forTextEmphasis, HashSet<const SimpleFontData*>* fallbackFonts)
+HarfBuzzShaper::HarfBuzzShaper(const Font* font, const TextRun& run, ForTextEmphasisOrNot forTextEmphasis, HashSet<const SimpleFontData*>* fallbackFonts, FloatRect* bounds)
: m_font(font)
, m_normalizedBufferLength(0)
, m_run(run)
@@ -382,6 +382,7 @@ HarfBuzzShaper::HarfBuzzShaper(const Font* font, const TextRun& run, ForTextEmph
, m_fromIndex(0)
, m_toIndex(m_run.length())
, m_forTextEmphasis(forTextEmphasis)
+ , m_glyphBoundingBox(bounds)
, m_fallbackFonts(fallbackFonts)
{
m_normalizedBuffer = adoptArrayPtr(new UChar[m_run.length() + 1]);
@@ -929,10 +930,12 @@ void HarfBuzzShaper::setGlyphPositionsForHarfBuzzRun(HarfBuzzRun* currentRun, hb
currentRun->setGlyphAndPositions(i, glyph, advance, offsetX, offsetY);
- FloatRect glyphBounds = currentFontData->boundsForGlyph(glyph);
- glyphBounds.move(glyphOrigin.x(), glyphOrigin.y());
- m_glyphBoundingBox.unite(glyphBounds);
- glyphOrigin += FloatSize(advance + offsetX, offsetY);
+ if (m_glyphBoundingBox) {
+ FloatRect glyphBounds = currentFontData->boundsForGlyph(glyph);
+ glyphBounds.move(glyphOrigin.x(), glyphOrigin.y());
+ m_glyphBoundingBox->unite(glyphBounds);
+ glyphOrigin += FloatSize(advance + offsetX, offsetY);
+ }
totalAdvance += advance;
}
« no previous file with comments | « Source/platform/fonts/shaping/HarfBuzzShaper.h ('k') | Source/platform/fonts/shaping/SimpleShaper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698