summaryrefslogtreecommitdiff
path: root/core/include
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/include
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/include')
-rw-r--r--core/include/fpdfapi/fpdf_resource.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/core/include/fpdfapi/fpdf_resource.h b/core/include/fpdfapi/fpdf_resource.h
index 9fe6e2b95f..dee15cf941 100644
--- a/core/include/fpdfapi/fpdf_resource.h
+++ b/core/include/fpdfapi/fpdf_resource.h
@@ -679,6 +679,19 @@ class CPDF_TilingPattern : public CPDF_Pattern {
CPDF_Form* m_pForm;
};
+
+typedef enum {
+ kInvalidShading = 0,
+ kFunctionBasedShading = 1,
+ kAxialShading = 2,
+ kRadialShading = 3,
+ kFreeFormGouraudTriangleMeshShading = 4,
+ kLatticeFormGouraudTriangleMeshShading = 5,
+ kCoonsPatchMeshShading = 6,
+ kTensorProductPatchMeshShading = 7,
+ kMaxShading = 8
+} ShadingType;
+
class CPDF_ShadingPattern : public CPDF_Pattern {
public:
CPDF_ShadingPattern(CPDF_Document* pDoc,
@@ -688,6 +701,13 @@ class CPDF_ShadingPattern : public CPDF_Pattern {
~CPDF_ShadingPattern() override;
+ bool IsMeshShading() const {
+ return m_ShadingType == kFreeFormGouraudTriangleMeshShading ||
+ m_ShadingType == kLatticeFormGouraudTriangleMeshShading ||
+ m_ShadingType == kCoonsPatchMeshShading ||
+ m_ShadingType == kTensorProductPatchMeshShading;
+ }
+
CPDF_Object* m_pShadingObj;
FX_BOOL m_bShadingObj;
@@ -696,7 +716,7 @@ class CPDF_ShadingPattern : public CPDF_Pattern {
FX_BOOL Reload();
- int m_ShadingType;
+ ShadingType m_ShadingType;
CPDF_ColorSpace* m_pCS; // Still keep m_pCS as some CPDF_ColorSpace (name
// object) are not managed as counted objects. Refer