のねのBlog

パソコンの問題や、ソフトウェアの開発で起きた問題など書いていきます。よろしくお願いします^^。

FontPlatformDataAndroid

    128 FontPlatformData::FontPlatformData(float size, bool bold, bool oblique)
    129     : m_typeface(NULL), m_textSize(size),  m_emSizeInFontUnits(0), m_fakeBold(bold), m_fakeItalic(oblique),
    130       m_orientation(Horizontal), m_textOrientation(TextOrientationVerticalRight)
    131 {
    132     inc_count();
    133     trace(5);
    134 }
    477     template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits>
    478     template<typename T, typename HashTranslator>
    479     inline Value* HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::lookup(const T& key)
    480     {
    481         checkKey<T, HashTranslator>(key);
    482 
    483         int k = 0;
    484         int sizeMask = m_tableSizeMask;
    485         ValueType* table = m_table;
    486         unsigned h = HashTranslator::hash(key);
    487         int i = h & sizeMask;
    488 
    489         if (!table)
    490             return 0;
    491 
    492 #if DUMP_HASHTABLE_STATS
    493         atomicIncrement(&HashTableStats::numAccesses);
    494         int probeCount = 0;
    495 #endif
    496 
    497         while (1) {
    498             ValueType* entry = table + i;
    499 
    500             // we count on the compiler to optimize out this branch
    501             if (HashFunctions::safeToCompareToEmptyOrDeleted) {
    502                 if (HashTranslator::equal(Extractor::extract(*entry), key))
    503                     return entry;
    504 
    505                 if (isEmptyBucket(*entry))
    506                     return 0;
    507             } else {
    508                 if (isEmptyBucket(*entry))
    509                     return 0;
    510 
    511                 if (!isDeletedBucket(*entry) && HashTranslator::equal(Extractor::extract(*entry), key))
    512                     return entry;
    513             }
    514 #if DUMP_HASHTABLE_STATS
    515             ++probeCount;
    516             HashTableStats::recordCollisionAtCount(probeCount);
    517 #endif
    518             if (k == 0)
    519                 k = 1 | doubleHash(h);
    520             i = (i + k) & sizeMask;
    521         }
    522     }
    771     template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits>
    772     template <typename T, typename HashTranslator>
    773     typename HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::iterator HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::find(const T& key)
    774     {
    775         if (!m_table)
    776             return end();
    777 
    778         ValueType* entry = lookup<T, HashTranslator>(key); <=
    779         if (!entry)
    780             return end();
    781 
    782         return makeKnownGoodIterator(entry);
    783     }
327         iterator find(const KeyType& key) { return find<KeyType, IdentityTranslatorType>(key); }
   395         iterator makeKnownGoodIterator(ValueType* pos) { return iterator(this, pos, m_table + m_tableSize, HashItemKnownGood); }
    120         HashTableConstIterator(const HashTableType* table, PointerType position, PointerType endPosition, HashItemKnownGoodTag)
    121             : m_position(position), m_endPosition(endPosition)
    122         {
    123             addIterator(table, this);
    124         }
   65         HashTableIteratorAdapter(const typename HashTableType::iterator& impl) : m_impl(impl) {}
||<  
></blockquote><

><blockquote cite="http://tools.oesf.biz/android-4.2.0_r1.0/xref/external/webkit/Source/WebCore/platform/graphics/FontFallbackList.cpp#63" title="Cross Reference: /external/webkit/Source/WebCore/platform/graphics/FontFallbackList.cpp"><
>|cpp|
     63 void FontFallbackList::releaseFontData()
     64 {
     65     unsigned numFonts = m_fontList.size();
     66     for (unsigned i = 0; i &lt; numFonts; ++i) {
     67         if (!m_fontList[i].second) {
     68             ASSERT(!m_fontList[i].first-&gt;isSegmented());
     69             fontCache()-&gt;releaseFontData(static_cast&lt;const SimpleFontData*&gt;(m_fontList[i].first));
     70         }
     71     }
     72 }