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

Unified Diff: src/pdf/SkPDFDevice.h

Issue 1257533004: Merge sub-device annotations in SkPDFDevice::drawDevice() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase and address comment Created 5 years, 3 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') | src/pdf/SkPDFDevice.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFDevice.h
diff --git a/src/pdf/SkPDFDevice.h b/src/pdf/SkPDFDevice.h
index fbd5fb3c9cf1fdafb632bfffbbe4069f1a69c919..45aba2988602cf5a9f8a15304b5265e7a793ce66 100644
--- a/src/pdf/SkPDFDevice.h
+++ b/src/pdf/SkPDFDevice.h
@@ -38,6 +38,7 @@ class SkRRect;
struct ContentEntry;
struct GraphicStateEntry;
struct NamedDestination;
+struct RectWithData;
/** \class SkPDFDevice
@@ -141,6 +142,12 @@ public:
*/
const SkTDArray<SkPDFFont*>& getFontResources() const;
+ /** Add our annotations (link to urls and destinations) to the supplied
+ * array.
+ * @param array Array to add annotations to.
+ */
+ void appendAnnotations(SkPDFArray* array) const;
+
/** Add our named destinations to the supplied dictionary.
* @param dict Dictionary to add destinations to.
* @param page The PDF object representing the page for this device.
@@ -152,10 +159,6 @@ public:
*/
SkPDFArray* copyMediaBox() const;
- /** Get the annotations from this page, or nullptr if there are none.
- */
- SkPDFArray* getAnnotations() const { return fAnnotations; }
-
/** Returns a SkStream with the page contents. The caller is responsible
* for a deleting the returned value.
*/
@@ -196,7 +199,9 @@ private:
SkMatrix fInitialTransform;
SkClipStack fExistingClipStack;
SkRegion fExistingClipRegion;
- SkPDFArray* fAnnotations;
+
+ SkTDArray<RectWithData*> fLinkToURLs;
+ SkTDArray<RectWithData*> fLinkToDestinations;
SkTDArray<NamedDestination*> fNamedDestinations;
SkTDArray<SkPDFObject*> fGraphicStateResources;
@@ -291,7 +296,8 @@ private:
const SkMatrix* prePathMatrix = nullptr);
bool handlePointAnnotation(const SkPoint* points, size_t count,
const SkMatrix& matrix, SkAnnotation* annot);
- void addAnnotation(SkPDFDict*);
+ bool handlePathAnnotation(const SkPath& path, const SkDraw& d,
+ SkAnnotation* annot);
typedef SkBaseDevice INHERITED;
« no previous file with comments | « src/doc/SkDocument_PDF.cpp ('k') | src/pdf/SkPDFDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698