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

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: 2016-03-04 (Friday) 16:33:27 EST 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
« no previous file with comments | « include/private/SkTArray.h ('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 31f6de11eefd7b561d247a722d4391772f30d82d..cceb1238f14181f42b1bdadcedada74344b62d81 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,22 @@ protected:
SkSurface* newSurface(const SkImageInfo&, const SkSurfaceProps&) override;
private:
+ struct RectWithData {
+ SkRect rect;
+ SkData* data;
+ RectWithData(const SkRect& rect, SkData* data)
+ : rect(rect), data(SkRef(data)) {}
+ ~RectWithData() { data->unref(); }
+ };
+
+ struct NamedDestination {
+ SkData* nameData;
+ SkPoint point;
+ NamedDestination(SkData* nameData, const SkPoint& point)
+ : nameData(SkRef(nameData)), point(point) {}
+ ~NamedDestination() { nameData->unref(); }
+ };
+
// 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 +224,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;
« no previous file with comments | « include/private/SkTArray.h ('k') | src/pdf/SkPDFDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698