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

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: Fix warnings Created 5 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
Index: src/pdf/SkPDFDevice.h
diff --git a/src/pdf/SkPDFDevice.h b/src/pdf/SkPDFDevice.h
index 32ebebd38ef8c66f693fd4715b747470371ed95f..dc74e6f84fdbc762949d5440866dc16423942754 100644
--- a/src/pdf/SkPDFDevice.h
+++ b/src/pdf/SkPDFDevice.h
@@ -39,6 +39,7 @@ class SkRRect;
struct ContentEntry;
struct GraphicStateEntry;
struct NamedDestination;
+struct RectWithData;
/** \class SkPDFDevice
@@ -142,6 +143,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.
@@ -153,10 +160,6 @@ public:
*/
SkPDFArray* copyMediaBox() const;
- /** Get the annotations from this page, or NULL 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.
*/
@@ -197,7 +200,9 @@ private:
SkMatrix fInitialTransform;
SkClipStack fExistingClipStack;
SkRegion fExistingClipRegion;
- SkPDFArray* fAnnotations;
+
+ SkTDArray<RectWithData*> fLinkToURLs;
+ SkTDArray<RectWithData*> fLinkToDestinations;
SkTDArray<NamedDestination*> fNamedDestinations;
SkTDArray<SkPDFObject*> fGraphicStateResources;
@@ -292,7 +297,8 @@ private:
const SkMatrix* prePathMatrix = NULL);
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;

Powered by Google App Engine
This is Rietveld 408576698