From 9138e027c8fd35f0eca7f649e0789ea368b5c7c4 Mon Sep 17 00:00:00 2001 From: George Wright Date: Sun, 27 Jul 2014 20:57:19 -0400 Subject: [PATCH] [PATCH 06/15] Bug 1017113 - Update SkFontHost_android_old.cpp and SkFontHost_cairo.cpp to cater for Skia API changes r=mattwoodrow --- gfx/skia/trunk/src/ports/SkFontHost_android_old.cpp | 8 ++------ gfx/skia/trunk/src/ports/SkFontHost_cairo.cpp | 6 ++---- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/gfx/skia/trunk/src/ports/SkFontHost_android_old.cpp b/gfx/skia/trunk/src/ports/SkFontHost_android_old.cpp index 7d8c7c50af5..5079c54e8c0 100644 --- a/gfx/skia/trunk/src/ports/SkFontHost_android_old.cpp +++ b/gfx/skia/trunk/src/ports/SkFontHost_android_old.cpp @@ -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 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)); diff --git a/gfx/skia/trunk/src/ports/SkFontHost_cairo.cpp b/gfx/skia/trunk/src/ports/SkFontHost_cairo.cpp index ec5d2fcb0c3..43c745b4164 100644 --- a/gfx/skia/trunk/src/ports/SkFontHost_cairo.cpp +++ b/gfx/skia/trunk/src/ports/SkFontHost_cairo.cpp @@ -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")); }