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()) { |