summaryrefslogtreecommitdiff
path: root/core/include/fpdfapi
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2016-01-11 09:11:09 -0800
committerTom Sepez <tsepez@chromium.org>2016-01-11 09:11:09 -0800
commit492961df3011ccc25646eae12ac6e6dcfe7f26da (patch)
tree0d0e5f5155becdb51f70243a7821b0bbc44014fb /core/include/fpdfapi
parent3f1c71f5a6ea058e3eec611c9dcc759b374dcb80 (diff)
downloadpdfium-492961df3011ccc25646eae12ac6e6dcfe7f26da.tar.xz
Merge to XFA: Tidy up shading patterns
Original Review URL: https://codereview.chromium.org/1570873005 . (cherry picked from commit a07804a3b16c10fa2011ef56d1dacefb7d21e4f6) TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1577893002 .
Diffstat (limited to 'core/include/fpdfapi')
-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;