| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2010 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 FontSelector* getFontSelector() const { return m_fontSelector.get(); } | 56 FontSelector* getFontSelector() const { return m_fontSelector.get(); } |
| 57 // FIXME: It should be possible to combine fontSelectorVersion and generation. | 57 // FIXME: It should be possible to combine fontSelectorVersion and generation. |
| 58 unsigned fontSelectorVersion() const { return m_fontSelectorVersion; } | 58 unsigned fontSelectorVersion() const { return m_fontSelectorVersion; } |
| 59 unsigned generation() const { return m_generation; } | 59 unsigned generation() const { return m_generation; } |
| 60 | 60 |
| 61 ShapeCache* shapeCache(const FontDescription& fontDescription) const { | 61 ShapeCache* shapeCache(const FontDescription& fontDescription) const { |
| 62 if (!m_shapeCache) { | 62 if (!m_shapeCache) { |
| 63 FallbackListCompositeKey key = compositeKey(fontDescription); | 63 FallbackListCompositeKey key = compositeKey(fontDescription); |
| 64 m_shapeCache = FontCache::fontCache()->getShapeCache(key)->weakPtr(); | 64 m_shapeCache = FontCache::fontCache()->getShapeCache(key)->weakPtr(); |
| 65 } | 65 } |
| 66 ASSERT(m_shapeCache); | 66 DCHECK(m_shapeCache); |
| 67 if (getFontSelector()) | 67 if (getFontSelector()) |
| 68 m_shapeCache->clearIfVersionChanged(getFontSelector()->version()); | 68 m_shapeCache->clearIfVersionChanged(getFontSelector()->version()); |
| 69 return m_shapeCache.get(); | 69 return m_shapeCache.get(); |
| 70 } | 70 } |
| 71 | 71 |
| 72 const SimpleFontData* primarySimpleFontData( | 72 const SimpleFontData* primarySimpleFontData( |
| 73 const FontDescription& fontDescription) { | 73 const FontDescription& fontDescription) { |
| 74 ASSERT(isMainThread()); | 74 DCHECK(isMainThread()); |
| 75 if (!m_cachedPrimarySimpleFontData) { | 75 if (!m_cachedPrimarySimpleFontData) { |
| 76 m_cachedPrimarySimpleFontData = | 76 m_cachedPrimarySimpleFontData = |
| 77 determinePrimarySimpleFontData(fontDescription); | 77 determinePrimarySimpleFontData(fontDescription); |
| 78 ASSERT(m_cachedPrimarySimpleFontData); | 78 DCHECK(m_cachedPrimarySimpleFontData); |
| 79 } | 79 } |
| 80 return m_cachedPrimarySimpleFontData; | 80 return m_cachedPrimarySimpleFontData; |
| 81 } | 81 } |
| 82 const FontData* fontDataAt(const FontDescription&, unsigned index) const; | 82 const FontData* fontDataAt(const FontDescription&, unsigned index) const; |
| 83 | 83 |
| 84 FallbackListCompositeKey compositeKey(const FontDescription&) const; | 84 FallbackListCompositeKey compositeKey(const FontDescription&) const; |
| 85 | 85 |
| 86 private: | 86 private: |
| 87 FontFallbackList(); | 87 FontFallbackList(); |
| 88 | 88 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 100 unsigned m_fontSelectorVersion; | 100 unsigned m_fontSelectorVersion; |
| 101 mutable int m_familyIndex; | 101 mutable int m_familyIndex; |
| 102 unsigned short m_generation; | 102 unsigned short m_generation; |
| 103 mutable bool m_hasLoadingFallback : 1; | 103 mutable bool m_hasLoadingFallback : 1; |
| 104 mutable WeakPtr<ShapeCache> m_shapeCache; | 104 mutable WeakPtr<ShapeCache> m_shapeCache; |
| 105 }; | 105 }; |
| 106 | 106 |
| 107 } // namespace blink | 107 } // namespace blink |
| 108 | 108 |
| 109 #endif | 109 #endif |
| OLD | NEW |