| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2006, 2007, 2008, Google Inc. All rights reserved. | 2 * Copyright (c) 2006, 2007, 2008, Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 #define FontPlatformData_h | 32 #define FontPlatformData_h |
| 33 | 33 |
| 34 #include "SkPaint.h" | 34 #include "SkPaint.h" |
| 35 #include "SkTypeface.h" | 35 #include "SkTypeface.h" |
| 36 #include "platform/PlatformExport.h" | 36 #include "platform/PlatformExport.h" |
| 37 #include "platform/SharedBuffer.h" | 37 #include "platform/SharedBuffer.h" |
| 38 #include "platform/fonts/FontDescription.h" | 38 #include "platform/fonts/FontDescription.h" |
| 39 #include "platform/fonts/FontOrientation.h" | 39 #include "platform/fonts/FontOrientation.h" |
| 40 #include "platform/fonts/SmallCapsIterator.h" | 40 #include "platform/fonts/SmallCapsIterator.h" |
| 41 #include "platform/fonts/opentype/OpenTypeVerticalData.h" | 41 #include "platform/fonts/opentype/OpenTypeVerticalData.h" |
| 42 #include "third_party/skia/include/core/SkRefCnt.h" |
| 42 #include "wtf/Allocator.h" | 43 #include "wtf/Allocator.h" |
| 43 #include "wtf/Forward.h" | 44 #include "wtf/Forward.h" |
| 44 #include "wtf/HashTableDeletedValueType.h" | 45 #include "wtf/HashTableDeletedValueType.h" |
| 45 #include "wtf/RefPtr.h" | 46 #include "wtf/RefPtr.h" |
| 46 #include "wtf/text/CString.h" | 47 #include "wtf/text/CString.h" |
| 47 #include "wtf/text/StringImpl.h" | 48 #include "wtf/text/StringImpl.h" |
| 48 | 49 |
| 49 #if OS(LINUX) || OS(ANDROID) | 50 #if OS(LINUX) || OS(ANDROID) |
| 50 #include "platform/fonts/linux/FontRenderStyle.h" | 51 #include "platform/fonts/linux/FontRenderStyle.h" |
| 51 #endif // OS(LINUX) || OS(ANDROID) | 52 #endif // OS(LINUX) || OS(ANDROID) |
| (...skipping 28 matching lines...) Expand all Loading... |
| 80 // from the 0 one (created with the empty constructor), so we can't just | 81 // from the 0 one (created with the empty constructor), so we can't just |
| 81 // set everything to 0. | 82 // set everything to 0. |
| 82 FontPlatformData(WTF::HashTableDeletedValueType); | 83 FontPlatformData(WTF::HashTableDeletedValueType); |
| 83 FontPlatformData(); | 84 FontPlatformData(); |
| 84 FontPlatformData(const FontPlatformData&); | 85 FontPlatformData(const FontPlatformData&); |
| 85 FontPlatformData(float size, bool syntheticBold, bool syntheticItalic, FontO
rientation = FontOrientation::Horizontal); | 86 FontPlatformData(float size, bool syntheticBold, bool syntheticItalic, FontO
rientation = FontOrientation::Horizontal); |
| 86 FontPlatformData(const FontPlatformData& src, float textSize); | 87 FontPlatformData(const FontPlatformData& src, float textSize); |
| 87 #if OS(MACOSX) | 88 #if OS(MACOSX) |
| 88 FontPlatformData(NSFont*, float size, bool syntheticBold = false, bool synth
eticItalic = false, FontOrientation = FontOrientation::Horizontal); | 89 FontPlatformData(NSFont*, float size, bool syntheticBold = false, bool synth
eticItalic = false, FontOrientation = FontOrientation::Horizontal); |
| 89 #endif | 90 #endif |
| 90 FontPlatformData(PassRefPtr<SkTypeface>, const char* name, float textSize, b
ool syntheticBold, bool syntheticItalic, FontOrientation = FontOrientation::Hori
zontal); | 91 FontPlatformData(sk_sp<SkTypeface>, const char* name, float textSize, bool s
yntheticBold, bool syntheticItalic, FontOrientation = FontOrientation::Horizonta
l); |
| 91 ~FontPlatformData(); | 92 ~FontPlatformData(); |
| 92 | 93 |
| 93 #if OS(MACOSX) | 94 #if OS(MACOSX) |
| 94 CTFontRef ctFont() const; | 95 CTFontRef ctFont() const; |
| 95 CGFontRef cgFont() const; | 96 CGFontRef cgFont() const; |
| 96 #endif | 97 #endif |
| 97 | 98 |
| 98 String fontFamilyName() const; | 99 String fontFamilyName() const; |
| 99 float size() const { return m_textSize; } | 100 float size() const { return m_textSize; } |
| 100 bool syntheticBold() const { return m_syntheticBold; } | 101 bool syntheticBold() const { return m_syntheticBold; } |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 | 135 |
| 135 #if OS(WIN) | 136 #if OS(WIN) |
| 136 int paintTextFlags() const { return m_paintTextFlags; } | 137 int paintTextFlags() const { return m_paintTextFlags; } |
| 137 #endif | 138 #endif |
| 138 | 139 |
| 139 private: | 140 private: |
| 140 #if OS(WIN) | 141 #if OS(WIN) |
| 141 void querySystemForRenderStyle(); | 142 void querySystemForRenderStyle(); |
| 142 #endif | 143 #endif |
| 143 | 144 |
| 144 RefPtr<SkTypeface> m_typeface; | 145 sk_sp<SkTypeface> m_typeface; |
| 145 #if !OS(WIN) | 146 #if !OS(WIN) |
| 146 CString m_family; | 147 CString m_family; |
| 147 #endif | 148 #endif |
| 148 | 149 |
| 149 public: | 150 public: |
| 150 float m_textSize; | 151 float m_textSize; |
| 151 bool m_syntheticBold; | 152 bool m_syntheticBold; |
| 152 bool m_syntheticItalic; | 153 bool m_syntheticItalic; |
| 153 FontOrientation m_orientation; | 154 FontOrientation m_orientation; |
| 154 private: | 155 private: |
| 155 #if OS(LINUX) || OS(ANDROID) | 156 #if OS(LINUX) || OS(ANDROID) |
| 156 FontRenderStyle m_style; | 157 FontRenderStyle m_style; |
| 157 #endif | 158 #endif |
| 158 | 159 |
| 159 mutable RefPtr<HarfBuzzFace> m_harfBuzzFace; | 160 mutable RefPtr<HarfBuzzFace> m_harfBuzzFace; |
| 160 bool m_isHashTableDeletedValue; | 161 bool m_isHashTableDeletedValue; |
| 161 #if OS(WIN) | 162 #if OS(WIN) |
| 162 int m_paintTextFlags; | 163 int m_paintTextFlags; |
| 163 unsigned m_minSizeForAntiAlias; | 164 unsigned m_minSizeForAntiAlias; |
| 164 float m_minSizeForSubpixel; | 165 float m_minSizeForSubpixel; |
| 165 #endif | 166 #endif |
| 166 }; | 167 }; |
| 167 | 168 |
| 168 } // namespace blink | 169 } // namespace blink |
| 169 | 170 |
| 170 #endif // ifdef FontPlatformData_h | 171 #endif // ifdef FontPlatformData_h |
| OLD | NEW |