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

Side by Side Diff: Source/WebCore/css/CSSSegmentedFontFace.cpp

Issue 7932007: Merge 94508 - <rdar://problem/10071256> Retain retired custom fonts until the next style recalc (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/835/
Patch Set: Created 9 years, 3 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 | « Source/WebCore/css/CSSFontSelector.cpp ('k') | Source/WebCore/dom/Document.h » ('j') | 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) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 unsigned size = m_fontFaces.size(); 45 unsigned size = m_fontFaces.size();
46 for (unsigned i = 0; i < size; i++) 46 for (unsigned i = 0; i < size; i++)
47 m_fontFaces[i]->removedFromSegmentedFontFace(this); 47 m_fontFaces[i]->removedFromSegmentedFontFace(this);
48 } 48 }
49 49
50 void CSSSegmentedFontFace::pruneTable() 50 void CSSSegmentedFontFace::pruneTable()
51 { 51 {
52 // Make sure the glyph page tree prunes out all uses of this custom font. 52 // Make sure the glyph page tree prunes out all uses of this custom font.
53 if (m_fontDataTable.isEmpty()) 53 if (m_fontDataTable.isEmpty())
54 return; 54 return;
55
55 HashMap<unsigned, SegmentedFontData*>::iterator end = m_fontDataTable.end(); 56 HashMap<unsigned, SegmentedFontData*>::iterator end = m_fontDataTable.end();
56 for (HashMap<unsigned, SegmentedFontData*>::iterator it = m_fontDataTable.be gin(); it != end; ++it) 57 for (HashMap<unsigned, SegmentedFontData*>::iterator it = m_fontDataTable.be gin(); it != end; ++it)
57 GlyphPageTreeNode::pruneTreeCustomFontData(it->second); 58 m_fontSelector->retireCustomFont(it->second);
58 deleteAllValues(m_fontDataTable); 59
59 m_fontDataTable.clear(); 60 m_fontDataTable.clear();
60 } 61 }
61 62
62 bool CSSSegmentedFontFace::isValid() const 63 bool CSSSegmentedFontFace::isValid() const
63 { 64 {
64 // Valid if at least one font face is valid. 65 // Valid if at least one font face is valid.
65 unsigned size = m_fontFaces.size(); 66 unsigned size = m_fontFaces.size();
66 for (unsigned i = 0; i < size; i++) { 67 for (unsigned i = 0; i < size; i++) {
67 if (m_fontFaces[i]->isValid()) 68 if (m_fontFaces[i]->isValid())
68 return true; 69 return true;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 m_fontDataTable.set(hashKey, fontData); 120 m_fontDataTable.set(hashKey, fontData);
120 else { 121 else {
121 delete fontData; 122 delete fontData;
122 fontData = 0; 123 fontData = 0;
123 } 124 }
124 125
125 return fontData; 126 return fontData;
126 } 127 }
127 128
128 } 129 }
OLDNEW
« no previous file with comments | « Source/WebCore/css/CSSFontSelector.cpp ('k') | Source/WebCore/dom/Document.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698