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

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

Issue 206403004: Change HarfBuzzShaper to use FloatBoxExtent for glyp bounds (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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/harfbuzz/HarfBuzzShaper.h ('k') | Source/platform/geometry/FloatBoxExtent.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp
diff --git a/Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp b/Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp
index d415fbfc253af942287dcc639f92c2ec348998b7..5d8235721d625e967c708b635e8cc55a68ad6d0f 100644
--- a/Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp
+++ b/Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp
@@ -382,10 +382,7 @@ HarfBuzzShaper::HarfBuzzShaper(const Font* font, const TextRun& run, ForTextEmph
, m_fromIndex(0)
, m_toIndex(m_run.length())
, m_forTextEmphasis(forTextEmphasis)
- , m_minGlyphBoundingBoxX(std::numeric_limits<float>::max())
- , m_maxGlyphBoundingBoxX(std::numeric_limits<float>::min())
- , m_minGlyphBoundingBoxY(std::numeric_limits<float>::max())
- , m_maxGlyphBoundingBoxY(std::numeric_limits<float>::min())
+ , m_glyphBoundingBox(std::numeric_limits<float>::max(), std::numeric_limits<float>::min(), std::numeric_limits<float>::min(), std::numeric_limits<float>::max())
{
m_normalizedBuffer = adoptArrayPtr(new UChar[m_run.length() + 1]);
normalizeCharacters(m_run, m_run.length(), m_normalizedBuffer.get(), &m_normalizedBufferLength);
@@ -906,10 +903,7 @@ void HarfBuzzShaper::setGlyphPositionsForHarfBuzzRun(HarfBuzzRun* currentRun, hb
FloatRect glyphBounds = currentFontData->boundsForGlyph(glyph);
glyphBounds.move(glyphOrigin.x(), glyphOrigin.y());
- m_minGlyphBoundingBoxX = std::min(m_minGlyphBoundingBoxX, glyphBounds.x());
- m_maxGlyphBoundingBoxX = std::max(m_maxGlyphBoundingBoxX, glyphBounds.maxX());
- m_minGlyphBoundingBoxY = std::min(m_minGlyphBoundingBoxY, glyphBounds.y());
- m_maxGlyphBoundingBoxY = std::max(m_maxGlyphBoundingBoxY, glyphBounds.maxY());
+ m_glyphBoundingBox.unite(glyphBounds);
glyphOrigin += FloatSize(advance + offsetX, offsetY);
totalAdvance += advance;
« no previous file with comments | « Source/platform/fonts/harfbuzz/HarfBuzzShaper.h ('k') | Source/platform/geometry/FloatBoxExtent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698