summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2015-10-27 13:24:54 -0400
committerDan Sinclair <dsinclair@chromium.org>2015-10-27 13:24:54 -0400
commitc5fd3e95fbc42f41479f803e4f2f0b4a7c4fc612 (patch)
treeac7aed27b7ec568b2d86863d8845beb0017dbb3e /core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
parenteb815bf1c91d74bb03df52f8f7c586d2b2130341 (diff)
downloadpdfium-c5fd3e95fbc42f41479f803e4f2f0b4a7c4fc612.tar.xz
Merge to XFA: Give names to the shading types
Currently the shading types are referenced by number. This Cl creates and enum and updates the code to use the enum names instead of magic numbers. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1418623011 . (cherry picked from commit 468974316ed5f6b6f8e637ab2c7afedc7c2bfe6a) Review URL: https://codereview.chromium.org/1428573002 .
Diffstat (limited to 'core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp')
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
index b12a65a844..3057948959 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
@@ -1092,12 +1092,13 @@ void CPDF_StreamContentParser::Handle_SetColorPS_Stroke() {
}
FX_Free(values);
}
-CFX_FloatRect _GetShadingBBox(CPDF_Stream* pStream,
- int type,
- const CFX_AffineMatrix* pMatrix,
- CPDF_Function** pFuncs,
- int nFuncs,
- CPDF_ColorSpace* pCS);
+CFX_FloatRect GetShadingBBox(CPDF_Stream* pStream,
+ ShadingType type,
+ const CFX_AffineMatrix* pMatrix,
+ CPDF_Function** pFuncs,
+ int nFuncs,
+ CPDF_ColorSpace* pCS);
+
void CPDF_StreamContentParser::Handle_ShadeFill() {
if (m_Options.m_bTextOnly) {
return;
@@ -1127,11 +1128,11 @@ void CPDF_StreamContentParser::Handle_ShadeFill() {
} else {
bbox = m_BBox;
}
- if (pShading->m_ShadingType >= 4) {
- bbox.Intersect(_GetShadingBBox(ToStream(pShading->m_pShadingObj),
- pShading->m_ShadingType, &pObj->m_Matrix,
- pShading->m_pFunctions, pShading->m_nFuncs,
- pShading->m_pCS));
+ if (pShading->IsMeshShading()) {
+ bbox.Intersect(GetShadingBBox(ToStream(pShading->m_pShadingObj),
+ pShading->m_ShadingType, &pObj->m_Matrix,
+ pShading->m_pFunctions, pShading->m_nFuncs,
+ pShading->m_pCS));
}
pObj->m_Left = bbox.left;
pObj->m_Right = bbox.right;