summaryrefslogtreecommitdiff
path: root/core/fpdfapi/render/cpdf_renderstatus.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-05-09 19:31:22 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-05-09 19:31:22 +0000
commita44b288c4132711d0d9dbcc6885fc98525748ad7 (patch)
treeed70574e2a4c40970545474d5c451220823d68a6 /core/fpdfapi/render/cpdf_renderstatus.cpp
parent56b272e9cb6c680c1fcda2984c23c47b6cc4b421 (diff)
downloadpdfium-a44b288c4132711d0d9dbcc6885fc98525748ad7.tar.xz
Add constants for PDF 1.7 spec, table 7.13.
BUG=pdfium:1049 Change-Id: I3a589fe51f2e584dc130ba31faa144d4494a1b08 Reviewed-on: https://pdfium-review.googlesource.com/32179 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfapi/render/cpdf_renderstatus.cpp')
-rw-r--r--core/fpdfapi/render/cpdf_renderstatus.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/core/fpdfapi/render/cpdf_renderstatus.cpp b/core/fpdfapi/render/cpdf_renderstatus.cpp
index 3672729f2e..0f054ef578 100644
--- a/core/fpdfapi/render/cpdf_renderstatus.cpp
+++ b/core/fpdfapi/render/cpdf_renderstatus.cpp
@@ -13,6 +13,7 @@
#include <utility>
#include <vector>
+#include "constants/transparency.h"
#include "core/fpdfapi/font/cpdf_font.h"
#include "core/fpdfapi/font/cpdf_type3char.h"
#include "core/fpdfapi/font/cpdf_type3font.h"
@@ -2530,12 +2531,13 @@ RetainPtr<CFX_DIBitmap> CPDF_RenderStatus::LoadSMask(
if (!pSMaskDict)
return nullptr;
- CPDF_Stream* pGroup = pSMaskDict->GetStreamFor("G");
+ CPDF_Stream* pGroup = pSMaskDict->GetStreamFor(pdfium::transparency::kG);
if (!pGroup)
return nullptr;
std::unique_ptr<CPDF_Function> pFunc;
- CPDF_Object* pFuncObj = pSMaskDict->GetDirectObjectFor("TR");
+ CPDF_Object* pFuncObj =
+ pSMaskDict->GetDirectObjectFor(pdfium::transparency::kTR);
if (pFuncObj && (pFuncObj->IsDictionary() || pFuncObj->IsStream()))
pFunc = CPDF_Function::Load(pFuncObj);
@@ -2547,7 +2549,9 @@ RetainPtr<CFX_DIBitmap> CPDF_RenderStatus::LoadSMask(
form.ParseContent();
CFX_DefaultRenderDevice bitmap_device;
- bool bLuminosity = pSMaskDict->GetStringFor("S") != "Alpha";
+ bool bLuminosity =
+ pSMaskDict->GetStringFor(pdfium::transparency::kSoftMaskSubType) !=
+ pdfium::transparency::kAlpha;
int width = pClipRect->right - pClipRect->left;
int height = pClipRect->bottom - pClipRect->top;
FXDIB_Format format;
@@ -2629,7 +2633,7 @@ FX_ARGB CPDF_RenderStatus::GetBackColor(const CPDF_Dictionary* pSMaskDict,
const CPDF_Dictionary* pGroupDict,
int* pCSFamily) {
static constexpr FX_ARGB kDefaultColor = ArgbEncode(255, 0, 0, 0);
- CPDF_Array* pBC = pSMaskDict->GetArrayFor("BC");
+ const CPDF_Array* pBC = pSMaskDict->GetArrayFor(pdfium::transparency::kBC);
if (!pBC)
return kDefaultColor;