aboutsummaryrefslogtreecommitdiff
path: root/core/fpdfapi/page/cpdf_pattern.cpp
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-12-13 18:05:38 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-12-13 18:05:38 +0000
commite03171e52ec4232369ab3b46e11d3a0abe1eb630 (patch)
tree6a57f6a0948032e6ec387c22d8b462215e6ca1e4 /core/fpdfapi/page/cpdf_pattern.cpp
parent8bbfdf2fca7197a0eccfef7b6fc27c590a44e7f7 (diff)
parent326d96bf5d52fdcf790b467b13f58ba3df3e81e4 (diff)
downloadpdfium-android14-platform-release.tar.gz
Change-Id: If925f85c6a039b56ff549fd5327795f57b9cd12c
Diffstat (limited to 'core/fpdfapi/page/cpdf_pattern.cpp')
-rw-r--r--core/fpdfapi/page/cpdf_pattern.cpp17
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;
}