зеркало из https://github.com/mozilla/moz-skia.git
Landing arm patch from contributor.
http://codereview.appspot.com/5649055 git-svn-id: http://skia.googlecode.com/svn/trunk@3541 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
Родитель
54924243c1
Коммит
bff29d59ee
|
@ -29,6 +29,10 @@ static void S32A_D565_Opaque_neon(uint16_t* SK_RESTRICT dst,
|
|||
"vmov.u8 d31, #1<<7 \n\t"
|
||||
"vld1.16 {q12}, [%[dst]] \n\t"
|
||||
"vld4.8 {d0-d3}, [%[src]] \n\t"
|
||||
// Thumb does not support the standard ARM conditional
|
||||
// instructions but instead requires the 'it' instruction
|
||||
// to signal conditional execution
|
||||
"it eq \n\t"
|
||||
"moveq ip, #8 \n\t"
|
||||
"mov %[keep_dst], %[dst] \n\t"
|
||||
|
||||
|
|
|
@ -464,53 +464,43 @@ static void load_system_fonts() {
|
|||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void SkFontHost::Serialize(const SkTypeface* face, SkWStream* stream) {
|
||||
#if 0
|
||||
const char* name = ((FamilyTypeface*)face)->getUniqueString();
|
||||
|
||||
stream->write8((uint8_t)face->getStyle());
|
||||
|
||||
if (NULL == name || 0 == *name) {
|
||||
stream->writePackedUInt(0);
|
||||
// SkDebugf("--- fonthost serialize null\n");
|
||||
} else {
|
||||
uint32_t len = strlen(name);
|
||||
stream->writePackedUInt(len);
|
||||
stream->write(name, len);
|
||||
// SkDebugf("--- fonthost serialize <%s> %d\n", name, face->getStyle());
|
||||
}
|
||||
#endif
|
||||
sk_throw();
|
||||
SkStream* fontStream = ((FamilyTypeface*)face)->openStream();
|
||||
|
||||
// store the length of the custom font
|
||||
uint32_t len = fontStream->getLength();
|
||||
stream->write32(len);
|
||||
|
||||
// store the entire font in the serialized stream
|
||||
void* fontData = malloc(len);
|
||||
|
||||
fontStream->read(fontData, len);
|
||||
stream->write(fontData, len);
|
||||
|
||||
fontStream->unref();
|
||||
free(fontData);
|
||||
|
||||
|
||||
// sk_throw();
|
||||
}
|
||||
|
||||
SkTypeface* SkFontHost::Deserialize(SkStream* stream) {
|
||||
#if 0
|
||||
load_system_fonts();
|
||||
|
||||
int style = stream->readU8();
|
||||
|
||||
int len = stream->readPackedUInt();
|
||||
if (len > 0) {
|
||||
SkString str;
|
||||
str.resize(len);
|
||||
stream->read(str.writable_str(), len);
|
||||
|
||||
const FontInitRec* rec = gSystemFonts;
|
||||
for (size_t i = 0; i < SK_ARRAY_COUNT(gSystemFonts); i++) {
|
||||
if (strcmp(rec[i].fFileName, str.c_str()) == 0) {
|
||||
// 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,
|
||||
(SkTypeface::Style)style);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return SkFontHost::CreateTypeface(NULL, NULL, NULL, 0, (SkTypeface::Style)style);
|
||||
#endif
|
||||
sk_throw();
|
||||
return NULL;
|
||||
|
||||
// read the length of the custom font from the stream
|
||||
uint32_t len = stream->readU32();
|
||||
|
||||
// generate a new stream to store the custom typeface
|
||||
SkMemoryStream* fontStream = new SkMemoryStream(len);
|
||||
stream->read((void*)fontStream->getMemoryBase(), len);
|
||||
|
||||
SkTypeface* face = CreateTypefaceFromStream(fontStream);
|
||||
|
||||
fontStream->unref();
|
||||
|
||||
return face;
|
||||
|
||||
// sk_throw();
|
||||
// return NULL;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Загрузка…
Ссылка в новой задаче