| 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 10 matching lines...) Expand all Loading... |
| 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 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/FontDataRange.h" | 31 #include "platform/fonts/FontDataForRangeSet.h" |
| 32 #include "platform/fonts/SimpleFontData.h" | 32 #include "platform/fonts/SimpleFontData.h" |
| 33 | 33 |
| 34 namespace blink { | 34 namespace blink { |
| 35 | 35 |
| 36 class PLATFORM_EXPORT SegmentedFontData : public FontData { | 36 class PLATFORM_EXPORT SegmentedFontData : public FontData { |
| 37 public: | 37 public: |
| 38 static PassRefPtr<SegmentedFontData> create() { return adoptRef(new Segmente
dFontData); } | 38 static PassRefPtr<SegmentedFontData> create() { return adoptRef(new Segmente
dFontData); } |
| 39 | 39 |
| 40 ~SegmentedFontData() override; | 40 ~SegmentedFontData() override; |
| 41 | 41 |
| 42 void appendRange(const FontDataRange& range) { m_ranges.append(range); } | 42 void appendFace(const FontDataForRangeSet& fontDataForRangeSet) { m_faces.ap
pend(fontDataForRangeSet); } |
| 43 unsigned numRanges() const { return m_ranges.size(); } | 43 unsigned numFaces() const { return m_faces.size(); } |
| 44 const FontDataRange& rangeAt(unsigned i) const { return m_ranges[i]; } | 44 const FontDataForRangeSet& faceAt(unsigned i) const { return m_faces[i]; } |
| 45 bool containsCharacter(UChar32) const; | 45 bool containsCharacter(UChar32) const; |
| 46 | 46 |
| 47 private: | 47 private: |
| 48 SegmentedFontData() { } | 48 SegmentedFontData() { } |
| 49 | 49 |
| 50 const SimpleFontData* fontDataForCharacter(UChar32) const override; | 50 const SimpleFontData* fontDataForCharacter(UChar32) const override; |
| 51 | 51 |
| 52 bool isCustomFont() const override; | 52 bool isCustomFont() const override; |
| 53 bool isLoading() const override; | 53 bool isLoading() const override; |
| 54 bool isLoadingFallback() const override; | 54 bool isLoadingFallback() const override; |
| 55 bool isSegmented() const override; | 55 bool isSegmented() const override; |
| 56 bool shouldSkipDrawing() const override; | 56 bool shouldSkipDrawing() const override; |
| 57 | 57 |
| 58 Vector<FontDataRange, 1> m_ranges; | 58 Vector<FontDataForRangeSet, 1> m_faces; |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 DEFINE_FONT_DATA_TYPE_CASTS(SegmentedFontData, true); | 61 DEFINE_FONT_DATA_TYPE_CASTS(SegmentedFontData, true); |
| 62 | 62 |
| 63 } // namespace blink | 63 } // namespace blink |
| 64 | 64 |
| 65 #endif // SegmentedFontData_h | 65 #endif // SegmentedFontData_h |
| OLD | NEW |