summaryrefslogtreecommitdiff
path: root/core/fpdfapi/fpdf_page
diff options
context:
space:
mode:
authorweili <weili@chromium.org>2016-07-24 08:08:24 -0700
committerCommit bot <commit-bot@chromium.org>2016-07-24 08:08:24 -0700
commit9f515bcccb40e8ae251bbe8afc1ef6c4db1f05a8 (patch)
tree83db93367d20abf65f8b4eb459f54d9f60a05732 /core/fpdfapi/fpdf_page
parent8f19e4bc617d19e871137be55a34992e421585ad (diff)
downloadpdfium-9f515bcccb40e8ae251bbe8afc1ef6c4db1f05a8.tar.xz
Use actual type instead CFX_Deletable
Change two places that used CFX_Deletable to use actual types. This makes the type more obvious, and avoids unnecessary casts. Review-Url: https://codereview.chromium.org/2180443002
Diffstat (limited to 'core/fpdfapi/fpdf_page')
-rw-r--r--core/fpdfapi/fpdf_page/cpdf_page.cpp6
-rw-r--r--core/fpdfapi/fpdf_page/include/cpdf_page.h9
2 files changed, 11 insertions, 4 deletions
diff --git a/core/fpdfapi/fpdf_page/cpdf_page.cpp b/core/fpdfapi/fpdf_page/cpdf_page.cpp
index 441bbfe28b..289ef717c4 100644
--- a/core/fpdfapi/fpdf_page/cpdf_page.cpp
+++ b/core/fpdfapi/fpdf_page/cpdf_page.cpp
@@ -14,6 +14,7 @@
#include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h"
#include "core/fpdfapi/fpdf_parser/include/cpdf_object.h"
#include "core/fpdfapi/fpdf_render/cpdf_pagerendercache.h"
+#include "core/fpdfapi/include/cpdf_pagerendercontext.h"
#include "third_party/base/stl_util.h"
CPDF_Page::CPDF_Page(CPDF_Document* pDocument,
@@ -95,6 +96,11 @@ void CPDF_Page::ParseContent() {
ContinueParse(nullptr);
}
+void CPDF_Page::SetRenderContext(
+ std::unique_ptr<CPDF_PageRenderContext> pContext) {
+ m_pRenderContext = std::move(pContext);
+}
+
CPDF_Object* CPDF_Page::GetPageAttr(const CFX_ByteString& name) const {
CPDF_Dictionary* pPageDict = m_pFormDict;
std::set<CPDF_Dictionary*> visited;
diff --git a/core/fpdfapi/fpdf_page/include/cpdf_page.h b/core/fpdfapi/fpdf_page/include/cpdf_page.h
index e73c41db79..5be82d5451 100644
--- a/core/fpdfapi/fpdf_page/include/cpdf_page.h
+++ b/core/fpdfapi/fpdf_page/include/cpdf_page.h
@@ -18,6 +18,7 @@ class CPDF_Dictionary;
class CPDF_Document;
class CPDF_Object;
class CPDF_PageRenderCache;
+class CPDF_PageRenderContext;
class CPDF_Page : public CPDF_PageObjectHolder {
public:
@@ -44,10 +45,10 @@ class CPDF_Page : public CPDF_PageObjectHolder {
CPDF_Object* GetPageAttr(const CFX_ByteString& name) const;
CPDF_PageRenderCache* GetRenderCache() const { return m_pPageRender.get(); }
- CFX_Deletable* GetRenderContext() const { return m_pRenderContext.get(); }
- void SetRenderContext(std::unique_ptr<CFX_Deletable> pContext) {
- m_pRenderContext = std::move(pContext);
+ CPDF_PageRenderContext* GetRenderContext() const {
+ return m_pRenderContext.get();
}
+ void SetRenderContext(std::unique_ptr<CPDF_PageRenderContext> pContext);
View* GetView() const { return m_pView; }
void SetView(View* pView) { m_pView = pView; }
@@ -62,7 +63,7 @@ class CPDF_Page : public CPDF_PageObjectHolder {
CFX_Matrix m_PageMatrix;
View* m_pView;
std::unique_ptr<CPDF_PageRenderCache> m_pPageRender;
- std::unique_ptr<CFX_Deletable> m_pRenderContext;
+ std::unique_ptr<CPDF_PageRenderContext> m_pRenderContext;
};
#endif // CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_PAGE_H_