| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 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 21 matching lines...) Expand all Loading... |
| 32 #include "sky/engine/wtf/Deque.h" | 32 #include "sky/engine/wtf/Deque.h" |
| 33 #include "sky/engine/wtf/Forward.h" | 33 #include "sky/engine/wtf/Forward.h" |
| 34 #include "sky/engine/wtf/PassRefPtr.h" | 34 #include "sky/engine/wtf/PassRefPtr.h" |
| 35 #include "sky/engine/wtf/Vector.h" | 35 #include "sky/engine/wtf/Vector.h" |
| 36 | 36 |
| 37 namespace blink { | 37 namespace blink { |
| 38 | 38 |
| 39 class CSSFontSelector; | 39 class CSSFontSelector; |
| 40 class Document; | 40 class Document; |
| 41 class FontDescription; | 41 class FontDescription; |
| 42 class RemoteFontFaceSource; | |
| 43 class SimpleFontData; | 42 class SimpleFontData; |
| 44 class StyleRuleFontFace; | 43 class StyleRuleFontFace; |
| 45 | 44 |
| 46 class CSSFontFace final { | 45 class CSSFontFace final { |
| 47 public: | 46 public: |
| 48 struct UnicodeRange; | 47 struct UnicodeRange; |
| 49 class UnicodeRangeSet; | 48 class UnicodeRangeSet; |
| 50 | 49 |
| 51 CSSFontFace(FontFace* fontFace, Vector<UnicodeRange>& ranges) | 50 CSSFontFace(FontFace* fontFace, Vector<UnicodeRange>& ranges) |
| 52 : m_ranges(ranges) | 51 : m_ranges(ranges) |
| 53 , m_segmentedFontFace(nullptr) | 52 , m_segmentedFontFace(nullptr) |
| 54 , m_fontFace(fontFace) | 53 , m_fontFace(fontFace) |
| 55 { | 54 { |
| 56 ASSERT(m_fontFace); | 55 ASSERT(m_fontFace); |
| 57 } | 56 } |
| 58 | 57 |
| 59 FontFace* fontFace() const { return m_fontFace; } | 58 FontFace* fontFace() const { return m_fontFace; } |
| 60 | 59 |
| 61 UnicodeRangeSet& ranges() { return m_ranges; } | 60 UnicodeRangeSet& ranges() { return m_ranges; } |
| 62 | 61 |
| 63 void setSegmentedFontFace(CSSSegmentedFontFace*); | 62 void setSegmentedFontFace(CSSSegmentedFontFace*); |
| 64 void clearSegmentedFontFace() { m_segmentedFontFace = nullptr; } | 63 void clearSegmentedFontFace() { m_segmentedFontFace = nullptr; } |
| 65 | 64 |
| 66 bool isValid() const { return !m_sources.isEmpty(); } | 65 bool isValid() const { return !m_sources.isEmpty(); } |
| 67 | 66 |
| 68 void addSource(PassOwnPtr<CSSFontFaceSource>); | 67 void addSource(PassOwnPtr<CSSFontFaceSource>); |
| 69 | 68 |
| 70 void didBeginLoad(); | |
| 71 void fontLoaded(RemoteFontFaceSource*); | |
| 72 void fontLoadWaitLimitExceeded(RemoteFontFaceSource*); | |
| 73 | |
| 74 PassRefPtr<SimpleFontData> getFontData(const FontDescription&); | 69 PassRefPtr<SimpleFontData> getFontData(const FontDescription&); |
| 75 | 70 |
| 76 struct UnicodeRange { | 71 struct UnicodeRange { |
| 77 UnicodeRange(UChar32 from, UChar32 to) | 72 UnicodeRange(UChar32 from, UChar32 to) |
| 78 : m_from(from) | 73 : m_from(from) |
| 79 , m_to(to) | 74 , m_to(to) |
| 80 { | 75 { |
| 81 } | 76 } |
| 82 | 77 |
| 83 UChar32 from() const { return m_from; } | 78 UChar32 from() const { return m_from; } |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 | 110 |
| 116 UnicodeRangeSet m_ranges; | 111 UnicodeRangeSet m_ranges; |
| 117 RawPtr<CSSSegmentedFontFace> m_segmentedFontFace; | 112 RawPtr<CSSSegmentedFontFace> m_segmentedFontFace; |
| 118 Deque<OwnPtr<CSSFontFaceSource> > m_sources; | 113 Deque<OwnPtr<CSSFontFaceSource> > m_sources; |
| 119 RawPtr<FontFace> m_fontFace; | 114 RawPtr<FontFace> m_fontFace; |
| 120 }; | 115 }; |
| 121 | 116 |
| 122 } | 117 } |
| 123 | 118 |
| 124 #endif // SKY_ENGINE_CORE_CSS_CSSFONTFACE_H_ | 119 #endif // SKY_ENGINE_CORE_CSS_CSSFONTFACE_H_ |
| OLD | NEW |