remove unused ptr/len parameters from CreateTypeface

Review URL: https://codereview.appspot.com/6201056

git-svn-id: http://skia.googlecode.com/svn/trunk@3862 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
reed@google.com 2012-05-07 21:06:55 +00:00
Родитель 15fa138f22
Коммит 0389d93314
13 изменённых файлов: 8 добавлений и 38 удалений

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

@ -50,15 +50,13 @@ class SK_API SkFontHost {
public:
/** Return a new, closest matching typeface given either an existing family
(specified by a typeface in that family) or by a familyName and a
requested style, or by a set of Unicode codepoitns to cover in a given
style.
requested style.
1) If familyFace is null, use familyName.
2) If familyName is null, use data (UTF-16 to cover).
3) If all are null, return the default font that best matches style
*/
static SkTypeface* CreateTypeface(const SkTypeface* familyFace,
const char familyName[],
const void* data, size_t bytelength,
SkTypeface::Style style);
/** Return a new typeface given the data buffer. If the data does not

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

@ -85,18 +85,6 @@ public:
*/
static SkTypeface* CreateFromName(const char familyName[], Style style);
/** Return a new reference to the typeface that covers a set of Unicode
code points with the specified Style. Use this call if you want to
pick any font that covers a given string of text.
@param data UTF-16 characters
@param bytelength length of data, in bytes
@return reference to the closest-matching typeface. Call must call
unref() when they are done.
*/
static SkTypeface* CreateForChars(const void* data, size_t bytelength,
Style s);
/** Return a new reference to the typeface that most closely matches the
requested typeface and specified Style. Use this call if you want to
pick a new style from the same family of the existing typeface.

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

@ -42,8 +42,7 @@ static SkTypeface* get_default_typeface() {
if (NULL == gDefaultTypeface) {
gDefaultTypeface =
SkFontHost::CreateTypeface(NULL, NULL, NULL, 0,
SkTypeface::kNormal);
SkFontHost::CreateTypeface(NULL, NULL, SkTypeface::kNormal);
}
return gDefaultTypeface;
}
@ -62,16 +61,11 @@ bool SkTypeface::Equal(const SkTypeface* facea, const SkTypeface* faceb) {
///////////////////////////////////////////////////////////////////////////////
SkTypeface* SkTypeface::CreateFromName(const char name[], Style style) {
return SkFontHost::CreateTypeface(NULL, name, NULL, 0, style);
}
SkTypeface* SkTypeface::CreateForChars(const void* data, size_t bytelength,
Style s) {
return SkFontHost::CreateTypeface(NULL, NULL, data, bytelength, s);
return SkFontHost::CreateTypeface(NULL, name, style);
}
SkTypeface* SkTypeface::CreateFromTypeface(const SkTypeface* family, Style s) {
return SkFontHost::CreateTypeface(family, NULL, NULL, 0, s);
return SkFontHost::CreateTypeface(family, NULL, s);
}
SkTypeface* SkTypeface::CreateFromStream(SkStream* stream) {

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

@ -233,7 +233,6 @@ static uint32_t ptr2uint32(const void* p)
SkTypeface* SkFontHost::CreateTypeface(const SkTypeface* familyFace,
const char familyName[],
const void* data, size_t bytelength,
SkTypeface::Style style)
{
const FontFamilyRec* family;

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

@ -813,7 +813,7 @@ SkTypeface* SkFontHost::Deserialize(SkStream* stream) {
for (int j = i; j >= 0; --j) {
if (rec[j].fNames != NULL) {
return SkFontHost::CreateTypeface(NULL,
rec[j].fNames[0], NULL, 0,
rec[j].fNames[0],
(SkTypeface::Style)style);
}
}
@ -828,7 +828,6 @@ SkTypeface* SkFontHost::Deserialize(SkStream* stream) {
SkTypeface* SkFontHost::CreateTypeface(const SkTypeface* familyFace,
const char familyName[],
const void* data, size_t bytelength,
SkTypeface::Style style) {
SkAutoMutexAcquire ac(gFamilyHeadAndNameListMutex);

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

@ -208,7 +208,6 @@ static unsigned FileIdFromFilename(const char* filename)
// static
SkTypeface* SkFontHost::CreateTypeface(const SkTypeface* familyFace,
const char familyName[],
const void* data, size_t bytelength,
SkTypeface::Style style)
{
const char* resolved_family_name = NULL;

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

@ -51,7 +51,6 @@ static SkTypeface* ref_default_typeface() {
SkTypeface* SkFontHost::CreateTypeface(const SkTypeface* familyFace,
const char familyName[],
const void* data, size_t bytelength,
SkTypeface::Style style) {
return ref_default_typeface();
}

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

@ -500,14 +500,14 @@ SkTypeface* SkFontHost::Deserialize(SkStream* stream) {
// backup until we hit the fNames
for (int j = i; j >= 0; --j) {
if (rec[j].fNames != NULL) {
return SkFontHost::CreateTypeface(NULL, rec[j].fNames[0], NULL, 0,
return SkFontHost::CreateTypeface(NULL, rec[j].fNames[0],
(SkTypeface::Style)style);
}
}
}
}
}
return SkFontHost::CreateTypeface(NULL, NULL, NULL, 0, (SkTypeface::Style)style);
return SkFontHost::CreateTypeface(NULL, NULL, (SkTypeface::Style)style);
#endif
sk_throw();
return NULL;
@ -517,7 +517,6 @@ SkTypeface* SkFontHost::Deserialize(SkStream* stream) {
SkTypeface* SkFontHost::CreateTypeface(const SkTypeface* familyFace,
const char familyName[],
const void* data, size_t bytelength,
SkTypeface::Style style) {
load_system_fonts();

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

@ -494,7 +494,6 @@ SkFontID SkFontHost::NextLogicalFont(SkFontID currFontID, SkFontID origFontID) {
SkTypeface* SkFontHost::CreateTypeface(const SkTypeface* familyFace,
const char familyName[],
const void* data, size_t bytelength,
SkTypeface::Style style) {
// todo: we don't know how to respect style bits
if (NULL == familyName && NULL != familyFace) {

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

@ -526,7 +526,6 @@ static const char* map_css_names(const char* name) {
SkTypeface* SkFontHost::CreateTypeface(const SkTypeface* familyFace,
const char familyName[],
const void* data, size_t bytelength,
SkTypeface::Style style) {
if (familyName) {
familyName = map_css_names(familyName);

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

@ -11,7 +11,6 @@
SkTypeface* SkFontHost::CreateTypeface(const SkTypeface* familyFace,
const char famillyName[],
const void* data, size_t bytelength,
SkTypeface::Style style) {
SkDEBUGFAIL("SkFontHost::FindTypeface unimplemented");
return NULL;

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

@ -519,7 +519,7 @@ SkTypeface* SkFontHost::Deserialize(SkStream* stream) {
for (int j = i; j >= 0; --j) {
if (rec[j].fNames != NULL) {
return SkFontHost::CreateTypeface(NULL,
rec[j].fNames[0], NULL, 0, (SkTypeface::Style)style);
rec[j].fNames[0], (SkTypeface::Style)style);
}
}
}
@ -532,7 +532,6 @@ SkTypeface* SkFontHost::Deserialize(SkStream* stream) {
SkTypeface* SkFontHost::CreateTypeface(const SkTypeface* familyFace,
const char familyName[],
const void* data, size_t bytelength,
SkTypeface::Style style) {
load_system_fonts();

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

@ -1350,7 +1350,6 @@ SkScalerContext* SkFontHost::CreateScalerContext(const SkDescriptor* desc) {
SkTypeface* SkFontHost::CreateTypeface(const SkTypeface* familyFace,
const char familyName[],
const void* data, size_t bytelength,
SkTypeface::Style style) {
LOGFONT lf;
if (NULL == familyFace && NULL == familyName) {