From cb8768294337f42484b418141792f924d836f9d7 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 22 Mar 2018 16:21:04 +0000 Subject: Move helper methods out of pdfium_test. This CL splits some helper code out of pdfium_test into individual files. This makes it a bit clearer what each chunk of code is doing and makes pdfium_test easier to read. Change-Id: I3dcff5a6a85ac4283336108eb3a24fa5f234284c Reviewed-on: https://pdfium-review.googlesource.com/28990 Reviewed-by: Henrique Nakashima Commit-Queue: dsinclair --- samples/pdfium_test_write_helper.h | 52 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 samples/pdfium_test_write_helper.h (limited to 'samples/pdfium_test_write_helper.h') diff --git a/samples/pdfium_test_write_helper.h b/samples/pdfium_test_write_helper.h new file mode 100644 index 0000000000..eb2a6c6bc7 --- /dev/null +++ b/samples/pdfium_test_write_helper.h @@ -0,0 +1,52 @@ +// Copyright 2018 The PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef SAMPLES_PDFIUM_TEST_WRITE_HELPER_H_ +#define SAMPLES_PDFIUM_TEST_WRITE_HELPER_H_ + +#include + +#include "public/fpdfview.h" + +#ifdef PDF_ENABLE_SKIA +#include "third_party/skia/include/core/SkPictureRecorder.h" +#include "third_party/skia/include/core/SkStream.h" +#endif + +std::string WritePpm(const char* pdf_name, + int num, + const void* buffer_void, + int stride, + int width, + int height); +void WriteText(FPDF_PAGE page, const char* pdf_name, int num); +void WriteAnnot(FPDF_PAGE page, const char* pdf_name, int num); +std::string WritePng(const char* pdf_name, + int num, + const void* buffer_void, + int stride, + int width, + int height); + +#ifdef _WIN32 +std::string WriteBmp(const char* pdf_name, + int num, + const void* buffer, + int stride, + int width, + int height); +void WriteEmf(FPDF_PAGE page, const char* pdf_name, int num); +void WritePS(FPDF_PAGE page, const char* pdf_name, int num); +#endif // _WIN32 + +#ifdef PDF_ENABLE_SKIA +std::string WriteSkp(const char* pdf_name, + int num, + SkPictureRecorder* recorder); +#endif // PDF_ENABLE_SKIA + +void WriteAttachments(FPDF_DOCUMENT doc, const std::string& name); +void WriteImages(FPDF_PAGE page, const char* pdf_name, int page_num); + +#endif // SAMPLES_PDFIUM_TEST_WRITE_HELPER_H_ -- cgit v1.2.3