| OLD | NEW |
| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 WTF_MAKE_NONCOPYABLE(FontData); | 42 WTF_MAKE_NONCOPYABLE(FontData); |
| 43 | 43 |
| 44 public: | 44 public: |
| 45 FontData() : m_maxGlyphPageTreeLevel(0) {} | 45 FontData() : m_maxGlyphPageTreeLevel(0) {} |
| 46 | 46 |
| 47 virtual ~FontData(); | 47 virtual ~FontData(); |
| 48 | 48 |
| 49 virtual const SimpleFontData* fontDataForCharacter(UChar32) const = 0; | 49 virtual const SimpleFontData* fontDataForCharacter(UChar32) const = 0; |
| 50 virtual bool isCustomFont() const = 0; | 50 virtual bool isCustomFont() const = 0; |
| 51 virtual bool isLoading() const = 0; | 51 virtual bool isLoading() const = 0; |
| 52 // Returns whether this is a temporary font data for a custom font which is no
t yet loaded. | 52 // Returns whether this is a temporary font data for a custom font which is |
| 53 // not yet loaded. |
| 53 virtual bool isLoadingFallback() const = 0; | 54 virtual bool isLoadingFallback() const = 0; |
| 54 virtual bool isSegmented() const = 0; | 55 virtual bool isSegmented() const = 0; |
| 55 virtual bool shouldSkipDrawing() const = 0; | 56 virtual bool shouldSkipDrawing() const = 0; |
| 56 | 57 |
| 57 void setMaxGlyphPageTreeLevel(unsigned level) const { | 58 void setMaxGlyphPageTreeLevel(unsigned level) const { |
| 58 m_maxGlyphPageTreeLevel = level; | 59 m_maxGlyphPageTreeLevel = level; |
| 59 } | 60 } |
| 60 unsigned maxGlyphPageTreeLevel() const { return m_maxGlyphPageTreeLevel; } | 61 unsigned maxGlyphPageTreeLevel() const { return m_maxGlyphPageTreeLevel; } |
| 61 | 62 |
| 62 private: | 63 private: |
| 63 mutable unsigned m_maxGlyphPageTreeLevel; | 64 mutable unsigned m_maxGlyphPageTreeLevel; |
| 64 }; | 65 }; |
| 65 | 66 |
| 66 #define DEFINE_FONT_DATA_TYPE_CASTS(thisType, predicate) \ | 67 #define DEFINE_FONT_DATA_TYPE_CASTS(thisType, predicate) \ |
| 67 template <typename T> \ | 68 template <typename T> \ |
| 68 inline thisType* to##thisType(const RefPtr<T>& fontData) { \ | 69 inline thisType* to##thisType(const RefPtr<T>& fontData) { \ |
| 69 return to##thisType(fontData.get()); \ | 70 return to##thisType(fontData.get()); \ |
| 70 } \ | 71 } \ |
| 71 DEFINE_TYPE_CASTS(thisType, FontData, fontData, \ | 72 DEFINE_TYPE_CASTS(thisType, FontData, fontData, \ |
| 72 fontData->isSegmented() == predicate, \ | 73 fontData->isSegmented() == predicate, \ |
| 73 fontData.isSegmented() == predicate) | 74 fontData.isSegmented() == predicate) |
| 74 | 75 |
| 75 } // namespace blink | 76 } // namespace blink |
| 76 | 77 |
| 77 #endif // FontData_h | 78 #endif // FontData_h |
| OLD | NEW |