OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Apple Computer, Inc. | 2 * Copyright (C) 2007 Apple Computer, Inc. |
3 * Copyright (c) 2007, 2008, 2009, Google Inc. All rights reserved. | 3 * Copyright (c) 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 16 matching lines...) Expand all Loading... |
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
30 */ | 30 */ |
31 | 31 |
32 #ifndef FontCustomPlatformData_h | 32 #ifndef FontCustomPlatformData_h |
33 #define FontCustomPlatformData_h | 33 #define FontCustomPlatformData_h |
34 | 34 |
35 #include "platform/PlatformExport.h" | 35 #include "platform/PlatformExport.h" |
36 #include "platform/fonts/FontOrientation.h" | 36 #include "platform/fonts/FontOrientation.h" |
37 #include "platform/fonts/FontWidthVariant.h" | |
38 #include "wtf/Forward.h" | 37 #include "wtf/Forward.h" |
39 #include "wtf/Noncopyable.h" | 38 #include "wtf/Noncopyable.h" |
40 #include "wtf/RefPtr.h" | 39 #include "wtf/RefPtr.h" |
41 #include "wtf/text/WTFString.h" | 40 #include "wtf/text/WTFString.h" |
42 | 41 |
43 #if OS(MACOSX) | 42 #if OS(MACOSX) |
44 #include "wtf/RetainPtr.h" | 43 #include "wtf/RetainPtr.h" |
45 #include <CoreFoundation/CFBase.h> | 44 #include <CoreFoundation/CFBase.h> |
46 typedef struct CGFont* CGFontRef; | 45 typedef struct CGFont* CGFontRef; |
47 #endif | 46 #endif |
48 | 47 |
49 class SkTypeface; | 48 class SkTypeface; |
50 | 49 |
51 namespace blink { | 50 namespace blink { |
52 | 51 |
53 class FontPlatformData; | 52 class FontPlatformData; |
54 class SharedBuffer; | 53 class SharedBuffer; |
55 | 54 |
56 class PLATFORM_EXPORT FontCustomPlatformData { | 55 class PLATFORM_EXPORT FontCustomPlatformData { |
57 WTF_MAKE_NONCOPYABLE(FontCustomPlatformData); | 56 WTF_MAKE_NONCOPYABLE(FontCustomPlatformData); |
58 public: | 57 public: |
59 static PassOwnPtr<FontCustomPlatformData> create(SharedBuffer*); | 58 static PassOwnPtr<FontCustomPlatformData> create(SharedBuffer*); |
60 ~FontCustomPlatformData(); | 59 ~FontCustomPlatformData(); |
61 | 60 |
62 FontPlatformData fontPlatformData(float size, bool bold, bool italic, FontOr
ientation = Horizontal, FontWidthVariant = RegularWidth); | 61 FontPlatformData fontPlatformData(float size, bool bold, bool italic, FontOr
ientation = Horizontal); |
63 | 62 |
64 static bool supportsFormat(const String&); | 63 static bool supportsFormat(const String&); |
65 | 64 |
66 private: | 65 private: |
67 #if OS(MACOSX) | 66 #if OS(MACOSX) |
68 explicit FontCustomPlatformData(CGFontRef, PassRefPtr<SkTypeface>); | 67 explicit FontCustomPlatformData(CGFontRef, PassRefPtr<SkTypeface>); |
69 RetainPtr<CGFontRef> m_cgFont; | 68 RetainPtr<CGFontRef> m_cgFont; |
70 #else | 69 #else |
71 explicit FontCustomPlatformData(PassRefPtr<SkTypeface>); | 70 explicit FontCustomPlatformData(PassRefPtr<SkTypeface>); |
72 #endif | 71 #endif |
73 RefPtr<SkTypeface> m_typeface; | 72 RefPtr<SkTypeface> m_typeface; |
74 }; | 73 }; |
75 | 74 |
76 } // namespace blink | 75 } // namespace blink |
77 | 76 |
78 #endif // FontCustomPlatformData_h | 77 #endif // FontCustomPlatformData_h |
OLD | NEW |