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

Unified Diff: src/pdf/SkPDFDevice.h

Issue 1767713002: SkPDF: PDFDevice use SkTArray<T> rather than SkTDArray<T*> (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 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 31f6de11eefd7b561d247a722d4391772f30d82d..24b14258338c9ea7ad78b3b2a3748c5f41498b91 100644
--- a/src/pdf/SkPDFDevice.h
+++ b/src/pdf/SkPDFDevice.h
@@ -11,6 +11,7 @@
#include "SkBitmap.h"
#include "SkCanvas.h"
#include "SkClipStack.h"
+#include "SkData.h"
#include "SkDevice.h"
#include "SkPaint.h"
#include "SkPath.h"
@@ -37,8 +38,6 @@ class SkRRect;
// Private classes.
struct ContentEntry;
struct GraphicStateEntry;
-struct NamedDestination;
-struct RectWithData;
/** \class SkPDFDevice
@@ -199,6 +198,20 @@ protected:
SkSurface* newSurface(const SkImageInfo&, const SkSurfaceProps&) override;
private:
+ struct RectWithData {
+ SkRect rect;
+ sk_sp<const SkData> data;
+ RectWithData(const SkRect& rect, const SkData* data)
+ : rect(rect), data(SkRef(data)) {}
+ };
+
+ struct NamedDestination {
+ sk_sp<const SkData> nameData;
+ SkPoint point;
+ NamedDestination(const SkData* nameData, const SkPoint& point)
+ : nameData(SkRef(nameData)), point(point) {}
+ };
+
// TODO(vandebo): push most of SkPDFDevice's state into a core object in
// order to get the right access levels without using friend.
friend class ScopedContentEntry;
@@ -209,9 +222,9 @@ private:
SkClipStack fExistingClipStack;
SkRegion fExistingClipRegion;
- SkTDArray<RectWithData*> fLinkToURLs;
- SkTDArray<RectWithData*> fLinkToDestinations;
- SkTDArray<NamedDestination*> fNamedDestinations;
+ SkTArray<RectWithData> fLinkToURLs;
+ SkTArray<RectWithData> fLinkToDestinations;
+ SkTArray<NamedDestination> fNamedDestinations;
SkTDArray<SkPDFObject*> fGraphicStateResources;
SkTDArray<SkPDFObject*> fXObjectResources;

Powered by Google App Engine
This is Rietveld 408576698