Changed mac specific files to use ApplicationServices rather than Carbon

http://codereview.appspot.com/4644053/


git-svn-id: http://skia.googlecode.com/svn/trunk@1658 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
yangsu@google.com 2011-06-21 13:09:32 +00:00
Родитель 2d54d06adc
Коммит ccb74eabcc
6 изменённых файлов: 28 добавлений и 12 удалений

Просмотреть файл

@ -293,6 +293,7 @@
'link_settings': {
'libraries': [
'$(SDKROOT)/System/Library/Frameworks/Carbon.framework',
'$(SDKROOT)/System/Library/Frameworks/ApplicationServices.framework',
],
},
}],

Просмотреть файл

@ -19,8 +19,13 @@
#define SkTypeface_mac_DEFINED
#include "SkTypeface.h"
#include <Carbon/Carbon.h>
#ifdef SK_BUILD_FOR_MAC
#import <ApplicationServices/ApplicationServices.h>
#endif
#ifdef SK_BUILD_FOR_IOS
#include <CoreText/CoreText.h>
#endif
/**
* Like the other Typeface create methods, this returns a new reference to the
* corresponding typeface for the specified CTFontRef. The caller must call

Просмотреть файл

@ -4,9 +4,7 @@
#include "SkTypes.h"
#ifdef SK_BUILD_FOR_MAC
#include <Carbon/Carbon.h>
#else
#include <CoreGraphics/CoreGraphics.h>
#include <ApplicationServices/ApplicationServices.h>
#endif
class SkBitmap;

Просмотреть файл

@ -23,7 +23,12 @@
#endif
#ifdef SK_BUILD_FOR_MAC
#include <Carbon/Carbon.h>
#import <ApplicationServices/ApplicationServices.h>
#endif
#ifdef SK_BUILD_FOR_IOS
#include <CoreText/CoreText.h>
#include <CoreGraphics/CoreGraphics.h>
#endif
namespace skia_advanced_typeface_metrics_utils {
@ -146,7 +151,7 @@ template SkAdvancedTypefaceMetrics::WidthRange* getAdvanceData(
FT_Face face,
int num_glyphs,
bool (*getAdvance)(FT_Face face, int gId, int16_t* data));
#elif defined(SK_BUILD_FOR_MAC)
#elif defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS)
template SkAdvancedTypefaceMetrics::WidthRange* getAdvanceData(
CTFontRef ctFont,
int num_glyphs,

Просмотреть файл

@ -14,7 +14,14 @@
** limitations under the License.
*/
#include <vector>
#include <Carbon/Carbon.h>
#ifdef SK_BUILD_FOR_MAC
#import <ApplicationServices/ApplicationServices.h>
#endif
#ifdef SK_BUILD_FOR_IOS
#include <CoreText/CoreText.h>
#include <CoreGraphics/CoreGraphics.h>
#endif
#include "SkFontHost.h"
#include "SkDescriptor.h"
@ -788,9 +795,9 @@ struct TableEntry {
uint32_t fLength;
};
static uint32 CalcTableCheckSum(uint32 *table, uint32 numberOfBytesInTable) {
uint32 sum = 0;
uint32 nLongs = (numberOfBytesInTable + 3) / 4;
static uint32_t CalcTableCheckSum(uint32_t *table, uint32_t numberOfBytesInTable) {
uint32_t sum = 0;
uint32_t nLongs = (numberOfBytesInTable + 3) / 4;
while (nLongs-- > 0) {
sum += SkEndian_SwapBE32(*table++);
@ -847,7 +854,7 @@ SkStream* SkFontHost::OpenStream(SkFontID uniqueID) {
GetTableData(uniqueID, tableTags[index], 0, tableSize, dataPtr);
entry->fTag = SkEndian_SwapBE32(tableTags[index]);
entry->fCheckSum = SkEndian_SwapBE32(CalcTableCheckSum(
(uint32*)dataPtr, tableSize));
(uint32_t*)dataPtr, tableSize));
entry->fOffset = SkEndian_SwapBE32(dataPtr - dataStart);
entry->fLength = SkEndian_SwapBE32(tableSize);
dataPtr += (tableSize + 3) & ~3;

Просмотреть файл

@ -13,7 +13,7 @@
** limitations under the License.
*/
#include <Carbon/Carbon.h>
#include <ApplicationServices/ApplicationServices.h>
#include "SkImageDecoder.h"
#include "SkImageEncoder.h"
#include "SkMovie.h"