зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1265452 followup - Make mGlyphExtentsArray an array of UniquePtr. r=jrmuizel
This commit is contained in:
Родитель
28a9e2cf14
Коммит
4b13ebfd2f
|
@ -856,14 +856,6 @@ gfxFont::gfxFont(gfxFontEntry *aFontEntry, const gfxFontStyle *aFontStyle,
|
|||
|
||||
gfxFont::~gfxFont()
|
||||
{
|
||||
uint32_t i, count = mGlyphExtentsArray.Length();
|
||||
// We destroy the contents of mGlyphExtentsArray explicitly instead of
|
||||
// using UniquePtr because VC++ can't deal with nsTArrays of UniquePtrs
|
||||
// of classes that lack a proper copy constructor
|
||||
for (i = 0; i < count; ++i) {
|
||||
delete mGlyphExtentsArray[i];
|
||||
}
|
||||
|
||||
mFontEntry->NotifyFontDestroyed(this);
|
||||
|
||||
if (mGlyphChangeObservers) {
|
||||
|
@ -3304,7 +3296,7 @@ gfxFont::GetOrCreateGlyphExtents(int32_t aAppUnitsPerDevUnit) {
|
|||
uint32_t i, count = mGlyphExtentsArray.Length();
|
||||
for (i = 0; i < count; ++i) {
|
||||
if (mGlyphExtentsArray[i]->GetAppUnitsPerDevUnit() == aAppUnitsPerDevUnit)
|
||||
return mGlyphExtentsArray[i];
|
||||
return mGlyphExtentsArray[i].get();
|
||||
}
|
||||
gfxGlyphExtents *glyphExtents = new gfxGlyphExtents(aAppUnitsPerDevUnit);
|
||||
if (glyphExtents) {
|
||||
|
|
|
@ -2083,7 +2083,7 @@ protected:
|
|||
|
||||
nsExpirationState mExpirationState;
|
||||
gfxFontStyle mStyle;
|
||||
AutoTArray<gfxGlyphExtents*,1> mGlyphExtentsArray;
|
||||
nsTArray<mozilla::UniquePtr<gfxGlyphExtents>> mGlyphExtentsArray;
|
||||
mozilla::UniquePtr<nsTHashtable<nsPtrHashKey<GlyphChangeObserver>>>
|
||||
mGlyphChangeObservers;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче