| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. | 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. |
| 3 * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com | 3 * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com |
| 4 * Copyright (C) 2007 Holger Hans Peter Freyther | 4 * Copyright (C) 2007 Holger Hans Peter Freyther |
| 5 * Copyright (C) 2007 Pioneer Research Center USA, Inc. | 5 * Copyright (C) 2007 Pioneer Research Center USA, Inc. |
| 6 * Copyright (C) 2010, 2011 Brent Fulgham <bfulgham@webkit.org> | 6 * Copyright (C) 2010, 2011 Brent Fulgham <bfulgham@webkit.org> |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| 11 * version 2 of the License, or (at your option) any later version. | 11 * version 2 of the License, or (at your option) any later version. |
| 12 * | 12 * |
| 13 * This library is distributed in the hope that it will be useful, | 13 * This library is distributed in the hope that it will be useful, |
| 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 16 * Library General Public License for more details. | 16 * Library General Public License for more details. |
| 17 * | 17 * |
| 18 * You should have received a copy of the GNU Library General Public License | 18 * You should have received a copy of the GNU Library General Public License |
| 19 * along with this library; see the file COPYING.LIB. If not, write to | 19 * along with this library; see the file COPYING.LIB. If not, write to |
| 20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 21 * Boston, MA 02110-1301, USA. | 21 * Boston, MA 02110-1301, USA. |
| 22 * | 22 * |
| 23 */ | 23 */ |
| 24 | 24 |
| 25 // FIXME: This is temporary until all ports switch to using this file. | 25 // FIXME: This is temporary until all ports switch to using this file. |
| 26 #if PLATFORM(CHROMIUM) && !OS(DARWIN) | 26 #if !OS(DARWIN) |
| 27 #include "chromium/FontPlatformData.h" | 27 #include "chromium/FontPlatformData.h" |
| 28 #else | 28 #else |
| 29 | 29 |
| 30 #ifndef FontPlatformData_h | 30 #ifndef FontPlatformData_h |
| 31 #define FontPlatformData_h | 31 #define FontPlatformData_h |
| 32 | 32 |
| 33 #include "FontOrientation.h" | 33 #include "FontOrientation.h" |
| 34 #include "FontWidthVariant.h" | 34 #include "FontWidthVariant.h" |
| 35 | 35 |
| 36 #if OS(DARWIN) | 36 #if OS(DARWIN) |
| 37 OBJC_CLASS NSFont; | 37 OBJC_CLASS NSFont; |
| 38 | 38 |
| 39 typedef struct CGFont* CGFontRef; | 39 typedef struct CGFont* CGFontRef; |
| 40 typedef const struct __CTFont* CTFontRef; | 40 typedef const struct __CTFont* CTFontRef; |
| 41 | 41 |
| 42 #include <CoreFoundation/CFBase.h> | 42 #include <CoreFoundation/CFBase.h> |
| 43 #include <objc/objc-auto.h> | 43 #include <objc/objc-auto.h> |
| 44 #endif | 44 #endif |
| 45 | 45 |
| 46 #include <wtf/Forward.h> | 46 #include <wtf/Forward.h> |
| 47 #include <wtf/PassRefPtr.h> | 47 #include <wtf/PassRefPtr.h> |
| 48 #include <wtf/RefCounted.h> | 48 #include <wtf/RefCounted.h> |
| 49 #include <wtf/RetainPtr.h> | 49 #include <wtf/RetainPtr.h> |
| 50 #include <wtf/text/StringImpl.h> | 50 #include <wtf/text/StringImpl.h> |
| 51 | 51 |
| 52 #if PLATFORM(CHROMIUM) && OS(DARWIN) | 52 #if OS(DARWIN) |
| 53 #include "CrossProcessFontLoading.h" | 53 #include "CrossProcessFontLoading.h" |
| 54 #endif | 54 #endif |
| 55 | 55 |
| 56 #if USE(SKIA_ON_MAC_CHROMIUM) | 56 #if USE(SKIA_ON_MAC_CHROMIUM) |
| 57 typedef struct CGFont* CGFontRef; | 57 typedef struct CGFont* CGFontRef; |
| 58 #if OS(DARWIN) | 58 #if OS(DARWIN) |
| 59 typedef const struct __CTFont* CTFontRef; | 59 typedef const struct __CTFont* CTFontRef; |
| 60 typedef UInt32 FMFont; | 60 typedef UInt32 FMFont; |
| 61 typedef FMFont ATSUFontID; | 61 typedef FMFont ATSUFontID; |
| 62 typedef UInt32 ATSFontRef; | 62 typedef UInt32 ATSFontRef; |
| 63 #endif | 63 #endif |
| 64 #endif | 64 #endif |
| 65 | 65 |
| 66 namespace WebCore { | 66 namespace WebCore { |
| 67 | 67 |
| 68 class FontDescription; | 68 class FontDescription; |
| 69 class SharedBuffer; | 69 class SharedBuffer; |
| 70 | 70 |
| 71 #if PLATFORM(CHROMIUM) && OS(DARWIN) | 71 #if OS(DARWIN) |
| 72 class HarfBuzzFace; | 72 class HarfBuzzFace; |
| 73 #endif | 73 #endif |
| 74 | 74 |
| 75 #if OS(DARWIN) | 75 #if OS(DARWIN) |
| 76 inline CTFontRef toCTFontRef(NSFont *nsFont) { return reinterpret_cast<CTFontRef
>(nsFont); } | 76 inline CTFontRef toCTFontRef(NSFont *nsFont) { return reinterpret_cast<CTFontRef
>(nsFont); } |
| 77 #endif | 77 #endif |
| 78 | 78 |
| 79 class FontPlatformData { | 79 class FontPlatformData { |
| 80 public: | 80 public: |
| 81 FontPlatformData(WTF::HashTableDeletedValueType); | 81 FontPlatformData(WTF::HashTableDeletedValueType); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 bool isColorBitmapFont() const { return m_isColorBitmapFont; } | 119 bool isColorBitmapFont() const { return m_isColorBitmapFont; } |
| 120 bool isCompositeFontReference() const { return m_isCompositeFontReference; } | 120 bool isCompositeFontReference() const { return m_isCompositeFontReference; } |
| 121 #if OS(DARWIN) | 121 #if OS(DARWIN) |
| 122 bool isPrinterFont() const { return m_isPrinterFont; } | 122 bool isPrinterFont() const { return m_isPrinterFont; } |
| 123 #endif | 123 #endif |
| 124 FontOrientation orientation() const { return m_orientation; } | 124 FontOrientation orientation() const { return m_orientation; } |
| 125 FontWidthVariant widthVariant() const { return m_widthVariant; } | 125 FontWidthVariant widthVariant() const { return m_widthVariant; } |
| 126 | 126 |
| 127 void setOrientation(FontOrientation orientation) { m_orientation = orientati
on; } | 127 void setOrientation(FontOrientation orientation) { m_orientation = orientati
on; } |
| 128 | 128 |
| 129 #if PLATFORM(CHROMIUM) && OS(DARWIN) | 129 #if OS(DARWIN) |
| 130 HarfBuzzFace* harfBuzzFace(); | 130 HarfBuzzFace* harfBuzzFace(); |
| 131 #endif | 131 #endif |
| 132 | 132 |
| 133 unsigned hash() const | 133 unsigned hash() const |
| 134 { | 134 { |
| 135 #if OS(DARWIN) | 135 #if OS(DARWIN) |
| 136 #if USE(SKIA_ON_MAC_CHROMIUM) | 136 #if USE(SKIA_ON_MAC_CHROMIUM) |
| 137 ASSERT(m_font || !m_cgFont); | 137 ASSERT(m_font || !m_cgFont); |
| 138 #endif | 138 #endif |
| 139 uintptr_t hashCodes[3] = { (uintptr_t)m_font, m_widthVariant, static_cas
t<uintptr_t>(m_isPrinterFont << 3 | m_orientation << 2 | m_syntheticBold << 1 |
m_syntheticOblique) }; | 139 uintptr_t hashCodes[3] = { (uintptr_t)m_font, m_widthVariant, static_cas
t<uintptr_t>(m_isPrinterFont << 3 | m_orientation << 2 | m_syntheticBold << 1 |
m_syntheticOblique) }; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 private: | 194 private: |
| 195 #if OS(DARWIN) | 195 #if OS(DARWIN) |
| 196 NSFont* m_font; | 196 NSFont* m_font; |
| 197 #endif | 197 #endif |
| 198 | 198 |
| 199 #if USE(SKIA_ON_MAC_CHROMIUM) | 199 #if USE(SKIA_ON_MAC_CHROMIUM) |
| 200 RetainPtr<CGFontRef> m_cgFont; | 200 RetainPtr<CGFontRef> m_cgFont; |
| 201 mutable RetainPtr<CTFontRef> m_CTFont; | 201 mutable RetainPtr<CTFontRef> m_CTFont; |
| 202 #endif | 202 #endif |
| 203 | 203 |
| 204 #if PLATFORM(CHROMIUM) && OS(DARWIN) | 204 #if OS(DARWIN) |
| 205 RefPtr<MemoryActivatedFont> m_inMemoryFont; | 205 RefPtr<MemoryActivatedFont> m_inMemoryFont; |
| 206 RefPtr<HarfBuzzFace> m_harfBuzzFace; | 206 RefPtr<HarfBuzzFace> m_harfBuzzFace; |
| 207 #endif | 207 #endif |
| 208 | 208 |
| 209 bool m_isColorBitmapFont; | 209 bool m_isColorBitmapFont; |
| 210 bool m_isCompositeFontReference; | 210 bool m_isCompositeFontReference; |
| 211 #if OS(DARWIN) | 211 #if OS(DARWIN) |
| 212 bool m_isPrinterFont; | 212 bool m_isPrinterFont; |
| 213 #endif | 213 #endif |
| 214 }; | 214 }; |
| 215 | 215 |
| 216 } // namespace WebCore | 216 } // namespace WebCore |
| 217 | 217 |
| 218 #endif // FontPlatformData_h | 218 #endif // FontPlatformData_h |
| 219 | 219 |
| 220 #endif | 220 #endif |
| OLD | NEW |