pdfviewer: absolute minimal; to al least render (even if poorly) ICC based color spaces, based on RGB
Review URL: https://codereview.chromium.org/22624002
git-svn-id: http://skia.googlecode.com/svn/trunk@10630 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/experimental/PdfViewer/pdfparser/native/SkNativeParsedPDF.cpp b/experimental/PdfViewer/pdfparser/native/SkNativeParsedPDF.cpp
index 2e7e670..d9f680c 100644
--- a/experimental/PdfViewer/pdfparser/native/SkNativeParsedPDF.cpp
+++ b/experimental/PdfViewer/pdfparser/native/SkNativeParsedPDF.cpp
@@ -207,6 +207,18 @@
current = skipPdfWhiteSpaces(0, current, end);
}
+ // TODO(edisonn): hack, detect root catalog - we need to implement liniarized support, and remove this hack.
+ if (!fRootCatalogRef) {
+ for (unsigned int i = 0 ; i < objects(); i++) {
+ SkPdfObject* obj = object(i);
+ SkPdfObject* root = (obj && obj->isDictionary()) ? obj->get("Root") : NULL;
+ if (root && root->isReference()) {
+ fRootCatalogRef = root;
+ }
+ }
+ }
+
+
if (fRootCatalogRef) {
fRootCatalog = (SkPdfCatalogDictionary*)resolveReference(fRootCatalogRef);
if (fRootCatalog->isDictionary() && fRootCatalog->valid()) {
@@ -217,6 +229,7 @@
}
}
+
}
// TODO(edisonn): NYI