summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page/cpdf_pattern.h
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-04-26 15:22:00 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-04-27 23:22:12 +0000
commit66568bcd683dd7b18672cb3aebca4487e9203519 (patch)
tree7297841771a796bafd3d0d17dd47b7b0e394d933 /core/fpdfapi/page/cpdf_pattern.h
parentba817506edcb26e0acf497111e7684e39dadaf04 (diff)
downloadpdfium-66568bcd683dd7b18672cb3aebca4487e9203519.tar.xz
Assert CPDF_Pattern always has a valid CPDF_Document pointer.
Same for CPDF_DocPageData. Change-Id: I8f2f559123dbb2f3623d957e4074d5f9d191797f Reviewed-on: https://pdfium-review.googlesource.com/4501 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_pattern.h')
-rw-r--r--core/fpdfapi/page/cpdf_pattern.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/core/fpdfapi/page/cpdf_pattern.h b/core/fpdfapi/page/cpdf_pattern.h
index d44965ff16..3b948aedb7 100644
--- a/core/fpdfapi/page/cpdf_pattern.h
+++ b/core/fpdfapi/page/cpdf_pattern.h
@@ -24,18 +24,20 @@ class CPDF_Pattern {
virtual CPDF_TilingPattern* AsTilingPattern() = 0;
virtual CPDF_ShadingPattern* AsShadingPattern() = 0;
+ // All the getters that return pointers return non-NULL pointers.
CPDF_Document* document() { return m_pDocument; }
CPDF_Object* pattern_obj() { return m_pPatternObj; }
CFX_Matrix* pattern_to_form() { return &m_Pattern2Form; }
const CFX_Matrix& parent_matrix() const { return m_ParentMatrix; }
protected:
- CPDF_Pattern(PatternType type,
- CPDF_Document* pDoc,
+ CPDF_Pattern(CPDF_Document* pDoc,
CPDF_Object* pObj,
const CFX_Matrix& parentMatrix);
- const PatternType m_PatternType;
+ void SetPatternToFormMatrix();
+
+ private:
CPDF_Document* const m_pDocument;
CPDF_Object* const m_pPatternObj;
CFX_Matrix m_Pattern2Form;