43 SkCanvas* canvas = doc->beginPage(100, 100);
72 SkCanvas* canvas = doc->beginPage(100, 100);
79 FILE*
file = fopen(
path.c_str(),
"r");
102 SkCanvas* canvas = doc->beginPage(100, 100);
109 FILE*
file = fopen(
path.c_str(),
"r");
121 SkCanvas* canvas = doc->beginPage(100, 100);
143 SkCanvas* canvas = doc->beginPage(64, 64);
144 canvas->
scale(10000.0f, 10000.0f);
147 const char text[] =
"HELLO";
154 for (
size_t i = 0;
i <
N; ++
i) {
167 pdfMetadata.
fTitle =
"test document";
168 pdfMetadata.
fCreation = {0, 1999, 12, 5, 31, 23, 59, 59};
169 pdfMetadata.
fPDFA =
true;
177 static const char* expectations[] = {
179 "<dc:title><rdf:Alt><rdf:li xml:lang=\"x-default\">test document",
180 "<xmp:CreateDate>1999-12-31T23:59:59+00:00</xmp:CreateDate>",
182 "/CreationDate (D:19991231235959+00'00')>>",
189 pdfMetadata.
fProducer =
"phoney library";
190 pdfMetadata.
fPDFA =
true;
196 static const char* moreExpectations[] = {
197 "/Producer (phoney library)",
198 "<pdf:Producer>phoney library</pdf:Producer>",
211 pdfMetadata.
fTitle =
"πππππ πππππ";
212 pdfMetadata.
fAuthor =
"ABCDE FGHIJ";
213 pdfMetadata.
fSubject =
"αβγδΡ ΢ηθικ";
214 pdfMetadata.
fPDFA =
true;
221 static const char* expectations[] = {
222 (
"<</Title <FEFFD835DCD0D835DCD1D835DCD2D835DCD3D835DCD40020"
223 "D835DCD5D835DCD6D835DCD7D835DCD8D835DCD9>"),
224 "/Author (ABCDE FGHIJ)",
225 "Subject <FEFF03B103B203B303B403B5002003B603B703B803B903BA>",
226 "/ViewerPreferences",
227 "/DisplayDocTitle true",
242#ifdef SK_PDF_TEST_MULTIPAGE
248 for (
int i = 0;
i < n; ++
i) {
249 doc->beginPage(612, 792)->drawColor(
259 b.allocN32Pixels(612, 792);
260 b.eraseColor(0x4F9643A0);
266 doc->beginPage(612, 792)->drawImage(
b.asImage(), 0, 0);
static bool contains(const uint8_t *result, size_t size, const char expectation[])
static void test_close(skiatest::Reporter *reporter)
DEF_TEST(SkPDF_document_tests, reporter)
static void test_abort(skiatest::Reporter *reporter)
static void test_file(skiatest::Reporter *reporter)
static void test_abortWithFile(skiatest::Reporter *reporter)
static void test_empty(skiatest::Reporter *reporter)
constexpr SkColor SK_ColorCYAN
constexpr SkColor SK_ColorRED
static constexpr SkColor SkColorSetARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
#define REPORTER_ASSERT(r, cond,...)
#define REQUIRE_PDF_DOCUMENT(TEST_NAME, REPORTER)
void translate(SkScalar dx, SkScalar dy)
void drawColor(SkColor color, SkBlendMode mode=SkBlendMode::kSrcOver)
void rotate(SkScalar degrees)
void scale(SkScalar sx, SkScalar sy)
void drawString(const char str[], SkScalar x, SkScalar y, const SkFont &font, const SkPaint &paint)
sk_sp< SkData > detachAsData()
static std::unique_ptr< SkExecutor > MakeFIFOThreadPool(int threads=0, bool allowBorrowing=true)
static SkString Join(const char *rootPath, const char *relativePath)
const char * c_str() const
SK_API sk_sp< SkDocument > MakeDocument(SkWStream *stream, const Metadata &metadata)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
static const char header[]
std::shared_ptr< const fml::Mapping > data