summaryrefslogtreecommitdiff
path: root/core/include
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2016-01-11 08:47:40 -0800
committerTom Sepez <tsepez@chromium.org>2016-01-11 08:47:40 -0800
commita07804a3b16c10fa2011ef56d1dacefb7d21e4f6 (patch)
tree01705f0ceb2d0cc933beba4d597120d828bf4a45 /core/include
parent14f39950451bb9c2a11fbc7173fd47367410f80f (diff)
downloadpdfium-a07804a3b16c10fa2011ef56d1dacefb7d21e4f6.tar.xz
Tidy up shading patterns
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1570873005 .
Diffstat (limited to 'core/include')
-rw-r--r--core/include/fpdfapi/fpdf_resource.h42
1 files changed, 18 insertions, 24 deletions
diff --git a/core/include/fpdfapi/fpdf_resource.h b/core/include/fpdfapi/fpdf_resource.h
index d6d43ee9a7..b10a01c14d 100644
--- a/core/include/fpdfapi/fpdf_resource.h
+++ b/core/include/fpdfapi/fpdf_resource.h
@@ -636,24 +636,27 @@ class CPDF_Color {
void ReleaseColorSpace();
FX_FLOAT* m_pBuffer;
};
-#define PATTERN_TILING 1
-#define PATTERN_SHADING 2
+
class CPDF_Pattern {
public:
- virtual ~CPDF_Pattern();
- void SetForceClear(FX_BOOL bForceClear) { m_bForceClear = bForceClear; }
+ enum PatternType { TILING = 1, SHADING };
- CPDF_Object* m_pPatternObj;
+ virtual ~CPDF_Pattern();
- int m_PatternType;
+ void SetForceClear(FX_BOOL bForceClear) { m_bForceClear = bForceClear; }
+ const PatternType m_PatternType;
+ CPDF_Document* const m_pDocument;
+ CPDF_Object* const m_pPatternObj;
CFX_Matrix m_Pattern2Form;
CFX_Matrix m_ParentMatrix;
- CPDF_Document* m_pDocument;
-
protected:
- CPDF_Pattern(const CFX_Matrix* pParentMatrix);
+ CPDF_Pattern(PatternType type,
+ CPDF_Document* pDoc,
+ CPDF_Object* pObj,
+ const CFX_Matrix* pParentMatrix);
+
FX_BOOL m_bForceClear;
};
@@ -705,30 +708,21 @@ class CPDF_ShadingPattern : public CPDF_Pattern {
m_ShadingType == kCoonsPatchMeshShading ||
m_ShadingType == kTensorProductPatchMeshShading;
}
-
- CPDF_Object* m_pShadingObj;
-
- FX_BOOL m_bShadingObj;
-
FX_BOOL Load();
- FX_BOOL Reload();
-
ShadingType m_ShadingType;
+ FX_BOOL m_bShadingObj;
+ CPDF_Object* m_pShadingObj;
- CPDF_ColorSpace* m_pCS; // Still keep m_pCS as some CPDF_ColorSpace (name
- // object) are not managed as counted objects. Refer
- // to CPDF_DocPageData::GetColorSpace.
+ // Still keep |m_pCS| as some CPDF_ColorSpace (name object) are not managed
+ // as counted objects. Refer to CPDF_DocPageData::GetColorSpace.
+ CPDF_ColorSpace* m_pCS;
CPDF_CountedColorSpace* m_pCountedCS;
-
CPDF_Function* m_pFunctions[4];
-
int m_nFuncs;
-
- protected:
- void Clear();
};
+
struct CPDF_MeshVertex {
FX_FLOAT x, y;
FX_FLOAT r, g, b;