| 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 14 matching lines...) Expand all Loading... |
| 25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 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 "SkTypeface.h" |
| 35 #include "platform/PlatformExport.h" | 36 #include "platform/PlatformExport.h" |
| 36 #include "platform/fonts/FontOrientation.h" | 37 #include "platform/fonts/FontOrientation.h" |
| 37 #include "wtf/Forward.h" | 38 #include "wtf/Forward.h" |
| 38 #include "wtf/Noncopyable.h" | 39 #include "wtf/Noncopyable.h" |
| 39 #include "wtf/RefPtr.h" | 40 #include "wtf/RefPtr.h" |
| 40 #include "wtf/text/WTFString.h" | 41 #include "wtf/text/WTFString.h" |
| 41 | 42 |
| 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; | 43 class SkTypeface; |
| 49 | 44 |
| 50 namespace blink { | 45 namespace blink { |
| 51 | 46 |
| 52 class FontPlatformData; | 47 class FontPlatformData; |
| 53 class SharedBuffer; | 48 class SharedBuffer; |
| 54 | 49 |
| 55 class PLATFORM_EXPORT FontCustomPlatformData { | 50 class PLATFORM_EXPORT FontCustomPlatformData { |
| 56 WTF_MAKE_NONCOPYABLE(FontCustomPlatformData); | 51 WTF_MAKE_NONCOPYABLE(FontCustomPlatformData); |
| 57 public: | 52 public: |
| 58 static PassOwnPtr<FontCustomPlatformData> create(SharedBuffer*); | 53 static PassOwnPtr<FontCustomPlatformData> create(SharedBuffer*); |
| 59 ~FontCustomPlatformData(); | 54 ~FontCustomPlatformData(); |
| 60 | 55 |
| 61 FontPlatformData fontPlatformData(float size, bool bold, bool italic, FontOr
ientation = Horizontal); | 56 FontPlatformData fontPlatformData(float size, bool bold, bool italic, FontOr
ientation = Horizontal); |
| 62 | 57 |
| 63 static bool supportsFormat(const String&); | 58 static bool supportsFormat(const String&); |
| 64 | 59 |
| 65 private: | 60 private: |
| 66 #if OS(MACOSX) | 61 // TODO(dro): Move this back to the implementation file. |
| 67 explicit FontCustomPlatformData(CGFontRef, PassRefPtr<SkTypeface>); | 62 explicit FontCustomPlatformData(PassRefPtr<SkTypeface> typeface) |
| 68 RetainPtr<CGFontRef> m_cgFont; | 63 : m_typeface(typeface) { }; |
| 69 #else | 64 |
| 70 explicit FontCustomPlatformData(PassRefPtr<SkTypeface>); | |
| 71 #endif | |
| 72 RefPtr<SkTypeface> m_typeface; | 65 RefPtr<SkTypeface> m_typeface; |
| 73 }; | 66 }; |
| 74 | 67 |
| 75 } // namespace blink | 68 } // namespace blink |
| 76 | 69 |
| 77 #endif // FontCustomPlatformData_h | 70 #endif // FontCustomPlatformData_h |
| OLD | NEW |