| 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 * Copyright (C) 2013 Google Inc. All rights reserved. | 3 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 #ifndef CSSSegmentedFontFaceCache_h | 27 #ifndef CSSSegmentedFontFaceCache_h |
| 28 #define CSSSegmentedFontFaceCache_h | 28 #define CSSSegmentedFontFaceCache_h |
| 29 | 29 |
| 30 #include "wtf/Forward.h" | 30 #include "wtf/Forward.h" |
| 31 #include "wtf/HashMap.h" | 31 #include "wtf/HashMap.h" |
| 32 #include "wtf/text/StringHash.h" | 32 #include "wtf/text/StringHash.h" |
| 33 | 33 |
| 34 namespace WebCore { | 34 namespace WebCore { |
| 35 | 35 |
| 36 class CSSFontFace; |
| 36 class CSSFontSelector; | 37 class CSSFontSelector; |
| 37 class CSSSegmentedFontFace; | 38 class CSSSegmentedFontFace; |
| 38 class FontData; | 39 class FontData; |
| 39 class FontDescription; | 40 class FontDescription; |
| 40 class StyleRuleFontFace; | 41 class StyleRuleFontFace; |
| 41 class Settings; | 42 class Settings; |
| 42 | 43 |
| 43 class CSSSegmentedFontFaceCache { | 44 class CSSSegmentedFontFaceCache { |
| 44 public: | 45 public: |
| 45 CSSSegmentedFontFaceCache(); | 46 CSSSegmentedFontFaceCache(); |
| 46 | 47 |
| 47 // FIXME: Remove CSSFontSelector as argument. Passing CSSFontSelector here i
s | 48 // FIXME: Remove CSSFontSelector as argument. Passing CSSFontSelector here i
s |
| 48 // a result of egregious spaghettification in CSSFontFace/FontFaceSet. | 49 // a result of egregious spaghettification in CSSFontFace/FontFaceSet. |
| 49 void addFontFaceRule(CSSFontSelector*, const StyleRuleFontFace*); | 50 void addFontFaceRule(CSSFontSelector*, const StyleRuleFontFace*); |
| 51 void removeFontFaceRule(const StyleRuleFontFace*); |
| 50 PassRefPtr<FontData> getFontData(Settings*, const FontDescription&, const At
omicString&); | 52 PassRefPtr<FontData> getFontData(Settings*, const FontDescription&, const At
omicString&); |
| 51 CSSSegmentedFontFace* getFontFace(const FontDescription&, const AtomicString
& family); | 53 CSSSegmentedFontFace* getFontFace(const FontDescription&, const AtomicString
& family); |
| 52 | 54 |
| 53 unsigned version() const { return m_version; } | 55 unsigned version() const { return m_version; } |
| 54 | 56 |
| 55 private: | 57 private: |
| 56 HashMap<String, OwnPtr<HashMap<unsigned, RefPtr<CSSSegmentedFontFace> > >, C
aseFoldingHash> m_fontFaces; | 58 typedef HashMap<unsigned, RefPtr<CSSSegmentedFontFace> > TraitsMap; |
| 57 HashMap<String, OwnPtr<Vector<RefPtr<CSSSegmentedFontFace> > >, CaseFoldingH
ash> m_locallyInstalledFontFaces; | 59 typedef HashMap<String, OwnPtr<TraitsMap>, CaseFoldingHash> FamilyToTraitsMa
p; |
| 58 HashMap<String, OwnPtr<HashMap<unsigned, RefPtr<CSSSegmentedFontFace> > >, C
aseFoldingHash> m_fonts; | 60 typedef HashMap<String, OwnPtr<Vector<RefPtr<CSSSegmentedFontFace> > >, Case
FoldingHash> FamilyToFontFaces; |
| 61 typedef HashMap<const StyleRuleFontFace*, RefPtr<CSSFontFace> > StyleRuleToF
ontFace; |
| 62 FamilyToTraitsMap m_fontFaces; |
| 63 FamilyToFontFaces m_locallyInstalledFontFaces; |
| 64 FamilyToTraitsMap m_fonts; |
| 65 StyleRuleToFontFace m_styleRuleToFontFace; |
| 59 | 66 |
| 60 // FIXME: See if this could be ditched | 67 // FIXME: See if this could be ditched |
| 61 // Used to compare Font instances, and the usage seems suspect. | 68 // Used to compare Font instances, and the usage seems suspect. |
| 62 unsigned m_version; | 69 unsigned m_version; |
| 63 }; | 70 }; |
| 64 | 71 |
| 65 } | 72 } |
| 66 | 73 |
| 67 #endif | 74 #endif |
| OLD | NEW |