aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/FontHostStreamTest.cpp
diff options
context:
space:
mode:
authorGravatar caseq <caseq@chromium.org>2014-06-30 12:14:52 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-06-30 12:14:52 -0700
commit26337e970201cae39f44b49546b8d9b0bc5e5c98 (patch)
tree581ba4e201ee2f2a8ce287dbed6f849fb0b9ce0b /tests/FontHostStreamTest.cpp
parent4eec1566591c838b8579a3aafe2727970338cfe2 (diff)
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
Diffstat (limited to 'tests/FontHostStreamTest.cpp')
-rw-r--r--tests/FontHostStreamTest.cpp7
1 files changed, 7 insertions, 0 deletions
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<SkStream> 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);