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

Unified Diff: src/pdf/SkPDFCatalog.cpp

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, 9 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/SkPDFCatalog.cpp
diff --git a/src/pdf/SkPDFCatalog.cpp b/src/pdf/SkPDFCatalog.cpp
deleted file mode 100644
index 4069cc9762e345b8460ced9f1b3f605b9ae99de7..0000000000000000000000000000000000000000
--- a/src/pdf/SkPDFCatalog.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-
-/*
- * Copyright 2010 The Android Open Source Project
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-
-#include "SkPDFCatalog.h"
-
-SkPDFCatalog::SkPDFCatalog() {}
-
-SkPDFCatalog::~SkPDFCatalog() {
- fSubstituteMap.foreach(
- [](SkPDFObject*, SkPDFObject** v) { (*v)->unref(); });
-}
-
-bool SkPDFCatalog::addObject(SkPDFObject* obj) {
- if (fObjectNumbers.find(obj)) {
- return false;
- }
- fObjectNumbers.set(obj, fObjectNumbers.count() + 1);
- fObjects.push(obj);
- return true;
-}
-
-int32_t SkPDFCatalog::getObjectNumber(SkPDFObject* obj) const {
- int32_t* objectNumberFound = fObjectNumbers.find(obj);
- SkASSERT(objectNumberFound);
- return *objectNumberFound;
-}
-
-void SkPDFCatalog::setSubstitute(SkPDFObject* original,
- SkPDFObject* substitute) {
- SkASSERT(original != substitute);
- SkASSERT(!fSubstituteMap.find(original));
- fSubstituteMap.set(original, SkRef(substitute));
-}
-
-SkPDFObject* SkPDFCatalog::getSubstituteObject(SkPDFObject* object) const {
- SkPDFObject** found = fSubstituteMap.find(object);
- return found ? *found : object;
-}
« no previous file with comments | « src/pdf/SkPDFCatalog.h ('k') | src/pdf/SkPDFFont.h » ('j') | src/pdf/SkPDFStream.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698