summaryrefslogtreecommitdiff
path: root/core/fpdfapi/render
diff options
context:
space:
mode:
authorrbpotter <rbpotter@chromium.org>2017-04-17 09:10:21 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-04-18 00:26:02 +0000
commitcec01808e8b155f598b2a9ea527736ce774e76a2 (patch)
tree9614ce31345bb73e9d7c1a438c10bb83776599c3 /core/fpdfapi/render
parent080dfd89269a95713d31d66829016d4885afe76b (diff)
downloadpdfium-cec01808e8b155f598b2a9ea527736ce774e76a2.tar.xz
Render image masks individually instead of rendering the entire page as
a bitmap in order to reduce spool sizes. BUG=682156, 674771 Change-Id: Ic743ba729a7b9609be18fb620a5eb6bc440aed6a Reviewed-on: https://pdfium-review.googlesource.com/2916 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfapi/render')
-rw-r--r--core/fpdfapi/render/cpdf_progressiverenderer.cpp6
-rw-r--r--core/fpdfapi/render/cpdf_renderoptions.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/core/fpdfapi/render/cpdf_progressiverenderer.cpp b/core/fpdfapi/render/cpdf_progressiverenderer.cpp
index 6aa3b8a309..c3cef1fc77 100644
--- a/core/fpdfapi/render/cpdf_progressiverenderer.cpp
+++ b/core/fpdfapi/render/cpdf_progressiverenderer.cpp
@@ -6,6 +6,8 @@
#include "core/fpdfapi/render/cpdf_progressiverenderer.h"
+#include "core/fpdfapi/page/cpdf_image.h"
+#include "core/fpdfapi/page/cpdf_imageobject.h"
#include "core/fpdfapi/page/cpdf_pageobject.h"
#include "core/fpdfapi/page/cpdf_pageobjectholder.h"
#include "core/fpdfapi/render/cpdf_pagerendercache.h"
@@ -95,6 +97,10 @@ void CPDF_ProgressiveRenderer::Continue(IFX_Pause* pPause) {
return;
nObjsToGo = kStepLimit;
}
+ if (pCurObj->IsImage() && pCurObj->AsImage()->GetImage()->IsMask() &&
+ (m_pOptions->m_Flags & RENDER_BREAKFORMASKS)) {
+ return;
+ }
++iter;
}
if (m_pCurrentLayer->m_pObjectHolder->IsParsed()) {
diff --git a/core/fpdfapi/render/cpdf_renderoptions.h b/core/fpdfapi/render/cpdf_renderoptions.h
index b934941d00..ee26ccbb07 100644
--- a/core/fpdfapi/render/cpdf_renderoptions.h
+++ b/core/fpdfapi/render/cpdf_renderoptions.h
@@ -28,6 +28,7 @@
#define RENDER_PRINTIMAGETEXT 0x00000200
#define RENDER_OVERPRINT 0x00000400
#define RENDER_THINLINE 0x00000800
+#define RENDER_BREAKFORMASKS 0x00001000
#define RENDER_NOTEXTSMOOTH 0x10000000
#define RENDER_NOPATHSMOOTH 0x20000000
#define RENDER_NOIMAGESMOOTH 0x40000000