[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:
George Wright 2014-07-27 20:57:19 -04:00
parent 8935d080fd
commit 9138e027c8
2 changed files with 4 additions and 10 deletions

View File

@ -25,9 +25,6 @@
#define SK_FONT_FILE_PREFIX "/fonts/"
#endif
bool find_name_and_attributes(SkStream* stream, SkString* name, SkTypeface::Style* style,
bool* isFixedWidth);
static void GetFullPathForSysFonts(SkString* full, const char name[]) {
full->set(getenv("ANDROID_ROOT"));
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()));
if (stream.get()) {
find_name_and_attributes(stream, name, style, isFixedWidth);
return true;
return SkTypeface_FreeType::ScanFont(stream, 0, name, style, isFixedWidth);
}
if (isExpected) {
@ -570,7 +566,7 @@ SkTypeface* SkFontHost::CreateTypefaceFromStream(SkStream* stream) {
bool isFixedWidth;
SkString name;
SkTypeface::Style style;
find_name_and_attributes(stream, &name, &style, &isFixedWidth);
SkTypeface_FreeType::ScanFont(stream, 0, &name, &style, &isFixedWidth);
if (!name.isEmpty()) {
return SkNEW_ARGS(StreamTypeface, (style, false, NULL, stream, isFixedWidth));

View File

@ -38,8 +38,7 @@ protected:
virtual void generateMetrics(SkGlyph* glyph) SK_OVERRIDE;
virtual void generateImage(const SkGlyph& glyph) SK_OVERRIDE;
virtual void generatePath(const SkGlyph& glyph, SkPath* path) SK_OVERRIDE;
virtual void generateFontMetrics(SkPaint::FontMetrics* mx,
SkPaint::FontMetrics* my) SK_OVERRIDE;
virtual void generateFontMetrics(SkPaint::FontMetrics* metrics) SK_OVERRIDE;
virtual SkUnichar generateGlyphToChar(uint16_t glyph) SK_OVERRIDE;
private:
cairo_scaled_font_t* fScaledFont;
@ -357,8 +356,7 @@ void SkScalerContext_CairoFT::generatePath(const SkGlyph& glyph, SkPath* path)
generateGlyphPath(face, path);
}
void SkScalerContext_CairoFT::generateFontMetrics(SkPaint::FontMetrics* mx,
SkPaint::FontMetrics* my)
void SkScalerContext_CairoFT::generateFontMetrics(SkPaint::FontMetrics* metrics)
{
SkDEBUGCODE(SkDebugf("SkScalerContext_CairoFT::generateFontMetrics unimplemented\n"));
}