SkSfntUtils should use public types.
git-svn-id: http://skia.googlecode.com/svn/trunk@4734 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
1bb4be2384
commit
aa8483b49d
@ -11,7 +11,6 @@
|
|||||||
#include "SkFontHost.h"
|
#include "SkFontHost.h"
|
||||||
#include "SkPaint.h"
|
#include "SkPaint.h"
|
||||||
#include "SkRandom.h"
|
#include "SkRandom.h"
|
||||||
#include "SkSfntUtils.h"
|
|
||||||
#include "SkString.h"
|
#include "SkString.h"
|
||||||
#include "SkTemplates.h"
|
#include "SkTemplates.h"
|
||||||
|
|
||||||
|
@ -10,7 +10,6 @@
|
|||||||
#include "SkFontHost.h"
|
#include "SkFontHost.h"
|
||||||
#include "SkPaint.h"
|
#include "SkPaint.h"
|
||||||
#include "SkRandom.h"
|
#include "SkRandom.h"
|
||||||
#include "SkSfntUtils.h"
|
|
||||||
#include "SkString.h"
|
#include "SkString.h"
|
||||||
#include "SkTemplates.h"
|
#include "SkTemplates.h"
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
#define SkSfntUtils_DEFINED
|
#define SkSfntUtils_DEFINED
|
||||||
|
|
||||||
#include "Sk64.h"
|
#include "Sk64.h"
|
||||||
#include "SkFontHost.h"
|
#include "SkTypeface.h"
|
||||||
|
|
||||||
struct SkSfntTable_head {
|
struct SkSfntTable_head {
|
||||||
SkFixed fVersion;
|
SkFixed fVersion;
|
||||||
@ -52,8 +52,8 @@ struct SkSfntTable_maxp {
|
|||||||
|
|
||||||
class SkSfntUtils {
|
class SkSfntUtils {
|
||||||
public:
|
public:
|
||||||
static bool ReadTable_head(SkFontID, SkSfntTable_head*);
|
static bool ReadTable_head(SkTypeface&, SkSfntTable_head*);
|
||||||
static bool ReadTable_maxp(SkFontID, SkSfntTable_maxp*);
|
static bool ReadTable_maxp(SkTypeface&, SkSfntTable_maxp*);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -30,12 +30,12 @@ static Sk64 parse_be64(const uint8_t*& p) {
|
|||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
bool SkSfntUtils::ReadTable_head(SkFontID fontID, SkSfntTable_head* head) {
|
bool SkSfntUtils::ReadTable_head(SkTypeface& typeface, SkSfntTable_head* head) {
|
||||||
static const uint32_t gTag = SkSetFourByteTag('h', 'e', 'a', 'd');
|
static const uint32_t gTag = SkSetFourByteTag('h', 'e', 'a', 'd');
|
||||||
static const size_t gSize = 54;
|
static const size_t gSize = 54;
|
||||||
|
|
||||||
uint8_t storage[gSize];
|
uint8_t storage[gSize];
|
||||||
size_t size = SkFontHost::GetTableData(fontID, gTag, 0, gSize, storage);
|
size_t size = typeface.getTableData(gTag, 0, gSize, storage);
|
||||||
if (size != gSize) {
|
if (size != gSize) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -62,12 +62,12 @@ bool SkSfntUtils::ReadTable_head(SkFontID fontID, SkSfntTable_head* head) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SkSfntUtils::ReadTable_maxp(SkFontID fontID, SkSfntTable_maxp* maxp) {
|
bool SkSfntUtils::ReadTable_maxp(SkTypeface& typeface, SkSfntTable_maxp* maxp) {
|
||||||
static const uint32_t gTag = SkSetFourByteTag('m', 'a', 'x', 'p');
|
static const uint32_t gTag = SkSetFourByteTag('m', 'a', 'x', 'p');
|
||||||
static const size_t gSize = 32;
|
static const size_t gSize = 32;
|
||||||
|
|
||||||
uint8_t storage[gSize];
|
uint8_t storage[gSize];
|
||||||
size_t size = SkFontHost::GetTableData(fontID, gTag, 0, gSize, storage);
|
size_t size = typeface.getTableData(gTag, 0, gSize, storage);
|
||||||
if (size != gSize) {
|
if (size != gSize) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user