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 17 matching lines...) Expand all Loading... |
28 | 28 |
29 class CSSCustomFontData FINAL : public CustomFontData { | 29 class CSSCustomFontData FINAL : public CustomFontData { |
30 public: | 30 public: |
31 static PassRefPtr<CSSCustomFontData> create(bool isLoadingFallback = false,
FallbackVisibility visibility = VisibleFallback) | 31 static PassRefPtr<CSSCustomFontData> create(bool isLoadingFallback = false,
FallbackVisibility visibility = VisibleFallback) |
32 { | 32 { |
33 return adoptRef(new CSSCustomFontData(isLoadingFallback, visibility)); | 33 return adoptRef(new CSSCustomFontData(isLoadingFallback, visibility)); |
34 } | 34 } |
35 | 35 |
36 virtual ~CSSCustomFontData() { } | 36 virtual ~CSSCustomFontData() { } |
37 | 37 |
| 38 virtual bool shouldSkipDrawing() const OVERRIDE |
| 39 { |
| 40 if (m_fontFaceSource) |
| 41 m_fontFaceSource->paintRequested(); |
| 42 return m_fallbackVisibility == InvisibleFallback && m_isUsed; |
| 43 } |
| 44 |
38 virtual void beginLoadIfNeeded() const OVERRIDE | 45 virtual void beginLoadIfNeeded() const OVERRIDE |
39 { | 46 { |
40 if (!m_isUsed && m_isLoadingFallback && m_fontFaceSource) { | 47 if (!m_isUsed && m_isLoadingFallback && m_fontFaceSource) { |
41 m_isUsed = true; | 48 m_isUsed = true; |
42 m_fontFaceSource->beginLoadIfNeeded(); | 49 m_fontFaceSource->beginLoadIfNeeded(); |
43 } | 50 } |
44 } | 51 } |
45 | 52 |
46 virtual void setCSSFontFaceSource(CSSFontFaceSource* source) OVERRIDE { m_fo
ntFaceSource = source; } | 53 virtual void setCSSFontFaceSource(CSSFontFaceSource* source) OVERRIDE { m_fo
ntFaceSource = source; } |
47 virtual void clearCSSFontFaceSource() OVERRIDE { m_fontFaceSource = 0; } | 54 virtual void clearCSSFontFaceSource() OVERRIDE { m_fontFaceSource = 0; } |
48 | 55 |
49 private: | 56 private: |
50 CSSCustomFontData(bool isLoadingFallback, FallbackVisibility visibility) | 57 CSSCustomFontData(bool isLoadingFallback, FallbackVisibility visibility) |
51 : CustomFontData(isLoadingFallback, visibility) | 58 : CustomFontData(isLoadingFallback, visibility) |
52 , m_fontFaceSource(0) | 59 , m_fontFaceSource(0) |
53 { | 60 { |
54 } | 61 } |
55 | 62 |
56 CSSFontFaceSource* m_fontFaceSource; | 63 CSSFontFaceSource* m_fontFaceSource; |
57 }; | 64 }; |
58 | 65 |
59 } | 66 } |
60 | 67 |
61 #endif // CSSCustomFontData_h | 68 #endif // CSSCustomFontData_h |
OLD | NEW |