| 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 21 matching lines...) Expand all Loading... |
| 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 "wtf/Forward.h" | 37 #include "wtf/Forward.h" |
| 38 #include "wtf/Noncopyable.h" | 38 #include "wtf/Noncopyable.h" |
| 39 #include "wtf/RefPtr.h" | 39 #include "wtf/RefPtr.h" |
| 40 #include "wtf/text/WTFString.h" | 40 #include "wtf/text/WTFString.h" |
| 41 | 41 |
| 42 #if OS(MACOSX) | |
| 43 #include "wtf/RetainPtr.h" | |
| 44 #include <CoreFoundation/CFBase.h> | |
| 45 typedef struct CGFont* CGFontRef; | |
| 46 #endif | |
| 47 | |
| 48 class SkTypeface; | 42 class SkTypeface; |
| 49 | 43 |
| 50 namespace blink { | 44 namespace blink { |
| 51 | 45 |
| 52 class FontPlatformData; | 46 class FontPlatformData; |
| 53 class SharedBuffer; | 47 class SharedBuffer; |
| 54 | 48 |
| 55 class PLATFORM_EXPORT FontCustomPlatformData { | 49 class PLATFORM_EXPORT FontCustomPlatformData { |
| 56 WTF_MAKE_NONCOPYABLE(FontCustomPlatformData); | 50 WTF_MAKE_NONCOPYABLE(FontCustomPlatformData); |
| 57 public: | 51 public: |
| 58 static PassOwnPtr<FontCustomPlatformData> create(SharedBuffer*); | 52 static PassOwnPtr<FontCustomPlatformData> create(SharedBuffer*); |
| 59 ~FontCustomPlatformData(); | 53 ~FontCustomPlatformData(); |
| 60 | 54 |
| 61 FontPlatformData fontPlatformData(float size, bool bold, bool italic, FontOr
ientation = Horizontal); | 55 FontPlatformData fontPlatformData(float size, bool bold, bool italic, FontOr
ientation = Horizontal); |
| 62 | 56 |
| 63 static bool supportsFormat(const String&); | 57 static bool supportsFormat(const String&); |
| 64 | 58 |
| 65 private: | 59 private: |
| 66 #if OS(MACOSX) | |
| 67 explicit FontCustomPlatformData(CGFontRef, PassRefPtr<SkTypeface>); | |
| 68 RetainPtr<CGFontRef> m_cgFont; | |
| 69 #else | |
| 70 explicit FontCustomPlatformData(PassRefPtr<SkTypeface>); | 60 explicit FontCustomPlatformData(PassRefPtr<SkTypeface>); |
| 71 #endif | |
| 72 RefPtr<SkTypeface> m_typeface; | 61 RefPtr<SkTypeface> m_typeface; |
| 73 }; | 62 }; |
| 74 | 63 |
| 75 } // namespace blink | 64 } // namespace blink |
| 76 | 65 |
| 77 #endif // FontCustomPlatformData_h | 66 #endif // FontCustomPlatformData_h |
| OLD | NEW |