+2008-09-09 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Darin Adler.
+
+ - WebCore part of <rdar://problem/6206244> Use alternate character-to-glyph interface on Leopard
+
+ * WebCore.Tiger.exp:
+ * WebCore.base.exp:
+ * platform/graphics/SimpleFontData.h:
+ * platform/graphics/mac/GlyphPageTreeNodeMac.cpp:
+ (WebCore::GlyphPage::fill):
+ * platform/graphics/mac/SimpleFontDataMac.mm:
+ (WebCore::initFontData):
+ (WebCore::SimpleFontData::platformInit):
+ (WebCore::SimpleFontData::platformDestroy):
+ * platform/mac/WebCoreSystemInterface.h:
+ * platform/mac/WebCoreSystemInterface.mm:
+
2008-09-09 Kevin McCullough <kmccullough@apple.com>
Reviewed by Tim.
+_wkClearGlyphVector
+_wkCopyFullFontName
+_wkGetATSStyleGroup
_wkGetCGFontFromNSFont
_wkGetFontMetrics
+_wkGetGlyphVectorFirstRecord
+_wkGetGlyphVectorNumGlyphs
+_wkGetGlyphVectorRecordSize
_wkGetNSFontATSUFontId
+_wkInitializeGlyphVector
+_wkReleaseStyleGroup
_wkSupportsMultipartXMixedReplace
-_wkCopyFullFontName
+
.objc_class_name_DOMAbstractView
.objc_class_name_DOMAttr
.objc_class_name_DOMCDATASection
_suggestedFilenameWithMIMEType
_wkAdvanceDefaultButtonPulseAnimation
_wkCGContextGetShouldSmoothFonts
-_wkClearGlyphVector
_wkConvertCharToGlyphs
_wkCreateCustomCFReadStream
_wkCreateNSURLConnectionDelegateProxy
_wkDrawMediaSliderTrack
_wkDrawMediaUnMuteButton
_wkDrawTextFieldCellFocusRing
-_wkGetATSStyleGroup
_wkGetExtensionsForMIMEType
_wkGetFontInLanguageForCharacter
_wkGetFontInLanguageForRange
_wkGetGlyphTransformedAdvances
-_wkGetGlyphVectorFirstRecord
-_wkGetGlyphVectorNumGlyphs
-_wkGetGlyphVectorRecordSize
+_wkGetGlyphsForCharacters
_wkGetMIMETypeForExtension
_wkGetNSURLResponseCalculatedExpiration
_wkGetNSURLResponseLastModifiedDate
_wkGetNSURLResponseMustRevalidate
_wkGetPreferredExtensionForMIMEType
_wkGetWheelEventDeltas
-_wkInitializeGlyphVector
_wkPopupMenu
_wkQTMovieDataRate
_wkQTMovieMaxTimeLoaded
_wkQTMovieViewSetDrawSynchronously
-_wkReleaseStyleGroup
_wkSetCGFontRenderingMode
_wkSetDragImage
_wkSetNSURLConnectionDefersCallbacks
_wkSignalCFReadStreamEnd
_wkSignalCFReadStreamError
_wkSignalCFReadStreamHasBytes
-
#endif
#if PLATFORM(MAC)
+#ifdef BUILDING_ON_TIGER
void* m_styleGroup;
+#endif
#if USE(ATSUI)
mutable ATSUStyle m_ATSUStyle;
mutable bool m_ATSUStyleInitialized;
bool GlyphPage::fill(unsigned offset, unsigned length, UChar* buffer, unsigned bufferLength, const SimpleFontData* fontData)
{
+ bool haveGlyphs = false;
+
+#ifndef BUILDING_ON_TIGER
+ Vector<CGGlyph, 512> glyphs(bufferLength);
+ wkGetGlyphsForCharacters(fontData->platformData().cgFont(), buffer, glyphs.data(), bufferLength);
+
+ for (unsigned i = 0; i < length; ++i) {
+ if (!glyphs[i])
+ setGlyphDataForIndex(offset + i, 0, 0);
+ else {
+ setGlyphDataForIndex(offset + i, glyphs[i], fontData);
+ haveGlyphs = true;
+ }
+ }
+#else
// Use an array of long so we get good enough alignment.
long glyphVector[(GLYPH_VECTOR_SIZE + sizeof(long) - 1) / sizeof(long)];
return false;
}
- bool haveGlyphs = false;
ATSLayoutRecord* glyphRecord = (ATSLayoutRecord*)wkGetGlyphVectorFirstRecord(glyphVector);
for (unsigned i = 0; i < length; i++) {
Glyph glyph = glyphRecord->glyphID;
glyphRecord = (ATSLayoutRecord *)((char *)glyphRecord + wkGetGlyphVectorRecordSize(glyphVector));
}
wkClearGlyphVector(&glyphVector);
+#endif
return haveGlyphs;
}
if (!fontData->m_font.cgFont())
return false;
+#ifdef BUILDING_ON_TIGER
ATSUStyle fontStyle;
if (ATSUCreateStyle(&fontStyle) != noErr)
return false;
}
ATSUDisposeStyle(fontStyle);
+#endif
return true;
}
void SimpleFontData::platformInit()
{
+#ifdef BUILDING_ON_TIGER
m_styleGroup = 0;
+#endif
#if USE(ATSUI)
m_ATSUStyleInitialized = false;
m_ATSUMirrors = false;
void SimpleFontData::platformDestroy()
{
+#ifdef BUILDING_ON_TIGER
if (m_styleGroup)
wkReleaseStyleGroup(m_styleGroup);
+#endif
#if USE(ATSUI)
if (m_ATSUStyleInitialized)
ATSUDisposeStyle(m_ATSUStyle);
extern "C" {
#endif
-#define GLYPH_VECTOR_SIZE (50 * 32)
-
// In alphabetical order.
extern void (*wkAdvanceDefaultButtonPulseAnimation)(NSButtonCell *);
extern BOOL (*wkCGContextGetShouldSmoothFonts)(CGContextRef);
-extern void (*wkClearGlyphVector)(void* glyphs);
extern CFReadStreamRef (*wkCreateCustomCFReadStream)(void *(*formCreate)(CFReadStreamRef, void *),
void (*formFinalize)(CFReadStreamRef, void *),
Boolean (*formOpen)(CFReadStreamRef, CFStreamError *, Boolean *, void *),
void (*formSchedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
void (*formUnschedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
void *context);
-extern OSStatus (*wkConvertCharToGlyphs)(void* styleGroup, const UniChar*, unsigned numCharacters, void* glyphs);
extern id (*wkCreateNSURLConnectionDelegateProxy)(void);
extern void (*wkDrawBezeledTextFieldCell)(NSRect, BOOL enabled);
extern void (*wkDrawTextFieldCellFocusRing)(NSTextFieldCell*, NSRect);
extern void (*wkDrawCapsLockIndicator)(CGContextRef, CGRect);
extern void (*wkDrawBezeledTextArea)(NSRect, BOOL enabled);
extern void (*wkDrawFocusRing)(CGContextRef, CGColorRef, int radius);
-extern OSStatus (*wkGetATSStyleGroup)(ATSUStyle, void** styleGroup);
-extern CGFontRef (*wkGetCGFontFromNSFont)(NSFont*);
extern NSFont* (*wkGetFontInLanguageForRange)(NSFont*, NSString*, NSRange);
extern NSFont* (*wkGetFontInLanguageForCharacter)(NSFont*, UniChar);
extern BOOL (*wkGetGlyphTransformedAdvances)(CGFontRef, NSFont*, CGAffineTransform*, ATSGlyphRef*, CGSize* advance);
-extern ATSLayoutRecord* (*wkGetGlyphVectorFirstRecord)(void* glyphVector);
-extern int (*wkGetGlyphVectorNumGlyphs)(void* glyphVector);
-extern size_t (*wkGetGlyphVectorRecordSize)(void* glyphVector);
extern void (*wkDrawMediaFullscreenButton)(CGContextRef context, CGRect rect, BOOL active);
extern void (*wkDrawMediaMuteButton)(CGContextRef context, CGRect rect, BOOL active);
extern void (*wkDrawMediaPauseButton)(CGContextRef context, CGRect rect, BOOL active);
extern NSDate *(*wkGetNSURLResponseLastModifiedDate)(NSURLResponse *response);
extern BOOL (*wkGetNSURLResponseMustRevalidate)(NSURLResponse *response);
extern void (*wkGetWheelEventDeltas)(NSEvent*, float* deltaX, float* deltaY, BOOL* continuous);
-extern OSStatus (*wkInitializeGlyphVector)(int count, void* glyphs);
extern void (*wkPopupMenu)(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*);
extern int (*wkQTMovieDataRate)(QTMovie*);
extern float (*wkQTMovieMaxTimeLoaded)(QTMovie*);
extern void (*wkQTMovieViewSetDrawSynchronously)(QTMovieView*, BOOL);
-extern void (*wkReleaseStyleGroup)(void* group);
extern void (*wkSetCGFontRenderingMode)(CGContextRef, NSFont*);
extern void (*wkSetDragImage)(NSImage*, NSPoint offset);
extern void (*wkSetNSURLConnectionDefersCallbacks)(NSURLConnection *, BOOL);
extern void (*wkSignalCFReadStreamError)(CFReadStreamRef stream, CFStreamError *error);
extern void (*wkSignalCFReadStreamHasBytes)(CFReadStreamRef stream);
-#ifdef BUILDING_ON_TIGER
-extern void (*wkGetFontMetrics)(CGFontRef, int* ascent, int* descent, int* lineGap, unsigned* unitsPerEm);
+#ifndef BUILDING_ON_TIGER
+extern void* wkConvertCharToGlyphs;
+extern void (*wkGetGlyphsForCharacters)(CGFontRef, const UniChar[], CGGlyph[], size_t);
+#else
+#define GLYPH_VECTOR_SIZE (50 * 32)
+
+extern void (*wkClearGlyphVector)(void* glyphs);
+extern OSStatus (*wkConvertCharToGlyphs)(void* styleGroup, const UniChar*, unsigned numCharacters, void* glyphs);
extern CFStringRef (*wkCopyFullFontName)(CGFontRef font);
+extern OSStatus (*wkGetATSStyleGroup)(ATSUStyle, void** styleGroup);
+extern CGFontRef (*wkGetCGFontFromNSFont)(NSFont*);
+extern void (*wkGetFontMetrics)(CGFontRef, int* ascent, int* descent, int* lineGap, unsigned* unitsPerEm);
+extern ATSLayoutRecord* (*wkGetGlyphVectorFirstRecord)(void* glyphVector);
+extern int (*wkGetGlyphVectorNumGlyphs)(void* glyphVector);
+extern size_t (*wkGetGlyphVectorRecordSize)(void* glyphVector);
+extern OSStatus (*wkInitializeGlyphVector)(int count, void* glyphs);
+extern void (*wkReleaseStyleGroup)(void* group);
extern BOOL (*wkSupportsMultipartXMixedReplace)(NSMutableURLRequest *);
#endif
void (*wkAdvanceDefaultButtonPulseAnimation)(NSButtonCell *);
BOOL (*wkCGContextGetShouldSmoothFonts)(CGContextRef);
-void (*wkClearGlyphVector)(void* glyphs);
-OSStatus (*wkConvertCharToGlyphs)(void* styleGroup, const UniChar*, unsigned numCharacters, void* glyphs);
NSString* (*wkCreateURLPasteboardFlavorTypeName)(void);
NSString* (*wkCreateURLNPasteboardFlavorTypeName)(void);
void (*wkDrawBezeledTextFieldCell)(NSRect, BOOL enabled);
void (*wkDrawCapsLockIndicator)(CGContextRef, CGRect);
void (*wkDrawBezeledTextArea)(NSRect, BOOL enabled);
void (*wkDrawFocusRing)(CGContextRef, CGColorRef, int radius);
-OSStatus (*wkGetATSStyleGroup)(ATSUStyle, void** styleGroup);
NSFont* (*wkGetFontInLanguageForRange)(NSFont*, NSString*, NSRange);
NSFont* (*wkGetFontInLanguageForCharacter)(NSFont*, UniChar);
BOOL (*wkGetGlyphTransformedAdvances)(CGFontRef, NSFont*, CGAffineTransform*, ATSGlyphRef*, CGSize* advance);
-ATSLayoutRecord* (*wkGetGlyphVectorFirstRecord)(void* glyphVector);
-int (*wkGetGlyphVectorNumGlyphs)(void* glyphVector);
-size_t (*wkGetGlyphVectorRecordSize)(void* glyphVector);
void (*wkDrawMediaFullscreenButton)(CGContextRef context, CGRect rect, BOOL active);
void (*wkDrawMediaMuteButton)(CGContextRef context, CGRect rect, BOOL active);
void (*wkDrawMediaPauseButton)(CGContextRef context, CGRect rect, BOOL active);
NSDate *(*wkGetNSURLResponseLastModifiedDate)(NSURLResponse *response);
BOOL (*wkGetNSURLResponseMustRevalidate)(NSURLResponse *response);
void (*wkGetWheelEventDeltas)(NSEvent*, float* deltaX, float* deltaY, BOOL* continuous);
-OSStatus (*wkInitializeGlyphVector)(int count, void* glyphs);
void (*wkPopupMenu)(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*);
int (*wkQTMovieDataRate)(QTMovie*);
float (*wkQTMovieMaxTimeLoaded)(QTMovie*);
void (*wkQTMovieViewSetDrawSynchronously)(QTMovieView*, BOOL);
-void (*wkReleaseStyleGroup)(void* group);
void (*wkSetCGFontRenderingMode)(CGContextRef, NSFont*);
void (*wkSetDragImage)(NSImage*, NSPoint offset);
void (*wkSetPatternBaseCTM)(CGContextRef, CGAffineTransform);
void (*wkSetNSURLRequestShouldContentSniff)(NSMutableURLRequest *, BOOL);
id (*wkCreateNSURLConnectionDelegateProxy)(void);
-#ifdef BUILDING_ON_TIGER
+#ifndef BUILDING_ON_TIGER
+void* wkConvertCharToGlyphs;
+void (*wkGetGlyphsForCharacters)(CGFontRef, const UniChar[], CGGlyph[], size_t);
+#else
+void (*wkClearGlyphVector)(void* glyphs);
+OSStatus (*wkConvertCharToGlyphs)(void* styleGroup, const UniChar*, unsigned numCharacters, void* glyphs);
+CFStringRef (*wkCopyFullFontName)(CGFontRef font);
+OSStatus (*wkGetATSStyleGroup)(ATSUStyle, void** styleGroup);
CGFontRef (*wkGetCGFontFromNSFont)(NSFont*);
void (*wkGetFontMetrics)(CGFontRef, int* ascent, int* descent, int* lineGap, unsigned* unitsPerEm);
+ATSLayoutRecord* (*wkGetGlyphVectorFirstRecord)(void* glyphVector);
+int (*wkGetGlyphVectorNumGlyphs)(void* glyphVector);
+size_t (*wkGetGlyphVectorRecordSize)(void* glyphVector);
+OSStatus (*wkInitializeGlyphVector)(int count, void* glyphs);
+void (*wkReleaseStyleGroup)(void* group);
ATSUFontID (*wkGetNSFontATSUFontId)(NSFont*);
-CFStringRef (*wkCopyFullFontName)(CGFontRef font);
BOOL (*wkSupportsMultipartXMixedReplace)(NSMutableURLRequest *);
#endif
+2008-09-09 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Darin Adler.
+
+ - WebKit part of <rdar://problem/6206244> Use alternate character-to-glyph interface on Leopard
+
+ * WebCoreSupport/WebSystemInterface.m:
+ (InitWebCoreSystemInterface):
+
2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Maciej Stachowiak.
INIT(AdvanceDefaultButtonPulseAnimation);
INIT(CGContextGetShouldSmoothFonts);
- INIT(ClearGlyphVector);
- INIT(ConvertCharToGlyphs);
INIT(CreateCustomCFReadStream);
INIT(CreateNSURLConnectionDelegateProxy);
INIT(DrawCapsLockIndicator);
INIT(DrawMediaSliderThumb);
INIT(DrawMediaUnMuteButton);
INIT(DrawTextFieldCellFocusRing);
- INIT(GetATSStyleGroup);
INIT(GetExtensionsForMIMEType);
INIT(GetFontInLanguageForCharacter);
INIT(GetFontInLanguageForRange);
+ INIT(GetGlyphsForCharacters);
INIT(GetGlyphTransformedAdvances);
- INIT(GetGlyphVectorFirstRecord);
- INIT(GetGlyphVectorNumGlyphs);
- INIT(GetGlyphVectorRecordSize);
INIT(GetMIMETypeForExtension);
INIT(GetNSURLResponseLastModifiedDate);
INIT(GetPreferredExtensionForMIMEType);
INIT(GetWheelEventDeltas);
- INIT(InitializeGlyphVector);
INIT(PopupMenu);
- INIT(ReleaseStyleGroup);
INIT(SetCGFontRenderingMode);
INIT(SetDragImage);
INIT(SetNSURLConnectionDefersCallbacks);
INIT(QTMovieViewSetDrawSynchronously);
#ifdef BUILDING_ON_TIGER
+ INIT(ClearGlyphVector);
+ INIT(ConvertCharToGlyphs);
+ INIT(CopyFullFontName);
+ INIT(GetATSStyleGroup);
INIT(GetCGFontFromNSFont);
INIT(GetFontMetrics);
+ INIT(GetGlyphVectorFirstRecord);
+ INIT(GetGlyphVectorNumGlyphs);
+ INIT(GetGlyphVectorRecordSize);
INIT(GetNSFontATSUFontId);
- INIT(CopyFullFontName);
+ INIT(InitializeGlyphVector);
+ INIT(ReleaseStyleGroup);
INIT(SupportsMultipartXMixedReplace);
#endif
+2008-09-09 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Darin Adler.
+
+ - WebKitLibraries part of <rdar://problem/6206244> Use alternate character-to-glyph interface on Leopard
+
+ * WebKitSystemInterface.h:
+ * libWebKitSystemInterfaceLeopard.a:
+
2008-09-04 Adam Roben <aroben@apple.com>
Ignore warning LNK4221 on Windows
NSFont *WKGetFontInLanguageForRange(NSFont *font, NSString *string, NSRange range);
NSFont *WKGetFontInLanguageForCharacter(NSFont *font, UniChar ch);
void WKSetCGFontRenderingMode(CGContextRef cgContext, NSFont *font);
-void WKReleaseStyleGroup(void *group);
BOOL WKCGContextGetShouldSmoothFonts(CGContextRef cgContext);
#ifdef BUILDING_ON_TIGER
void WKSetPatternBaseCTM(CGContextRef, CGAffineTransform);
void WKSetPatternPhaseInUserSpace(CGContextRef, CGPoint);
+#ifndef BUILDING_ON_TIGER
+void WKGetGlyphsForCharacters(CGFontRef, const UniChar[], CGGlyph[], size_t);
+#else
typedef void *WKGlyphVectorRef;
OSStatus WKConvertCharToGlyphs(void *styleGroup, const UniChar *characters, unsigned numCharacters, WKGlyphVectorRef glyphs);
OSStatus WKGetATSStyleGroup(ATSUStyle fontStyle, void **styleGroup);
+void WKReleaseStyleGroup(void *group);
OSStatus WKInitializeGlyphVector(int count, WKGlyphVectorRef glyphs);
void WKClearGlyphVector(WKGlyphVectorRef glyphs);
int WKGetGlyphVectorNumGlyphs(WKGlyphVectorRef glyphVector);
ATSLayoutRecord *WKGetGlyphVectorFirstRecord(WKGlyphVectorRef glyphVector);
size_t WKGetGlyphVectorRecordSize(WKGlyphVectorRef glyphVector);
+#endif
#ifndef __LP64__
NSEvent *WKCreateNSEventWithCarbonEvent(EventRef eventRef);