Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1846)

Unified Diff: Source/platform/fonts/FontPlatformData.h

Issue 879533003: Remove Mac native font type members from FontPlatformData (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Canvas text metrics test does not need rebaselining after improvement landed, toNSFont in WebSubstringUtil.mm Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/fonts/FontCustomPlatformData.cpp ('k') | Source/platform/fonts/FontPlatformData.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/FontPlatformData.h
diff --git a/Source/platform/fonts/FontPlatformData.h b/Source/platform/fonts/FontPlatformData.h
index 87dcd1c43e86bce63760485e4c134caba2a8a721..0eaf1dbc6be692c83792a7e198c0d9d6072ce2f9 100644
--- a/Source/platform/fonts/FontPlatformData.h
+++ b/Source/platform/fonts/FontPlatformData.h
@@ -50,11 +50,10 @@ OBJC_CLASS NSFont;
typedef struct CGFont* CGFontRef;
typedef const struct __CTFont* CTFontRef;
-#include "platform/fonts/mac/MemoryActivatedFont.h"
-#include <CoreFoundation/CFBase.h>
#include <objc/objc-auto.h>
inline CTFontRef toCTFontRef(NSFont *nsFont) { return reinterpret_cast<CTFontRef>(nsFont); }
+inline NSFont* toNSFont(CTFontRef ctFontRef) { return const_cast<NSFont*>(reinterpret_cast<const NSFont*>(ctFontRef)); }
#endif // OS(MACOSX)
class SkTypeface;
@@ -80,24 +79,13 @@ public:
FontPlatformData(const FontPlatformData& src, float textSize);
#if OS(MACOSX)
FontPlatformData(NSFont*, float size, bool syntheticBold = false, bool syntheticItalic = false, FontOrientation = Horizontal);
- FontPlatformData(CGFontRef, PassRefPtr<SkTypeface>, float size, bool syntheticBold, bool syntheticOblique, FontOrientation);
-#else
- FontPlatformData(PassRefPtr<SkTypeface>, const char* name, float textSize, bool syntheticBold, bool syntheticItalic, FontOrientation = Horizontal, bool subpixelTextPosition = defaultUseSubpixelPositioning());
#endif
+ FontPlatformData(PassRefPtr<SkTypeface>, const char* name, float textSize, bool syntheticBold, bool syntheticItalic, FontOrientation = Horizontal, bool subpixelTextPosition = defaultUseSubpixelPositioning());
~FontPlatformData();
#if OS(MACOSX)
- NSFont* font() const { return m_font; }
- void setFont(NSFont*);
-
- CGFontRef cgFont() const { return m_cgFont.get(); }
CTFontRef ctFont() const;
-
- bool roundsGlyphAdvances() const;
- bool allowsLigatures() const;
-
- bool isColorBitmapFont() const { return m_isColorBitmapFont; }
- bool isCompositeFontReference() const { return m_isCompositeFontReference; }
+ CGFontRef cgFont() const;
#endif
String fontFamilyName() const;
@@ -152,20 +140,9 @@ public:
#endif
private:
-#if !OS(MACOSX)
bool static defaultUseSubpixelPositioning();
+#if !OS(MACOSX)
void querySystemForRenderStyle(bool useSkiaSubpixelPositioning);
-#else
- // Load various data about the font specified by |nsFont| with the size fontSize into the following output paramters:
- // Note: Callers should always take into account that for the Chromium port, |outNSFont| isn't necessarily the same
- // font as |nsFont|. This because the sandbox may block loading of the original font.
- // * outNSFont - The font that was actually loaded, for the Chromium port this may be different than nsFont.
- // The caller is responsible for calling CFRelease() on this parameter when done with it.
- // * cgFont - CGFontRef representing the input font at the specified point size.
- void loadFont(NSFont*, float fontSize, NSFont*& outNSFont, CGFontRef&);
- void platformDataInit(const FontPlatformData&);
- const FontPlatformData& platformDataAssign(const FontPlatformData&);
- bool isAATFont(CTFontRef) const;
#endif
mutable RefPtr<SkTypeface> m_typeface;
@@ -178,17 +155,8 @@ public:
bool m_syntheticBold;
bool m_syntheticItalic;
FontOrientation m_orientation;
-#if OS(MACOSX)
- bool m_isColorBitmapFont;
- bool m_isCompositeFontReference;
-#endif
private:
-#if OS(MACOSX)
- NSFont* m_font;
- RetainPtr<CGFontRef> m_cgFont;
- mutable RetainPtr<CTFontRef> m_CTFont;
- RefPtr<MemoryActivatedFont> m_inMemoryFont;
-#else
+#if !OS(MACOSX)
FontRenderStyle m_style;
#endif
« no previous file with comments | « Source/platform/fonts/FontCustomPlatformData.cpp ('k') | Source/platform/fonts/FontPlatformData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698