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

Unified Diff: tests/PDFPrimitivesTest.cpp

Issue 1157163007: SkPDF: fall back on paths for unembeddable fonts. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-07-15 (Wednesday) 10:13:03 EDT Created 5 years, 5 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
« src/ports/SkFontHost_win.cpp ('K') | « src/ports/SkFontHost_win.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/PDFPrimitivesTest.cpp
diff --git a/tests/PDFPrimitivesTest.cpp b/tests/PDFPrimitivesTest.cpp
index 013d58657bce3a69d84dfec530135f7449ade97b..a76a7472b5950caea2540b2325a2a75c32674906 100644
--- a/tests/PDFPrimitivesTest.cpp
+++ b/tests/PDFPrimitivesTest.cpp
@@ -5,6 +5,7 @@
* found in the LICENSE file.
*/
+#include "Resources.h"
#include "SkBitmap.h"
#include "SkCanvas.h"
#include "SkData.h"
@@ -14,6 +15,7 @@
#include "SkMatrix.h"
#include "SkPDFCanon.h"
#include "SkPDFDevice.h"
+#include "SkPDFFont.h"
#include "SkPDFStream.h"
#include "SkPDFTypes.h"
#include "SkReadBuffer.h"
@@ -21,6 +23,7 @@
#include "SkStream.h"
#include "SkTypes.h"
#include "Test.h"
+#include "sk_tool_utils.h"
#define DUMMY_TEXT "DCT compessed stream."
@@ -413,3 +416,15 @@ DEF_TEST(PDFImageFilter, reporter) {
// Filter was used in rendering; should be visited.
REPORTER_ASSERT(reporter, filter->visited());
}
+
+// Check that PDF rendering of image filters successfully falls back to
+// CPU rasterization.
+DEF_TEST(PDFFontCanEmbedTypeface, reporter) {
+ SkAutoTUnref<SkTypeface> noEmbedTypeface(
+ GetResourceAsTypeface("Roboto2-Regular_NoEmbed.ttf"));
+ REPORTER_ASSERT(reporter, !SkPDFFont::CanEmbedTypeface(noEmbedTypeface));
+
+ SkAutoTUnref<SkTypeface> portableTypeface(
+ sk_tool_utils::create_portable_typeface(NULL, SkTypeface::kNormal));
+ REPORTER_ASSERT(reporter, SkPDFFont::CanEmbedTypeface(portableTypeface));
+}
« src/ports/SkFontHost_win.cpp ('K') | « src/ports/SkFontHost_win.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698