Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2080)

Unified Diff: tests/FontHostStreamTest.cpp

Issue 353993003: Fix SkTypeface::serialize() on Mac by properly indicating local fonts (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: avoid caching fonts created from stream Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ports/SkFontHost_mac.cpp ('k') | tests/SerializationTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/FontHostStreamTest.cpp
diff --git a/tests/FontHostStreamTest.cpp b/tests/FontHostStreamTest.cpp
index 5f959f3b87eefc1cfbc3bdd75b3a40d03b1c58ce..a2254fd5413f6055fd8098ed14a29703ec1cd42a 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);
« no previous file with comments | « src/ports/SkFontHost_mac.cpp ('k') | tests/SerializationTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698