зеркало из https://github.com/mozilla/gecko-dev.git
[PATCH 06/15] Bug 1017113 - Update SkFontHost_android_old.cpp and SkFontHost_cairo.cpp to cater for Skia API changes r=mattwoodrow
This commit is contained in:
Родитель
eaa8ae26b2
Коммит
bd20cd4758
|
@ -25,9 +25,6 @@
|
||||||
#define SK_FONT_FILE_PREFIX "/fonts/"
|
#define SK_FONT_FILE_PREFIX "/fonts/"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool find_name_and_attributes(SkStream* stream, SkString* name, SkTypeface::Style* style,
|
|
||||||
bool* isFixedWidth);
|
|
||||||
|
|
||||||
static void GetFullPathForSysFonts(SkString* full, const char name[]) {
|
static void GetFullPathForSysFonts(SkString* full, const char name[]) {
|
||||||
full->set(getenv("ANDROID_ROOT"));
|
full->set(getenv("ANDROID_ROOT"));
|
||||||
full->append(SK_FONT_FILE_PREFIX);
|
full->append(SK_FONT_FILE_PREFIX);
|
||||||
|
@ -361,8 +358,7 @@ static bool get_name_and_style(const char path[], SkString* name,
|
||||||
|
|
||||||
SkAutoTUnref<SkStream> stream(SkStream::NewFromFile(fullpath.c_str()));
|
SkAutoTUnref<SkStream> stream(SkStream::NewFromFile(fullpath.c_str()));
|
||||||
if (stream.get()) {
|
if (stream.get()) {
|
||||||
find_name_and_attributes(stream, name, style, isFixedWidth);
|
return SkTypeface_FreeType::ScanFont(stream, 0, name, style, isFixedWidth);
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isExpected) {
|
if (isExpected) {
|
||||||
|
@ -570,7 +566,7 @@ SkTypeface* SkFontHost::CreateTypefaceFromStream(SkStream* stream) {
|
||||||
bool isFixedWidth;
|
bool isFixedWidth;
|
||||||
SkString name;
|
SkString name;
|
||||||
SkTypeface::Style style;
|
SkTypeface::Style style;
|
||||||
find_name_and_attributes(stream, &name, &style, &isFixedWidth);
|
SkTypeface_FreeType::ScanFont(stream, 0, &name, &style, &isFixedWidth);
|
||||||
|
|
||||||
if (!name.isEmpty()) {
|
if (!name.isEmpty()) {
|
||||||
return SkNEW_ARGS(StreamTypeface, (style, false, NULL, stream, isFixedWidth));
|
return SkNEW_ARGS(StreamTypeface, (style, false, NULL, stream, isFixedWidth));
|
||||||
|
|
|
@ -38,8 +38,7 @@ protected:
|
||||||
virtual void generateMetrics(SkGlyph* glyph) SK_OVERRIDE;
|
virtual void generateMetrics(SkGlyph* glyph) SK_OVERRIDE;
|
||||||
virtual void generateImage(const SkGlyph& glyph) SK_OVERRIDE;
|
virtual void generateImage(const SkGlyph& glyph) SK_OVERRIDE;
|
||||||
virtual void generatePath(const SkGlyph& glyph, SkPath* path) SK_OVERRIDE;
|
virtual void generatePath(const SkGlyph& glyph, SkPath* path) SK_OVERRIDE;
|
||||||
virtual void generateFontMetrics(SkPaint::FontMetrics* mx,
|
virtual void generateFontMetrics(SkPaint::FontMetrics* metrics) SK_OVERRIDE;
|
||||||
SkPaint::FontMetrics* my) SK_OVERRIDE;
|
|
||||||
virtual SkUnichar generateGlyphToChar(uint16_t glyph) SK_OVERRIDE;
|
virtual SkUnichar generateGlyphToChar(uint16_t glyph) SK_OVERRIDE;
|
||||||
private:
|
private:
|
||||||
cairo_scaled_font_t* fScaledFont;
|
cairo_scaled_font_t* fScaledFont;
|
||||||
|
@ -357,8 +356,7 @@ void SkScalerContext_CairoFT::generatePath(const SkGlyph& glyph, SkPath* path)
|
||||||
generateGlyphPath(face, path);
|
generateGlyphPath(face, path);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SkScalerContext_CairoFT::generateFontMetrics(SkPaint::FontMetrics* mx,
|
void SkScalerContext_CairoFT::generateFontMetrics(SkPaint::FontMetrics* metrics)
|
||||||
SkPaint::FontMetrics* my)
|
|
||||||
{
|
{
|
||||||
SkDEBUGCODE(SkDebugf("SkScalerContext_CairoFT::generateFontMetrics unimplemented\n"));
|
SkDEBUGCODE(SkDebugf("SkScalerContext_CairoFT::generateFontMetrics unimplemented\n"));
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче