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

Side by Side Diff: Source/platform/fonts/FontDataCache.cpp

Issue 617103003: Replace ENABLE_OPENTYPE_VERTICAL implementation with HarfBuzz (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@removeOpenTypeVertical
Patch Set: Additional TestExpectations tweaking for Mac Created 6 years 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/platform/fonts/FontCache.cpp ('k') | Source/platform/fonts/FontFaceCreationParams.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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 if (it == m_cache.end()) 89 if (it == m_cache.end())
90 return; 90 return;
91 91
92 ASSERT(it->value.second); 92 ASSERT(it->value.second);
93 if (!--it->value.second) 93 if (!--it->value.second)
94 m_inactiveFontData.add(it->value.first); 94 m_inactiveFontData.add(it->value.first);
95 } 95 }
96 96
97 void FontDataCache::markAllVerticalData() 97 void FontDataCache::markAllVerticalData()
98 { 98 {
99 #if ENABLE(OPENTYPE_VERTICAL)
100 Cache::iterator end = m_cache.end(); 99 Cache::iterator end = m_cache.end();
101 for (Cache::iterator fontData = m_cache.begin(); fontData != end; ++fontData ) { 100 for (Cache::iterator fontData = m_cache.begin(); fontData != end; ++fontData ) {
102 OpenTypeVerticalData* verticalData = const_cast<OpenTypeVerticalData*>(f ontData->value.first->verticalData()); 101 OpenTypeVerticalData* verticalData = const_cast<OpenTypeVerticalData*>(f ontData->value.first->verticalData());
103 if (verticalData) 102 if (verticalData)
104 verticalData->setInFontCache(true); 103 verticalData->setInFontCache(true);
105 } 104 }
106 #endif
107 } 105 }
108 106
109 bool FontDataCache::purge(PurgeSeverity PurgeSeverity) 107 bool FontDataCache::purge(PurgeSeverity PurgeSeverity)
110 { 108 {
111 if (PurgeSeverity == ForcePurge) 109 if (PurgeSeverity == ForcePurge)
112 return purgeLeastRecentlyUsed(INT_MAX); 110 return purgeLeastRecentlyUsed(INT_MAX);
113 111
114 if (m_inactiveFontData.size() > cMaxInactiveFontData) 112 if (m_inactiveFontData.size() > cMaxInactiveFontData)
115 return purgeLeastRecentlyUsed(m_inactiveFontData.size() - cTargetInactiv eFontData); 113 return purgeLeastRecentlyUsed(m_inactiveFontData.size() - cTargetInactiv eFontData);
116 114
(...skipping 29 matching lines...) Expand all
146 bool didWork = fontDataToDelete.size(); 144 bool didWork = fontDataToDelete.size();
147 145
148 fontDataToDelete.clear(); 146 fontDataToDelete.clear();
149 147
150 isPurging = false; 148 isPurging = false;
151 149
152 return didWork; 150 return didWork;
153 } 151 }
154 152
155 } // namespace blink 153 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/fonts/FontCache.cpp ('k') | Source/platform/fonts/FontFaceCreationParams.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698