1 // Copyright 2016 The PDFium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 6 7 #include "core/fpdfapi/page/cpdf_pattern.h" 8 9 #include <utility> 10 11 #include "core/fpdfapi/parser/cpdf_dictionary.h" 12 #include "third_party/base/check.h" 13 CPDF_Pattern(CPDF_Document * pDoc,RetainPtr<CPDF_Object> pObj,const CFX_Matrix & parentMatrix)14CPDF_Pattern::CPDF_Pattern(CPDF_Document* pDoc, 15 RetainPtr<CPDF_Object> pObj, 16 const CFX_Matrix& parentMatrix) 17 : m_pDocument(pDoc), 18 m_pPatternObj(std::move(pObj)), 19 m_ParentMatrix(parentMatrix) { 20 DCHECK(m_pDocument); 21 DCHECK(m_pPatternObj); 22 } 23 24 CPDF_Pattern::~CPDF_Pattern() = default; 25 AsTilingPattern()26CPDF_TilingPattern* CPDF_Pattern::AsTilingPattern() { 27 return nullptr; 28 } 29 AsShadingPattern()30CPDF_ShadingPattern* CPDF_Pattern::AsShadingPattern() { 31 return nullptr; 32 } 33 SetPatternToFormMatrix()34void CPDF_Pattern::SetPatternToFormMatrix() { 35 RetainPtr<const CPDF_Dictionary> pDict = pattern_obj()->GetDict(); 36 m_Pattern2Form = pDict->GetMatrixFor("Matrix") * m_ParentMatrix; 37 } 38