| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008, 2009 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 11 matching lines...) Expand all Loading... |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #ifndef SegmentedFontData_h | 26 #ifndef SegmentedFontData_h |
| 27 #define SegmentedFontData_h | 27 #define SegmentedFontData_h |
| 28 | 28 |
| 29 #include "platform/PlatformExport.h" | 29 #include "platform/PlatformExport.h" |
| 30 #include "platform/fonts/FontData.h" | 30 #include "platform/fonts/FontData.h" |
| 31 #include "platform/fonts/FontDataForRangeSet.h" | 31 #include "platform/fonts/FontDataForRangeSet.h" |
| 32 #include "platform/fonts/SimpleFontData.h" | 32 |
| 33 class SimpleFontData; |
| 33 | 34 |
| 34 namespace blink { | 35 namespace blink { |
| 35 | 36 |
| 36 class PLATFORM_EXPORT SegmentedFontData : public FontData { | 37 class PLATFORM_EXPORT SegmentedFontData : public FontData { |
| 37 public: | 38 public: |
| 38 static PassRefPtr<SegmentedFontData> create() { | 39 static PassRefPtr<SegmentedFontData> create() { |
| 39 return adoptRef(new SegmentedFontData); | 40 return adoptRef(new SegmentedFontData); |
| 40 } | 41 } |
| 41 | 42 |
| 42 ~SegmentedFontData() override; | 43 void appendFace(const PassRefPtr<FontDataForRangeSet> fontDataForRangeSet) { |
| 43 | |
| 44 void appendFace(PassRefPtr<FontDataForRangeSet> fontDataForRangeSet) { | |
| 45 m_faces.append(fontDataForRangeSet); | 44 m_faces.append(fontDataForRangeSet); |
| 46 } | 45 } |
| 47 unsigned numFaces() const { return m_faces.size(); } | 46 unsigned numFaces() const { return m_faces.size(); } |
| 48 PassRefPtr<FontDataForRangeSet> faceAt(unsigned i) const { | 47 PassRefPtr<FontDataForRangeSet> faceAt(unsigned i) const { |
| 49 return m_faces[i]; | 48 return m_faces[i]; |
| 50 } | 49 } |
| 51 bool containsCharacter(UChar32) const; | 50 bool containsCharacter(UChar32) const; |
| 52 | 51 |
| 53 private: | 52 private: |
| 54 SegmentedFontData() {} | 53 SegmentedFontData() {} |
| 55 | 54 |
| 56 const SimpleFontData* fontDataForCharacter(UChar32) const override; | 55 const SimpleFontData* fontDataForCharacter(UChar32) const override; |
| 57 | 56 |
| 58 bool isCustomFont() const override; | 57 bool isCustomFont() const override; |
| 59 bool isLoading() const override; | 58 bool isLoading() const override; |
| 60 bool isLoadingFallback() const override; | 59 bool isLoadingFallback() const override; |
| 61 bool isSegmented() const override; | 60 bool isSegmented() const override; |
| 62 bool shouldSkipDrawing() const override; | 61 bool shouldSkipDrawing() const override; |
| 63 | 62 |
| 64 Vector<RefPtr<FontDataForRangeSet>, 1> m_faces; | 63 Vector<RefPtr<FontDataForRangeSet>, 1> m_faces; |
| 65 }; | 64 }; |
| 66 | 65 |
| 67 DEFINE_FONT_DATA_TYPE_CASTS(SegmentedFontData, true); | 66 DEFINE_FONT_DATA_TYPE_CASTS(SegmentedFontData, true); |
| 68 | 67 |
| 69 } // namespace blink | 68 } // namespace blink |
| 70 | 69 |
| 71 #endif // SegmentedFontData_h | 70 #endif // SegmentedFontData_h |
| OLD | NEW |