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

Unified Diff: third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.cpp

Issue 2039263002: Avoid RefPtr cycle between FontPlatformData and HarfBuzzFace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.cpp
diff --git a/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.cpp b/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.cpp
index 46d7870da57e8e3449392839be5bff982546d014..43839a48ce8f62bfeeb4107eaa551d54f92dba44 100644
--- a/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.cpp
+++ b/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.cpp
@@ -67,7 +67,7 @@ public:
}
SkPaint m_paint;
- RefPtr<SimpleFontData> m_simpleFontData;
+ SimpleFontData* m_simpleFontData;
RefPtr<UnicodeRangeSet> m_rangeSet;
};
@@ -200,7 +200,7 @@ static hb_bool_t harfBuzzGetGlyphVerticalOrigin(hb_font_t* hbFont, void* fontDat
float result[] = { 0, 0 };
Glyph theGlyph = glyph;
- verticalData->getVerticalTranslationsForGlyphs(hbFontData->m_simpleFontData.get(), &theGlyph, 1, result);
+ verticalData->getVerticalTranslationsForGlyphs(hbFontData->m_simpleFontData, &theGlyph, 1, result);
*x = SkiaScalarToHarfBuzzPosition(-result[0]);
*y = SkiaScalarToHarfBuzzPosition(-result[1]);
return true;
@@ -214,7 +214,7 @@ static hb_position_t harfBuzzGetGlyphVerticalAdvance(hb_font_t* hbFont, void* fo
return SkiaScalarToHarfBuzzPosition(hbFontData->m_simpleFontData->getFontMetrics().height());
Glyph theGlyph = glyph;
- float advanceHeight = -verticalData->advanceHeight(hbFontData->m_simpleFontData.get(), theGlyph);
+ float advanceHeight = -verticalData->advanceHeight(hbFontData->m_simpleFontData, theGlyph);
return SkiaScalarToHarfBuzzPosition(SkFloatToScalar(advanceHeight));
}
@@ -316,7 +316,7 @@ hb_font_t* HarfBuzzFace::getScaledFont(PassRefPtr<UnicodeRangeSet> rangeSet) con
{
m_platformData->setupPaint(&m_harfBuzzFontData->m_paint);
m_harfBuzzFontData->m_rangeSet = rangeSet;
- m_harfBuzzFontData->m_simpleFontData = FontCache::fontCache()->fontDataFromFontPlatformData(m_platformData);
+ m_harfBuzzFontData->m_simpleFontData = FontCache::fontCache()->fontDataFromFontPlatformData(m_platformData).get();
ASSERT(m_harfBuzzFontData->m_simpleFontData);
int scale = SkiaScalarToHarfBuzzPosition(m_platformData->size());
hb_font_set_scale(m_unscaledFont, scale, scale);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698