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

Side by Side Diff: third_party/WebKit/Source/platform/fonts/FontCache.cpp

Issue 2508843002: Invalidate shape cache when accept languages change (Closed)
Patch Set: Rebased Created 4 years, 1 month 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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 RefPtr<OpenTypeVerticalData> verticalData = 253 RefPtr<OpenTypeVerticalData> verticalData =
254 OpenTypeVerticalData::create(platformData); 254 OpenTypeVerticalData::create(platformData);
255 if (!verticalData->isOpenType()) 255 if (!verticalData->isOpenType())
256 verticalData.clear(); 256 verticalData.clear();
257 fontVerticalDataCache.set(key, verticalData); 257 fontVerticalDataCache.set(key, verticalData);
258 return verticalData; 258 return verticalData;
259 } 259 }
260 260
261 void FontCache::acceptLanguagesChanged(const String& acceptLanguages) { 261 void FontCache::acceptLanguagesChanged(const String& acceptLanguages) {
262 AcceptLanguagesResolver::acceptLanguagesChanged(acceptLanguages); 262 AcceptLanguagesResolver::acceptLanguagesChanged(acceptLanguages);
263 fontCache()->invalidateShapeCache();
263 } 264 }
264 265
265 static FontDataCache* gFontDataCache = 0; 266 static FontDataCache* gFontDataCache = 0;
266 267
267 PassRefPtr<SimpleFontData> FontCache::getFontData( 268 PassRefPtr<SimpleFontData> FontCache::getFontData(
268 const FontDescription& fontDescription, 269 const FontDescription& fontDescription,
269 const AtomicString& family, 270 const AtomicString& family,
270 bool checkingAlternateName, 271 bool checkingAlternateName,
271 ShouldRetain shouldRetain) { 272 ShouldRetain shouldRetain) {
272 if (FontPlatformData* platformData = getFontPlatformData( 273 if (FontPlatformData* platformData = getFontPlatformData(
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 for (iter = gFallbackListShaperCache->begin(); 485 for (iter = gFallbackListShaperCache->begin();
485 iter != gFallbackListShaperCache->end(); ++iter) { 486 iter != gFallbackListShaperCache->end(); ++iter) {
486 shapeResultCacheSize += iter->value->byteSize(); 487 shapeResultCacheSize += iter->value->byteSize();
487 } 488 }
488 dump->AddScalar("size", "bytes", shapeResultCacheSize); 489 dump->AddScalar("size", "bytes", shapeResultCacheSize);
489 memoryDump->AddSuballocation(dump->guid(), 490 memoryDump->AddSuballocation(dump->guid(),
490 WTF::Partitions::kAllocatedObjectPoolName); 491 WTF::Partitions::kAllocatedObjectPoolName);
491 } 492 }
492 493
493 } // namespace blink 494 } // namespace blink
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