OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007 Apple Computer, Inc. | 2 * Copyright (C) 2006, 2007 Apple Computer, Inc. |
3 * Copyright (c) 2006, 2007, 2008, 2009, Google Inc. All rights reserved. | 3 * Copyright (c) 2006, 2007, 2008, 2009, 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 are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 62 |
63 class PLATFORM_EXPORT FontPlatformData { | 63 class PLATFORM_EXPORT FontPlatformData { |
64 public: | 64 public: |
65 // Used for deleted values in the font cache's hash tables. The hash table | 65 // Used for deleted values in the font cache's hash tables. The hash table |
66 // will create us with this structure, and it will compare other values | 66 // will create us with this structure, and it will compare other values |
67 // to this "Deleted" one. It expects the Deleted one to be differentiable | 67 // to this "Deleted" one. It expects the Deleted one to be differentiable |
68 // from the NULL one (created with the empty constructor), so we can't just | 68 // from the NULL one (created with the empty constructor), so we can't just |
69 // set everything to NULL. | 69 // set everything to NULL. |
70 FontPlatformData(WTF::HashTableDeletedValueType); | 70 FontPlatformData(WTF::HashTableDeletedValueType); |
71 FontPlatformData(); | 71 FontPlatformData(); |
72 #if ENABLE(GDI_FONTS_ON_WINDOWS) | |
73 // This constructor takes ownership of the HFONT | |
74 FontPlatformData(HFONT, float size, FontOrientation); | |
75 #endif | |
76 FontPlatformData(float size, bool bold, bool oblique); | 72 FontPlatformData(float size, bool bold, bool oblique); |
77 FontPlatformData(const FontPlatformData&); | 73 FontPlatformData(const FontPlatformData&); |
78 FontPlatformData(const FontPlatformData&, float textSize); | 74 FontPlatformData(const FontPlatformData&, float textSize); |
79 FontPlatformData(PassRefPtr<SkTypeface>, const char* name, float textSize, b
ool syntheticBold, bool syntheticItalic, FontOrientation = Horizontal, bool useS
ubpixelPositioning = defaultUseSubpixelPositioning()); | 75 FontPlatformData(PassRefPtr<SkTypeface>, const char* name, float textSize, b
ool syntheticBold, bool syntheticItalic, FontOrientation = Horizontal, bool useS
ubpixelPositioning = defaultUseSubpixelPositioning()); |
80 | 76 |
81 void setupPaint(SkPaint*, GraphicsContext* = 0) const; | 77 void setupPaint(SkPaint*, GraphicsContext* = 0) const; |
82 | 78 |
83 FontPlatformData& operator=(const FontPlatformData&); | 79 FontPlatformData& operator=(const FontPlatformData&); |
84 | 80 |
85 bool isHashTableDeletedValue() const { return m_isHashTableDeletedValue; } | 81 bool isHashTableDeletedValue() const { return m_isHashTableDeletedValue; } |
86 | 82 |
87 ~FontPlatformData(); | 83 ~FontPlatformData(); |
88 | 84 |
89 bool isFixedPitch() const; | 85 bool isFixedPitch() const; |
90 float size() const { return m_textSize; } | 86 float size() const { return m_textSize; } |
91 #if USE(HARFBUZZ) | 87 #if USE(HARFBUZZ) |
92 HarfBuzzFace* harfBuzzFace() const; | 88 HarfBuzzFace* harfBuzzFace() const; |
93 #else | 89 #else |
94 HFONT hfont() const { return m_font ? m_font->hfont() : 0; } | 90 HFONT hfont() const { return m_font ? m_font->hfont() : 0; } |
95 #endif | 91 #endif |
96 SkTypeface* typeface() const { return m_typeface.get(); } | 92 SkTypeface* typeface() const { return m_typeface.get(); } |
97 SkFontID uniqueID() const { return m_typeface->uniqueID(); } | 93 SkFontID uniqueID() const { return m_typeface->uniqueID(); } |
98 int paintTextFlags() const { return m_paintTextFlags; } | 94 int paintTextFlags() const { return m_paintTextFlags; } |
99 | 95 |
100 String fontFamilyName() const; | 96 String fontFamilyName() const; |
101 | 97 |
102 FontOrientation orientation() const { return m_orientation; } | 98 FontOrientation orientation() const { return m_orientation; } |
103 void setOrientation(FontOrientation orientation) { m_orientation = orientati
on; } | 99 void setOrientation(FontOrientation orientation) { m_orientation = orientati
on; } |
104 | 100 |
105 #if ENABLE(GDI_FONTS_ON_WINDOWS) | |
106 unsigned hash() const | |
107 { | |
108 return m_font ? m_font->hash() : NULL; | |
109 } | |
110 #else | |
111 unsigned hash() const; | 101 unsigned hash() const; |
112 #endif | |
113 | 102 |
114 bool operator==(const FontPlatformData&) const; | 103 bool operator==(const FontPlatformData&) const; |
115 | 104 |
116 #if ENABLE(OPENTYPE_VERTICAL) | 105 #if ENABLE(OPENTYPE_VERTICAL) |
117 PassRefPtr<OpenTypeVerticalData> verticalData() const; | 106 PassRefPtr<OpenTypeVerticalData> verticalData() const; |
118 PassRefPtr<SharedBuffer> openTypeTable(uint32_t table) const; | 107 PassRefPtr<SharedBuffer> openTypeTable(uint32_t table) const; |
119 #endif | 108 #endif |
120 | 109 |
121 #ifndef NDEBUG | 110 #ifndef NDEBUG |
122 String description() const; | 111 String description() const; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 mutable OwnPtr<SCRIPT_FONTPROPERTIES> m_scriptFontProperties; | 171 mutable OwnPtr<SCRIPT_FONTPROPERTIES> m_scriptFontProperties; |
183 #endif | 172 #endif |
184 | 173 |
185 bool m_isHashTableDeletedValue; | 174 bool m_isHashTableDeletedValue; |
186 bool m_useSubpixelPositioning; | 175 bool m_useSubpixelPositioning; |
187 }; | 176 }; |
188 | 177 |
189 } // WebCore | 178 } // WebCore |
190 | 179 |
191 #endif // FontPlatformDataChromiumWin_h | 180 #endif // FontPlatformDataChromiumWin_h |
OLD | NEW |