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

Unified Diff: src/pdf/SkPDFFormXObject.h

Issue 2185803003: SkPdf: SkPDFFormXObject de-class-ified. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2016-07-27 (Wednesday) 17:00:53 EDT Created 4 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
« no previous file with comments | « src/pdf/SkPDFDevice.cpp ('k') | src/pdf/SkPDFFormXObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFFormXObject.h
diff --git a/src/pdf/SkPDFFormXObject.h b/src/pdf/SkPDFFormXObject.h
index a483a6046657387cc6f7096dc04c70405d5f9e5a..6ce8b87bc9d10078265e0f357acf0e2b7a4f9dbc 100644
--- a/src/pdf/SkPDFFormXObject.h
+++ b/src/pdf/SkPDFFormXObject.h
@@ -10,41 +10,15 @@
#define SkPDFFormXObject_DEFINED
#include "SkPDFStream.h"
+#include "SkPDFDevice.h"
-class SkPDFArray;
-class SkPDFDevice;
-class SkPDFDict;
-struct SkRect;
-
-/** \class SkPDFFormXObject
-
- A form XObject; a self contained description of graphics objects. A form
- XObject is basically a page object with slightly different syntax, that
- can be drawn onto a page.
+/** A form XObject is a self contained description of a graphics
+ object. A form XObject is a page object with slightly different
+ syntax, that can be drawn into a page content stream, just like a
+ bitmap XObject can be drawn into a page content stream.
*/
-
-// The caller could keep track of the form XObjects it creates and
-// canonicalize them, but the Skia API doesn't provide enough context to
-// automatically do it (trivially).
-class SkPDFFormXObject final : public SkPDFStream {
-public:
- /** Create a PDF form XObject. Entries for the dictionary entries are
- * automatically added.
- * @param device The set of graphical elements on this form.
- */
- explicit SkPDFFormXObject(SkPDFDevice* device);
- /**
- * Create a PDF form XObject from a raw content stream and associated
- * resources.
- */
- explicit SkPDFFormXObject(std::unique_ptr<SkStreamAsset> content,
- SkRect bbox,
- SkPDFDict* resourceDict);
- virtual ~SkPDFFormXObject();
-
-private:
- void init(const char* colorSpace,
- SkPDFDict* resourceDict, SkPDFArray* bbox);
-};
-
+sk_sp<SkPDFObject> SkPDFMakeFormXObject(std::unique_ptr<SkStreamAsset> content,
+ sk_sp<SkPDFArray> mediaBox,
+ sk_sp<SkPDFDict> resourceDict,
+ const char* colorSpace);
#endif
« no previous file with comments | « src/pdf/SkPDFDevice.cpp ('k') | src/pdf/SkPDFFormXObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698