Chromium Code Reviews| Index: tests/PDFPrimitivesTest.cpp |
| diff --git a/tests/PDFPrimitivesTest.cpp b/tests/PDFPrimitivesTest.cpp |
| index 3253fcaf711a01a8afdcc11ffa8d183859ab02bf..12f8e0818348047010f7a59765f3073355f97a67 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." |
| @@ -415,3 +418,18 @@ 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) { |
| + SkPDFCanon canon; |
| + SkAutoTUnref<SkTypeface> noEmbedTypeface( |
| + GetResourceAsTypeface("Roboto2-Regular_NoEmbed.ttf")); |
|
bungeman-skia
2015/10/12 19:26:30
update location?
hal.canary
2015/10/12 19:48:24
Done.
|
| + REPORTER_ASSERT(reporter, |
| + !SkPDFFont::CanEmbedTypeface(noEmbedTypeface, &canon)); |
| + |
| + SkAutoTUnref<SkTypeface> portableTypeface( |
| + sk_tool_utils::create_portable_typeface(NULL, SkTypeface::kNormal)); |
| + REPORTER_ASSERT(reporter, |
| + SkPDFFont::CanEmbedTypeface(portableTypeface, &canon)); |
| +} |