| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2011 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 13 matching lines...) Expand all Loading... |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #ifndef SKY_ENGINE_CORE_CSS_CSSFONTFACESOURCE_H_ | 26 #ifndef SKY_ENGINE_CORE_CSS_CSSFONTFACESOURCE_H_ |
| 27 #define SKY_ENGINE_CORE_CSS_CSSFONTFACESOURCE_H_ | 27 #define SKY_ENGINE_CORE_CSS_CSSFONTFACESOURCE_H_ |
| 28 | 28 |
| 29 #include "sky/engine/platform/heap/Handle.h" | 29 #include "sky/engine/platform/heap/Handle.h" |
| 30 #include "sky/engine/wtf/HashMap.h" | 30 #include "sky/engine/wtf/HashMap.h" |
| 31 | 31 |
| 32 namespace blink { | 32 namespace blink { |
| 33 | 33 |
| 34 class FontResource; | |
| 35 class CSSFontFace; | 34 class CSSFontFace; |
| 36 class FontDescription; | 35 class FontDescription; |
| 37 class SimpleFontData; | 36 class SimpleFontData; |
| 38 | 37 |
| 39 class CSSFontFaceSource { | 38 class CSSFontFaceSource { |
| 40 public: | 39 public: |
| 41 virtual ~CSSFontFaceSource(); | 40 virtual ~CSSFontFaceSource(); |
| 42 | 41 |
| 43 virtual bool isLocal() const { return false; } | 42 virtual bool isLocal() const { return false; } |
| 44 virtual bool isLoading() const { return false; } | 43 virtual bool isLoading() const { return false; } |
| 45 virtual bool isLoaded() const { return true; } | 44 virtual bool isLoaded() const { return true; } |
| 46 virtual bool isValid() const { return true; } | 45 virtual bool isValid() const { return true; } |
| 47 | 46 |
| 48 virtual FontResource* resource() { return 0; } | |
| 49 void setFontFace(CSSFontFace* face) { m_face = face; } | 47 void setFontFace(CSSFontFace* face) { m_face = face; } |
| 50 | 48 |
| 51 PassRefPtr<SimpleFontData> getFontData(const FontDescription&); | 49 PassRefPtr<SimpleFontData> getFontData(const FontDescription&); |
| 52 | 50 |
| 53 virtual bool isLocalFontAvailable(const FontDescription&) { return false; } | 51 virtual bool isLocalFontAvailable(const FontDescription&) { return false; } |
| 54 virtual void beginLoadIfNeeded() { } | 52 virtual void beginLoadIfNeeded() { } |
| 55 | 53 |
| 56 // For UMA reporting | 54 // For UMA reporting |
| 57 virtual bool hadBlankText() { return false; } | 55 virtual bool hadBlankText() { return false; } |
| 58 | 56 |
| 59 protected: | 57 protected: |
| 60 CSSFontFaceSource(); | 58 CSSFontFaceSource(); |
| 61 virtual PassRefPtr<SimpleFontData> createFontData(const FontDescription&) =
0; | 59 virtual PassRefPtr<SimpleFontData> createFontData(const FontDescription&) =
0; |
| 62 | 60 |
| 63 typedef HashMap<unsigned, RefPtr<SimpleFontData> > FontDataTable; // The has
h key is composed of size synthetic styles. | 61 typedef HashMap<unsigned, RefPtr<SimpleFontData> > FontDataTable; // The has
h key is composed of size synthetic styles. |
| 64 | 62 |
| 65 RawPtr<CSSFontFace> m_face; // Our owning font face. | 63 RawPtr<CSSFontFace> m_face; // Our owning font face. |
| 66 FontDataTable m_fontDataTable; | 64 FontDataTable m_fontDataTable; |
| 67 }; | 65 }; |
| 68 | 66 |
| 69 } | 67 } |
| 70 | 68 |
| 71 #endif // SKY_ENGINE_CORE_CSS_CSSFONTFACESOURCE_H_ | 69 #endif // SKY_ENGINE_CORE_CSS_CSSFONTFACESOURCE_H_ |
| OLD | NEW |