summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/graphics/mac
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2008-10-21 07:00:00 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2008-10-21 07:00:00 -0700
commit9364f22aed35e1a1e9d07c121510f80be3ab0502 (patch)
treed49911209b132da58d838efa852daf28d516df21 /WebCore/platform/graphics/mac
parent87eb0cb35bad8784770ebc807e6c982432e47107 (diff)
downloadexternal_webkit-9364f22aed35e1a1e9d07c121510f80be3ab0502.zip
external_webkit-9364f22aed35e1a1e9d07c121510f80be3ab0502.tar.gz
external_webkit-9364f22aed35e1a1e9d07c121510f80be3ab0502.tar.bz2
Initial Contribution
Diffstat (limited to 'WebCore/platform/graphics/mac')
-rw-r--r--WebCore/platform/graphics/mac/IconMac.mm4
-rw-r--r--WebCore/platform/graphics/mac/ImageMac.mm1
-rw-r--r--WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm13
-rw-r--r--WebCore/platform/graphics/mac/SimpleFontDataMac.mm53
4 files changed, 11 insertions, 60 deletions
diff --git a/WebCore/platform/graphics/mac/IconMac.mm b/WebCore/platform/graphics/mac/IconMac.mm
index b630ba6..cda73a0 100644
--- a/WebCore/platform/graphics/mac/IconMac.mm
+++ b/WebCore/platform/graphics/mac/IconMac.mm
@@ -29,13 +29,11 @@
namespace WebCore {
Icon::Icon()
- : RefCounted<Icon>(0)
{
}
Icon::Icon(NSImage *image)
- : RefCounted<Icon>(0)
- , m_nsImage(image)
+ : m_nsImage(image)
{
// Need this because WebCore uses AppKit's flipped coordinate system exclusively.
[image setFlipped:YES];
diff --git a/WebCore/platform/graphics/mac/ImageMac.mm b/WebCore/platform/graphics/mac/ImageMac.mm
index 121eb78..0b14d71 100644
--- a/WebCore/platform/graphics/mac/ImageMac.mm
+++ b/WebCore/platform/graphics/mac/ImageMac.mm
@@ -31,6 +31,7 @@
#import "GraphicsContext.h"
#import "PlatformString.h"
#import "WebCoreFrameBridge.h"
+#import "WebCoreSystemInterface.h"
namespace WebCore {
diff --git a/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm b/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm
index 541d5f6..85c7a9e 100644
--- a/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm
+++ b/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2007 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -163,12 +163,11 @@ void MediaPlayerPrivate::createQTMovie(const String& url)
m_qtMovie = 0;
// Disable streaming support for now, <rdar://problem/5693967>
- if (protocolIs(url, "rtsp"))
+ if (url.startsWith("rtsp:"))
return;
-
- NSURL *cocoaURL = KURL(url);
- NSDictionary *movieAttributes = [NSDictionary dictionaryWithObjectsAndKeys:
- cocoaURL, QTMovieURLAttribute,
+
+ NSDictionary* movieAttributes = [NSDictionary dictionaryWithObjectsAndKeys:
+ KURL(url.deprecatedString()).getNSURL(), QTMovieURLAttribute,
[NSNumber numberWithBool:YES], QTMoviePreventExternalURLLinksAttribute,
[NSNumber numberWithBool:YES], QTSecurityPolicyNoCrossSiteAttribute,
nil];
@@ -177,7 +176,7 @@ void MediaPlayerPrivate::createQTMovie(const String& url)
m_qtMovie.adoptNS([[QTMovie alloc] initWithAttributes:movieAttributes error:&error]);
// FIXME: Find a proper way to detect streaming content.
- m_isStreaming = protocolIs(url, "rtsp");
+ m_isStreaming = url.startsWith("rtsp:");
if (!m_qtMovie)
return;
diff --git a/WebCore/platform/graphics/mac/SimpleFontDataMac.mm b/WebCore/platform/graphics/mac/SimpleFontDataMac.mm
index 5d90514..1f45c94 100644
--- a/WebCore/platform/graphics/mac/SimpleFontDataMac.mm
+++ b/WebCore/platform/graphics/mac/SimpleFontDataMac.mm
@@ -62,7 +62,7 @@ bool initFontData(SimpleFontData* fontData)
ATSUStyle fontStyle;
if (ATSUCreateStyle(&fontStyle) != noErr)
return false;
-
+
ATSUFontID fontId = fontData->m_font.m_atsuFontID;
if (!fontId) {
ATSUDisposeStyle(fontStyle);
@@ -96,45 +96,6 @@ static NSString *webFallbackFontFamily(void)
return webFallbackFontFamily.get();
}
-#if !ERROR_DISABLED
-#ifdef __LP64__
-static NSString* pathFromFont(NSFont*)
-{
- // FMGetATSFontRefFromFont is not available in 64-bit. As pathFromFont is only used for debugging
- // purposes, returning nil is acceptable.
- return nil;
-}
-#else
-static NSString* pathFromFont(NSFont *font)
-{
- ATSFontRef atsFont = FMGetATSFontRefFromFont(wkGetNSFontATSUFontId(font));
- FSRef fileRef;
-
-#ifndef BUILDING_ON_TIGER
- OSStatus status = ATSFontGetFileReference(atsFont, &fileRef);
- if (status != noErr)
- return nil;
-#else
- FSSpec oFile;
- OSStatus status = ATSFontGetFileSpecification(atsFont, &oFile);
- if (status != noErr)
- return nil;
-
- status = FSpMakeFSRef(&oFile, &fileRef);
- if (status != noErr)
- return nil;
-#endif
-
- UInt8 filePathBuffer[PATH_MAX];
- status = FSRefMakePath(&fileRef, filePathBuffer, PATH_MAX);
- if (status == noErr)
- return [NSString stringWithUTF8String:(const char*)filePathBuffer];
-
- return nil;
-}
-#endif // __LP64__
-#endif // !ERROR_DISABLED
-
void SimpleFontData::platformInit()
{
m_styleGroup = 0;
@@ -167,7 +128,7 @@ void SimpleFontData::platformInit()
#endif
m_font.setFont([[NSFontManager sharedFontManager] convertFont:m_font.font() toFamily:fallbackFontFamily]);
#if !ERROR_DISABLED
- NSString *filePath = pathFromFont(initialFont.get());
+ NSString *filePath = wkPathFromFont(initialFont.get());
if (!filePath)
filePath = @"not known";
#endif
@@ -204,15 +165,7 @@ void SimpleFontData::platformInit()
int iAscent;
int iDescent;
int iLineGap;
-#ifdef BUILDING_ON_TIGER
- wkGetFontMetrics(m_font.m_cgFont, &iAscent, &iDescent, &iLineGap, &m_unitsPerEm);
-#else
- iAscent = CGFontGetAscent(m_font.m_cgFont);
- iDescent = CGFontGetDescent(m_font.m_cgFont);
- iLineGap = CGFontGetLeading(m_font.m_cgFont);
- m_unitsPerEm = CGFontGetUnitsPerEm(m_font.m_cgFont);
-#endif
-
+ wkGetFontMetrics(m_font.m_cgFont, &iAscent, &iDescent, &iLineGap, &m_unitsPerEm);
float pointSize = m_font.m_size;
float fAscent = scaleEmToUnits(iAscent, m_unitsPerEm) * pointSize;
float fDescent = -scaleEmToUnits(iDescent, m_unitsPerEm) * pointSize;