OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google, Inc. | 2 * Copyright (C) 2013 Google, Inc. |
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 30 matching lines...) Expand all Loading... |
41 static PassRefPtr<CustomFontData> create(bool isLoadingFallback = false, Fal
lbackVisibility visibility = VisibleFallback) | 41 static PassRefPtr<CustomFontData> create(bool isLoadingFallback = false, Fal
lbackVisibility visibility = VisibleFallback) |
42 { | 42 { |
43 return adoptRef(new CustomFontData(isLoadingFallback, visibility)); | 43 return adoptRef(new CustomFontData(isLoadingFallback, visibility)); |
44 } | 44 } |
45 | 45 |
46 virtual ~CustomFontData() { } | 46 virtual ~CustomFontData() { } |
47 | 47 |
48 virtual void beginLoadIfNeeded() const { }; | 48 virtual void beginLoadIfNeeded() const { }; |
49 bool isLoading() const { return m_isLoadingFallback && m_isUsed; } | 49 bool isLoading() const { return m_isLoadingFallback && m_isUsed; } |
50 bool isLoadingFallback() const { return m_isLoadingFallback; } | 50 bool isLoadingFallback() const { return m_isLoadingFallback; } |
51 bool shouldSkipDrawing() const { return m_fallbackVisibility == InvisibleFal
lback && m_isUsed; } | 51 virtual bool shouldSkipDrawing() const { return false; } |
52 | 52 |
53 virtual bool isSVGFont() const { return false; } | 53 virtual bool isSVGFont() const { return false; } |
54 virtual void initializeFontData(SimpleFontData*, float) { } | 54 virtual void initializeFontData(SimpleFontData*, float) { } |
55 virtual float widthForSVGGlyph(Glyph, float) const { return 0.0f; } | 55 virtual float widthForSVGGlyph(Glyph, float) const { return 0.0f; } |
56 virtual bool fillSVGGlyphPage(GlyphPage*, unsigned, unsigned, UChar*, unsign
ed, const SimpleFontData*) const { return false; } | 56 virtual bool fillSVGGlyphPage(GlyphPage*, unsigned, unsigned, UChar*, unsign
ed, const SimpleFontData*) const { return false; } |
57 virtual bool applySVGGlyphSelection(WidthIterator&, GlyphData&, bool, int, u
nsigned&) const { return false; } | 57 virtual bool applySVGGlyphSelection(WidthIterator&, GlyphData&, bool, int, u
nsigned&) const { return false; } |
58 | 58 |
59 virtual void setCSSFontFaceSource(CSSFontFaceSource* source) { ASSERT_NOT_RE
ACHED(); } | 59 virtual void setCSSFontFaceSource(CSSFontFaceSource* source) { ASSERT_NOT_RE
ACHED(); } |
60 virtual void clearCSSFontFaceSource() { } | 60 virtual void clearCSSFontFaceSource() { } |
61 | 61 |
62 protected: | 62 protected: |
63 CustomFontData(bool isLoadingFallback, FallbackVisibility visibility = Visib
leFallback) | 63 CustomFontData(bool isLoadingFallback, FallbackVisibility visibility = Visib
leFallback) |
64 : m_isLoadingFallback(isLoadingFallback) | 64 : m_isLoadingFallback(isLoadingFallback) |
65 , m_fallbackVisibility(visibility) | 65 , m_fallbackVisibility(visibility) |
66 , m_isUsed(false) | 66 , m_isUsed(false) |
67 { | 67 { |
68 } | 68 } |
69 | 69 |
70 bool m_isLoadingFallback; | 70 bool m_isLoadingFallback; |
71 FallbackVisibility m_fallbackVisibility; | 71 FallbackVisibility m_fallbackVisibility; |
72 mutable bool m_isUsed; | 72 mutable bool m_isUsed; |
73 }; | 73 }; |
74 | 74 |
75 } | 75 } |
76 | 76 |
77 #endif // CustomFontData_h | 77 #endif // CustomFontData_h |
OLD | NEW |