Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2410)

Unified Diff: core/include/fpdfapi/fpdf_resource.h

Issue 1570873005: Tidy up shading patterns (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: || Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/include/fpdfapi/fpdf_resource.h
diff --git a/core/include/fpdfapi/fpdf_resource.h b/core/include/fpdfapi/fpdf_resource.h
index d6d43ee9a7b7faca6375f8337dfa1abd329327d1..b10a01c14d6f3999a9d47de8b69c5d2bf89b49bb 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;
« no previous file with comments | « no previous file | core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698