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

Side by Side Diff: src/pdf/SkPDFCatalog.h

Issue 1049753002: SkPDF: Factor SkPDFCatalog into SkPDFObjNumMap and SkPDFSubstituteMap (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: full 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 unified diff | Download patch
OLDNEW
(Empty)
1
2 /*
3 * Copyright 2010 The Android Open Source Project
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
8
9
10 #ifndef SkPDFCatalog_DEFINED
11 #define SkPDFCatalog_DEFINED
12
13 #include "SkPDFTypes.h"
14 #include "SkTDArray.h"
15 #include "SkTHash.h"
16
17 /** \class SkPDFCatalog
18
19 The PDF catalog manages object numbers. It is used
20 to create the PDF cross reference table.
21 */
22 class SkPDFCatalog {
23 public:
24 SkPDFCatalog();
25 ~SkPDFCatalog();
26
27 /** Add the passed object to the catalog.
28 * @param obj The object to add.
29 * @return True iff the object was not already added to the catalog.
30 */
31 bool addObject(SkPDFObject* obj);
32
33 /** Get the object number for the passed object.
34 * @param obj The object of interest.
35 */
36 int32_t getObjectNumber(SkPDFObject* obj) const;
37
38 /** Set substitute object for the passed object.
39 Refs substitute.
40 */
41 void setSubstitute(SkPDFObject* original, SkPDFObject* substitute);
42
43 /** Find and return any substitute object set for the passed object. If
44 * there is none, return the passed object.
45 */
46 SkPDFObject* getSubstituteObject(SkPDFObject* object) const;
47
48 const SkTDArray<SkPDFObject*>& objects() const { return fObjects; }
49
50 private:
51 SkTDArray<SkPDFObject*> fObjects;
52 SkTHashMap<SkPDFObject*, int32_t> fObjectNumbers;
53 SkTHashMap<SkPDFObject*, SkPDFObject*> fSubstituteMap;
54 };
55
56 #endif
OLDNEW
« no previous file with comments | « src/pdf/SkPDFBitmap.cpp ('k') | src/pdf/SkPDFCatalog.cpp » ('j') | src/pdf/SkPDFStream.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698