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

Unified Diff: src/pdf/SkPDFTypes.h

Issue 1113583002: SkPDF: Remove unused deprecated functions in SkPDFTypes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 8 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 | « no previous file | src/pdf/SkPDFTypes.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFTypes.h
diff --git a/src/pdf/SkPDFTypes.h b/src/pdf/SkPDFTypes.h
index 69da87b36052bae0ebfa4aaaaed501e2b5360145..40d26bc2c8aaef7b5dc9cec730bdd1a48a994f14 100644
--- a/src/pdf/SkPDFTypes.h
+++ b/src/pdf/SkPDFTypes.h
@@ -160,86 +160,35 @@ SK_COMPILE_ASSERT(sizeof(SkString) == sizeof(void*), SkString_size);
////////////////////////////////////////////////////////////////////////////////
-/** This class is a SkPDFUnion with SkPDFObject virtuals attached. */
-// TODO(halcanary): 99% of the uses of this class should be
-// transitioned to using a bare SkPDFUnion inside an array or dict.
+#if 0 // Enable if needed.
tomhudson 2015/05/04 18:31:54 ... because you're trying to deprecate? *why*?
+/** This class is a SkPDFUnion with SkPDFObject virtuals attached.
+ The only use case of this is when a non-compound PDF object is
+ referenced indirectly. */
class SkPDFAtom : public SkPDFObject {
public:
void emitObject(SkWStream* stream,
const SkPDFObjNumMap& objNumMap,
const SkPDFSubstituteMap& substitutes) final;
void addResources(SkPDFObjNumMap*, const SkPDFSubstituteMap&) const final;
-
-protected:
SkPDFAtom(SkPDFUnion&& v) : fValue(v.move()) {}
private:
const SkPDFUnion fValue;
typedef SkPDFObject INHERITED;
};
+#endif // 0
-/** The following six classes exist only to ease transition to SkPDFUnion. */
-class SkPDFObjRef : public SkPDFAtom {
-public:
- SK_DECLARE_INST_COUNT(SkPDFObjRef);
- explicit SkPDFObjRef(SkPDFObject* obj)
- : INHERITED(SkPDFUnion::ObjRef(SkRef(obj))) {}
- typedef SkPDFAtom INHERITED;
-};
-
-class SkPDFInt : public SkPDFAtom {
-public:
- SK_DECLARE_INST_COUNT(SkPDFInt);
- explicit SkPDFInt(int32_t value) : INHERITED(SkPDFUnion::Int(value)) {}
- typedef SkPDFAtom INHERITED;
-};
-
-class SkPDFBool : public SkPDFAtom {
+class SkPDFScalar {
tomhudson 2015/05/04 18:31:55 Now that you've gotten rid of the idea of objects
hal.canary 2015/05/04 18:48:44 I'll move them to SkPDFUtils at a later date.
public:
- SK_DECLARE_INST_COUNT(SkPDFBool);
- explicit SkPDFBool(bool value) : INHERITED(SkPDFUnion::Bool(value)) {}
- typedef SkPDFAtom INHERITED;
-};
-
-class SkPDFScalar : public SkPDFAtom {
-public:
- SK_DECLARE_INST_COUNT(SkPDFScalar);
- explicit SkPDFScalar(SkScalar value)
- : INHERITED(SkPDFUnion::Scalar(value)) {}
static void Append(SkScalar value, SkWStream* stream);
- typedef SkPDFAtom INHERITED;
};
-class SkPDFString : public SkPDFAtom {
+class SkPDFString {
public:
- SK_DECLARE_INST_COUNT(SkPDFString);
- explicit SkPDFString(const char value[])
- : INHERITED(SkPDFUnion::String(value)) {}
- explicit SkPDFString(const SkString& value)
- : INHERITED(SkPDFUnion::String(value)) {}
-
static SkString FormatString(const char* input, size_t len);
-
static const size_t kMaxLen = 65535;
-
-private:
- typedef SkPDFAtom INHERITED;
};
-class SkPDFName : public SkPDFAtom {
-public:
- SK_DECLARE_INST_COUNT(SkPDFName);
- /** Create a PDF name object. Maximum length is 127 bytes. */
- explicit SkPDFName(const char name[])
- : INHERITED(SkPDFUnion::Name(SkString(name))) {}
- explicit SkPDFName(const SkString& name)
- : INHERITED(SkPDFUnion::Name(name)) {}
-
- static const size_t kMaxLen = 127;
-
-private:
- typedef SkPDFAtom INHERITED;
-};
/** \class SkPDFArray
@@ -272,13 +221,6 @@ public:
*/
void reserve(int length);
- /** Append the object to the end of the array and increments its ref count.
- * @param value The value to add to the array.
- * @return The value argument is returned.
- */
- // DEPRECATED
- SkPDFObject* append(SkPDFObject* value);
-
/** Appends a value to the end of the array.
* @param value The value to add to the array.
*/
@@ -329,16 +271,6 @@ public:
*/
int size() const;
- /** Add the value to the dictionary with the given key. Refs value.
- * @param key The key for this dictionary entry.
- * @param value The value for this dictionary entry.
- * @return The value argument is returned.
- */
- // DEPRECATED
- SkPDFObject* insert(SkPDFName* key, SkPDFObject* value);
- // DEPRECATED
- SkPDFObject* insert(const char key[], SkPDFObject* value);
-
/** Add the value to the dictionary with the given key. Takes
* ownership of the object.
* @param key The text of the key for this dictionary entry.
@@ -374,7 +306,6 @@ private:
SkTDArray<Record> fRecords;
static const int kMaxLen = 4095;
- void set(const SkPDFUnion& name, const SkPDFUnion& value);
void set(SkPDFUnion&& name, SkPDFUnion&& value);
typedef SkPDFObject INHERITED;
« no previous file with comments | « no previous file | src/pdf/SkPDFTypes.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698