summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page/cpdf_streamcontentparser.cpp
diff options
context:
space:
mode:
authorrbpotter <rbpotter@chromium.org>2017-08-16 16:45:44 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-08-17 00:06:48 +0000
commit8d7672e941fa58326c4c6aeac47418e9b36527e9 (patch)
treefd24ca408405e8e47fe508dd9e673bdfaca74d3c /core/fpdfapi/page/cpdf_streamcontentparser.cpp
parent574015e0ad53c592fe8a923390b31edeb30c41fe (diff)
downloadpdfium-8d7672e941fa58326c4c6aeac47418e9b36527e9.tar.xz
Fix some issues with individual image mask rendering
Re-enable individual image mask rendering to improve spool sizes, with bug fixes and improvements: - Fix bug with missing images by ensuring all masks are recorded - Fix printing to landscape paper sizes - Improve spool sizes by processing the location of the masks in the progressive renderer when rendering to the printer instead of needlessly fully rendering them (they will be rendered as bitmaps anyway). Bug: chromium:753700 Change-Id: I86bdcce9f10855274c56ba2ddae2c2522b36426d Reviewed-on: https://pdfium-review.googlesource.com/11115 Commit-Queue: Rebekah Potter <rbpotter@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_streamcontentparser.cpp')
-rw-r--r--core/fpdfapi/page/cpdf_streamcontentparser.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/fpdfapi/page/cpdf_streamcontentparser.cpp b/core/fpdfapi/page/cpdf_streamcontentparser.cpp
index 692de0f5eb..1e6bf6c3c8 100644
--- a/core/fpdfapi/page/cpdf_streamcontentparser.cpp
+++ b/core/fpdfapi/page/cpdf_streamcontentparser.cpp
@@ -658,7 +658,11 @@ void CPDF_StreamContentParser::Handle_BeginImage() {
break;
}
}
- AddImage(std::move(pStream));
+ CPDF_ImageObject* pObj = AddImage(std::move(pStream));
+ // Record the bounding box of this image, so rendering code can draw it
+ // properly.
+ if (pObj->GetImage()->IsMask())
+ m_pObjectHolder->AddImageMaskBoundingBox(pObj->GetRect());
}
void CPDF_StreamContentParser::Handle_BeginMarkedContent() {