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

Unified Diff: experimental/PdfViewer/SkPdfRenderer.cpp

Issue 23125015: pdfviewer: if the resources are missing, exit (right now inheritance is not implemented) (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: experimental/PdfViewer/SkPdfRenderer.cpp
===================================================================
--- experimental/PdfViewer/SkPdfRenderer.cpp (revision 10873)
+++ experimental/PdfViewer/SkPdfRenderer.cpp (working copy)
@@ -1041,6 +1041,12 @@
return kIgnoreError_SkPdfResult;
}
+ pdfContext->fGraphicsState.fResources = skobj->Resources(pdfContext->fPdfDoc);
+
+ if (!pdfContext->fGraphicsState.fResources) {
+ return kIgnoreError_SkPdfResult; // probably it is null because we have not implemented yet inheritance
+ }
+
if (CheckRecursiveRendering::IsInRendering(skobj)) {
// Oops, corrupt PDF!
return kIgnoreError_SkPdfResult;
@@ -1050,11 +1056,6 @@
PdfOp_q(pdfContext, canvas, NULL);
-
- if (skobj->Resources(pdfContext->fPdfDoc)) {
- pdfContext->fGraphicsState.fResources = skobj->Resources(pdfContext->fPdfDoc);
- }
-
// TODO(edisonn): MediaBox can be inherited!!!!
SkRect bbox = skobj->MediaBox(pdfContext->fPdfDoc);
if (skobj->has_Group()) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698