diff options
Diffstat (limited to 'core/fpdfapi/page/cpdf_pattern.cpp')
-rw-r--r-- | core/fpdfapi/page/cpdf_pattern.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/core/fpdfapi/page/cpdf_pattern.cpp b/core/fpdfapi/page/cpdf_pattern.cpp index 36ecc98d5..297c77a99 100644 --- a/core/fpdfapi/page/cpdf_pattern.cpp +++ b/core/fpdfapi/page/cpdf_pattern.cpp @@ -1,4 +1,4 @@ -// Copyright 2016 PDFium Authors. All rights reserved. +// Copyright 2016 The PDFium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -6,14 +6,19 @@ #include "core/fpdfapi/page/cpdf_pattern.h" +#include <utility> + #include "core/fpdfapi/parser/cpdf_dictionary.h" +#include "third_party/base/check.h" CPDF_Pattern::CPDF_Pattern(CPDF_Document* pDoc, - CPDF_Object* pObj, + RetainPtr<CPDF_Object> pObj, const CFX_Matrix& parentMatrix) - : m_pDocument(pDoc), m_pPatternObj(pObj), m_ParentMatrix(parentMatrix) { - ASSERT(m_pDocument); - ASSERT(m_pPatternObj); + : m_pDocument(pDoc), + m_pPatternObj(std::move(pObj)), + m_ParentMatrix(parentMatrix) { + DCHECK(m_pDocument); + DCHECK(m_pPatternObj); } CPDF_Pattern::~CPDF_Pattern() = default; @@ -27,6 +32,6 @@ CPDF_ShadingPattern* CPDF_Pattern::AsShadingPattern() { } void CPDF_Pattern::SetPatternToFormMatrix() { - const CPDF_Dictionary* pDict = pattern_obj()->GetDict(); + RetainPtr<const CPDF_Dictionary> pDict = pattern_obj()->GetDict(); m_Pattern2Form = pDict->GetMatrixFor("Matrix") * m_ParentMatrix; } |