From 26337e970201cae39f44b49546b8d9b0bc5e5c98 Mon Sep 17 00:00:00 2001 From: caseq Date: Mon, 30 Jun 2014 12:14:52 -0700 Subject: Fix SkTypeface::serialize() on Mac by properly indicating local fonts We used to always set isLocalStream to false in SkTypeface_Mac::onGetFontDescriptor(), which caused SkTypeface::serialize() to never actually serialize fonts. BUG=skia:2698 R=reed@google.com, bungeman@google.com Author: caseq@chromium.org Review URL: https://codereview.chromium.org/353993003 --- tests/FontHostStreamTest.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/FontHostStreamTest.cpp') diff --git a/tests/FontHostStreamTest.cpp b/tests/FontHostStreamTest.cpp index 5f959f3b87..a2254fd541 100644 --- a/tests/FontHostStreamTest.cpp +++ b/tests/FontHostStreamTest.cpp @@ -8,6 +8,7 @@ #include "SkBitmap.h" #include "SkCanvas.h" #include "SkColor.h" +#include "SkFontDescriptor.h" #include "SkFontHost.h" #include "SkGraphics.h" #include "SkPaint.h" @@ -98,6 +99,12 @@ DEF_TEST(FontHostStream, reporter) { int ttcIndex; SkAutoTUnref fontData(origTypeface->openStream(&ttcIndex)); SkTypeface* streamTypeface = SkTypeface::CreateFromStream(fontData); + + SkFontDescriptor desc; + bool isLocalStream = false; + streamTypeface->getFontDescriptor(&desc, &isLocalStream); + REPORTER_ASSERT(reporter, isLocalStream); + SkSafeUnref(paint.setTypeface(streamTypeface)); drawBG(&streamCanvas); streamCanvas.drawPosText("A", 1, &point, paint); -- cgit v1.2.3