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

Side by Side Diff: Source/WebCore/platform/graphics/FontCache.cpp

Issue 11854003: Merge 138812 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1364/
Patch Set: Created 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 3 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 return getLastResortFallbackFont(fontDescription, DoNotRetain).leakRef(); 348 return getLastResortFallbackFont(fontDescription, DoNotRetain).leakRef();
349 } 349 }
350 350
351 void FontCache::releaseFontData(const SimpleFontData* fontData) 351 void FontCache::releaseFontData(const SimpleFontData* fontData)
352 { 352 {
353 ASSERT(gFontDataCache); 353 ASSERT(gFontDataCache);
354 ASSERT(!fontData->isCustomFont()); 354 ASSERT(!fontData->isCustomFont());
355 355
356 FontDataCache::iterator it = gFontDataCache->find(fontData->platformData()); 356 FontDataCache::iterator it = gFontDataCache->find(fontData->platformData());
357 ASSERT(it != gFontDataCache->end()); 357 ASSERT(it != gFontDataCache->end());
358 if (it == gFontDataCache->end())
359 return;
358 360
359 ASSERT(it->value.second); 361 ASSERT(it->value.second);
360 if (!--it->value.second) 362 if (!--it->value.second)
361 gInactiveFontData->add(it->value.first); 363 gInactiveFontData->add(it->value.first);
362 } 364 }
363 365
364 void FontCache::purgeInactiveFontDataIfNeeded() 366 void FontCache::purgeInactiveFontDataIfNeeded()
365 { 367 {
366 if (gInactiveFontData && !m_purgePreventCount && gInactiveFontData->size() > cMaxInactiveFontData) 368 if (gInactiveFontData && !m_purgePreventCount && gInactiveFontData->size() > cMaxInactiveFontData)
367 purgeInactiveFontData(gInactiveFontData->size() - cTargetInactiveFontDat a); 369 purgeInactiveFontData(gInactiveFontData->size() - cTargetInactiveFontDat a);
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 clients.append(*it); 552 clients.append(*it);
551 553
552 ASSERT(numClients == clients.size()); 554 ASSERT(numClients == clients.size());
553 for (size_t i = 0; i < numClients; ++i) 555 for (size_t i = 0; i < numClients; ++i)
554 clients[i]->fontCacheInvalidated(); 556 clients[i]->fontCacheInvalidated();
555 557
556 purgeInactiveFontData(); 558 purgeInactiveFontData();
557 } 559 }
558 560
559 } // namespace WebCore 561 } // namespace WebCore
OLDNEW
« 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