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

Unified Diff: src/pdf/SkPDFDocument.h

Issue 1030193002: SkPDF: unclass skpdfdocument (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 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/doc/SkDocument_PDF.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFDocument.h
diff --git a/src/pdf/SkPDFDocument.h b/src/pdf/SkPDFDocument.h
index fce9f9df834fe1f02a0ea793e87bdaab2900fa0b..f39b59ef4731e516f00bb4d32e92558968de93ab 100644
--- a/src/pdf/SkPDFDocument.h
+++ b/src/pdf/SkPDFDocument.h
@@ -11,77 +11,32 @@
#define SkPDFDocument_DEFINED
#include "SkAdvancedTypefaceMetrics.h"
-#include "SkRefCnt.h"
#include "SkTDArray.h"
-#include "SkTemplates.h"
-class SkPDFCatalog;
class SkPDFDevice;
-class SkPDFDict;
-class SkPDFPage;
-class SkPDFObject;
class SkWStream;
-template <typename T> class SkTSet;
-/** \class SkPDFDocument
-
- A SkPDFDocument assembles pages together and generates the final PDF file.
-*/
-class SkPDFDocument {
-public:
- SkPDFDocument() {}
- ~SkPDFDocument() { fPageDevices.unrefAll(); }
-
- /** Output the PDF to the passed stream. It is an error to call this (it
- * will return false and not modify stream) if pageDevices is empty.
- * No device pointer can be NULL.
- *
- * @param pageDevices An array of pages, in order. All pages
- * should be created using the same SkPDFCanon.
- * TODO(halcanary): ASSERT this condition.
- * @param SkWStream The writable output stream to send the PDF to.
- */
- static bool EmitPDF(const SkTDArray<SkPDFDevice*>& pageDevices, SkWStream*);
-
- /** Output the PDF to the passed stream. It is an error to call this (it
- * will return false and not modify stream) if no pages have been added.
- *
- * @param stream The writable output stream to send the PDF to.
- */
- bool emitPDF(SkWStream* stream) const {
- return SkPDFDocument::EmitPDF(fPageDevices, stream);
- }
-
- /** Append the passed pdf device to the document as a new page.
- *
- * @param pdfDevice The page to add to this document. All pages
- * added to this document should be created
- * using the same SkPDFCanon.
- */
- void appendPage(SkPDFDevice* pdfDevice) {
- fPageDevices.push(SkRef(pdfDevice));
- }
-
- /** Get the count of unique font types used in the given pages.
- */
- static void GetCountOfFontTypes(
- const SkTDArray<SkPDFDevice*>& pageDevices,
- int counts[SkAdvancedTypefaceMetrics::kOther_Font + 1],
- int* notSubsettableCount,
- int* notEmbedddableCount);
-
- /** Get the count of unique font types used in the document.
- */
- void getCountOfFontTypes(
- int counts[SkAdvancedTypefaceMetrics::kOther_Font + 1],
- int* notSubsettableCount,
- int* notEmbedddableCount) const {
- return SkPDFDocument::GetCountOfFontTypes(
- fPageDevices, counts, notSubsettableCount, notEmbedddableCount);
- }
+namespace SkPDFDocument {
+/**
+ * Assemble pages together and generate a PDF document file.
+ *
+ * Output the PDF to the passed stream. It is an error to call this (it
+ * will return false and not modify stream) if pageDevices is empty.
+ * No device pointer can be NULL.
+ *
+ * @param pageDevices An array of pages, in order. All pages
+ * should be created using the same SkPDFCanon.
+ * TODO(halcanary): ASSERT this condition.
+ * @param SkWStream The writable output stream to send the PDF to.
+ */
+bool EmitPDF(const SkTDArray<SkPDFDevice*>& pageDevices, SkWStream*);
-private:
- SkTDArray<SkPDFDevice*> fPageDevices;
-};
+/** Get the count of unique font types used in the given pages.
+ */
+void GetCountOfFontTypes(const SkTDArray<SkPDFDevice*>& pageDevices,
+ int counts[SkAdvancedTypefaceMetrics::kOther_Font + 1],
+ int* notSubsettableCount,
+ int* notEmbedddableCount);
+}
#endif
« no previous file with comments | « src/doc/SkDocument_PDF.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698