Chromium Code Reviews| 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 10 matching lines...) Expand all Loading... | |
| 21 #ifndef CSSCustomFontData_h | 21 #ifndef CSSCustomFontData_h |
| 22 #define CSSCustomFontData_h | 22 #define CSSCustomFontData_h |
| 23 | 23 |
| 24 #include "core/css/CSSFontFaceSource.h" | 24 #include "core/css/CSSFontFaceSource.h" |
| 25 #include "platform/fonts/CustomFontData.h" | 25 #include "platform/fonts/CustomFontData.h" |
| 26 | 26 |
| 27 namespace WebCore { | 27 namespace WebCore { |
| 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) | 31 static PassRefPtr<CSSCustomFontData> create(bool isLoadingFallback = false, bool skipDrawing = false) |
|
dglazkov
2014/02/20 17:45:41
We really should avoid adding bools as params. A l
Kunihiko Sakamoto
2014/02/21 03:38:24
Done.
| |
| 32 { | 32 { |
| 33 return adoptRef(new CSSCustomFontData(isLoadingFallback)); | 33 return adoptRef(new CSSCustomFontData(isLoadingFallback, skipDrawing)); |
| 34 } | 34 } |
| 35 | 35 |
| 36 virtual ~CSSCustomFontData() { } | 36 virtual ~CSSCustomFontData() { } |
| 37 | 37 |
| 38 virtual void beginLoadIfNeeded() const OVERRIDE | 38 virtual void beginLoadIfNeeded() const OVERRIDE |
| 39 { | 39 { |
| 40 if (!m_isUsed && m_isLoadingFallback && m_fontFaceSource) { | 40 if (!m_isUsed && m_isLoadingFallback && m_fontFaceSource) { |
| 41 m_isUsed = true; | 41 m_isUsed = true; |
| 42 m_fontFaceSource->beginLoadIfNeeded(); | 42 m_fontFaceSource->beginLoadIfNeeded(); |
| 43 } | 43 } |
| 44 } | 44 } |
| 45 | 45 |
| 46 virtual void setCSSFontFaceSource(CSSFontFaceSource* source) OVERRIDE { m_fo ntFaceSource = source; } | 46 virtual void setCSSFontFaceSource(CSSFontFaceSource* source) OVERRIDE { m_fo ntFaceSource = source; } |
| 47 virtual void clearCSSFontFaceSource() OVERRIDE { m_fontFaceSource = 0; } | 47 virtual void clearCSSFontFaceSource() OVERRIDE { m_fontFaceSource = 0; } |
| 48 | 48 |
| 49 private: | 49 private: |
| 50 CSSCustomFontData(bool isLoadingFallback) | 50 CSSCustomFontData(bool isLoadingFallback, bool skipDrawing) |
| 51 : CustomFontData(isLoadingFallback) | 51 : CustomFontData(isLoadingFallback, skipDrawing) |
| 52 , m_fontFaceSource(0) | 52 , m_fontFaceSource(0) |
| 53 { | 53 { |
| 54 } | 54 } |
| 55 | 55 |
| 56 CSSFontFaceSource* m_fontFaceSource; | 56 CSSFontFaceSource* m_fontFaceSource; |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 } | 59 } |
| 60 | 60 |
| 61 #endif // CSSCustomFontData_h | 61 #endif // CSSCustomFontData_h |
| OLD | NEW |