summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-08-17 15:07:47 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-08-28 17:16:28 +0000
commit8a4494034eb77bbc3453108616cc5dd67d3adbef (patch)
treeba1ffac6210530acbdbad360c2c975b100e60558
parent2bb28c347bcafc2fb5ad3e7782220e31048cc81d (diff)
downloadpdfium-8a4494034eb77bbc3453108616cc5dd67d3adbef.tar.xz
Change DrawAppearance() methods to take CFX_Matrix by const-ref.
Change-Id: If038850c745ac26e50c313bdbe630483434caedc Reviewed-on: https://pdfium-review.googlesource.com/11390 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
-rw-r--r--core/fpdfdoc/cpdf_annot.cpp4
-rw-r--r--core/fpdfdoc/cpdf_annot.h2
-rw-r--r--core/fpdfdoc/cpdf_annotlist.cpp2
-rw-r--r--fpdfsdk/cpdfsdk_baannot.cpp4
-rw-r--r--fpdfsdk/cpdfsdk_baannot.h2
-rw-r--r--fpdfsdk/cpdfsdk_baannothandler.cpp2
-rw-r--r--fpdfsdk/cpdfsdk_widget.cpp6
-rw-r--r--fpdfsdk/cpdfsdk_widget.h2
-rw-r--r--fpdfsdk/cpdfsdk_widgethandler.cpp2
-rw-r--r--fpdfsdk/formfiller/cffl_button.cpp14
-rw-r--r--fpdfsdk/formfiller/cffl_formfiller.cpp4
-rw-r--r--fpdfsdk/formfiller/cffl_interactiveformfiller.cpp8
12 files changed, 28 insertions, 24 deletions
diff --git a/core/fpdfdoc/cpdf_annot.cpp b/core/fpdfdoc/cpdf_annot.cpp
index f2b54e81fe..89fd1c9740 100644
--- a/core/fpdfdoc/cpdf_annot.cpp
+++ b/core/fpdfdoc/cpdf_annot.cpp
@@ -360,7 +360,7 @@ CFX_ByteString CPDF_Annot::AnnotSubtypeToString(CPDF_Annot::Subtype nSubtype) {
bool CPDF_Annot::DrawAppearance(CPDF_Page* pPage,
CFX_RenderDevice* pDevice,
- const CFX_Matrix* pUser2Device,
+ const CFX_Matrix& mtUser2Device,
AppearanceMode mode,
const CPDF_RenderOptions* pOptions) {
if (!ShouldDrawAnnotation())
@@ -374,7 +374,7 @@ bool CPDF_Annot::DrawAppearance(CPDF_Page* pPage,
GenerateAPIfNeeded();
CFX_Matrix matrix;
- CPDF_Form* pForm = AnnotGetMatrix(pPage, this, mode, pUser2Device, &matrix);
+ CPDF_Form* pForm = AnnotGetMatrix(pPage, this, mode, &mtUser2Device, &matrix);
if (!pForm)
return false;
diff --git a/core/fpdfdoc/cpdf_annot.h b/core/fpdfdoc/cpdf_annot.h
index 081cef7a35..4ca1941819 100644
--- a/core/fpdfdoc/cpdf_annot.h
+++ b/core/fpdfdoc/cpdf_annot.h
@@ -87,7 +87,7 @@ class CPDF_Annot {
bool DrawAppearance(CPDF_Page* pPage,
CFX_RenderDevice* pDevice,
- const CFX_Matrix* pUser2Device,
+ const CFX_Matrix& mtUser2Device,
AppearanceMode mode,
const CPDF_RenderOptions* pOptions);
bool DrawInContext(const CPDF_Page* pPage,
diff --git a/core/fpdfdoc/cpdf_annotlist.cpp b/core/fpdfdoc/cpdf_annotlist.cpp
index 9f6f79a02c..34c8d3a869 100644
--- a/core/fpdfdoc/cpdf_annotlist.cpp
+++ b/core/fpdfdoc/cpdf_annotlist.cpp
@@ -159,7 +159,7 @@ void CPDF_AnnotList::DisplayPass(CPDF_Page* pPage,
}
if (pContext) {
pAnnot->DrawInContext(pPage, pContext, &matrix, CPDF_Annot::Normal);
- } else if (!pAnnot->DrawAppearance(pPage, pDevice, &matrix,
+ } else if (!pAnnot->DrawAppearance(pPage, pDevice, matrix,
CPDF_Annot::Normal, pOptions)) {
pAnnot->DrawBorder(pDevice, &matrix, pOptions);
}
diff --git a/fpdfsdk/cpdfsdk_baannot.cpp b/fpdfsdk/cpdfsdk_baannot.cpp
index a426749fff..9f21d3c7e4 100644
--- a/fpdfsdk/cpdfsdk_baannot.cpp
+++ b/fpdfsdk/cpdfsdk_baannot.cpp
@@ -61,10 +61,10 @@ CPDF_Annot::Subtype CPDFSDK_BAAnnot::GetAnnotSubtype() const {
}
void CPDFSDK_BAAnnot::DrawAppearance(CFX_RenderDevice* pDevice,
- const CFX_Matrix* pUser2Device,
+ const CFX_Matrix& mtUser2Device,
CPDF_Annot::AppearanceMode mode,
const CPDF_RenderOptions* pOptions) {
- m_pAnnot->DrawAppearance(m_pPageView->GetPDFPage(), pDevice, pUser2Device,
+ m_pAnnot->DrawAppearance(m_pPageView->GetPDFPage(), pDevice, mtUser2Device,
mode, pOptions);
}
diff --git a/fpdfsdk/cpdfsdk_baannot.h b/fpdfsdk/cpdfsdk_baannot.h
index 18d25a1e02..3b60b1b1b8 100644
--- a/fpdfsdk/cpdfsdk_baannot.h
+++ b/fpdfsdk/cpdfsdk_baannot.h
@@ -80,7 +80,7 @@ class CPDFSDK_BAAnnot : public CPDFSDK_Annot {
virtual bool IsAppearanceValid();
virtual bool IsAppearanceValid(CPDF_Annot::AppearanceMode mode);
virtual void DrawAppearance(CFX_RenderDevice* pDevice,
- const CFX_Matrix* pUser2Device,
+ const CFX_Matrix& mtUser2Device,
CPDF_Annot::AppearanceMode mode,
const CPDF_RenderOptions* pOptions);
diff --git a/fpdfsdk/cpdfsdk_baannothandler.cpp b/fpdfsdk/cpdfsdk_baannothandler.cpp
index 029df85bd7..6cf399a04a 100644
--- a/fpdfsdk/cpdfsdk_baannothandler.cpp
+++ b/fpdfsdk/cpdfsdk_baannothandler.cpp
@@ -73,7 +73,7 @@ void CPDFSDK_BAAnnotHandler::OnDraw(CPDFSDK_PageView* pPageView,
#endif // PDF_ENABLE_XFA
if (bDrawAnnots && pAnnot->GetAnnotSubtype() == CPDF_Annot::Subtype::POPUP) {
static_cast<CPDFSDK_BAAnnot*>(pAnnot)->DrawAppearance(
- pDevice, pUser2Device, CPDF_Annot::Normal, nullptr);
+ pDevice, *pUser2Device, CPDF_Annot::Normal, nullptr);
}
}
diff --git a/fpdfsdk/cpdfsdk_widget.cpp b/fpdfsdk/cpdfsdk_widget.cpp
index 191f0dec0d..e21ce73167 100644
--- a/fpdfsdk/cpdfsdk_widget.cpp
+++ b/fpdfsdk/cpdfsdk_widget.cpp
@@ -801,7 +801,7 @@ void CPDFSDK_Widget::ResetFieldAppearance(bool bValueChanged) {
}
void CPDFSDK_Widget::DrawAppearance(CFX_RenderDevice* pDevice,
- const CFX_Matrix* pUser2Device,
+ const CFX_Matrix& mtUser2Device,
CPDF_Annot::AppearanceMode mode,
const CPDF_RenderOptions* pOptions) {
int nFieldType = GetFieldType();
@@ -820,10 +820,10 @@ void CPDFSDK_Widget::DrawAppearance(CFX_RenderDevice* pDevice,
CFX_GraphStateData gsd;
gsd.m_LineWidth = 0.0f;
- pDevice->DrawPath(&pathData, pUser2Device, &gsd, 0, 0xFFAAAAAA,
+ pDevice->DrawPath(&pathData, &mtUser2Device, &gsd, 0, 0xFFAAAAAA,
FXFILL_ALTERNATE);
} else {
- CPDFSDK_BAAnnot::DrawAppearance(pDevice, pUser2Device, mode, pOptions);
+ CPDFSDK_BAAnnot::DrawAppearance(pDevice, mtUser2Device, mode, pOptions);
}
}
diff --git a/fpdfsdk/cpdfsdk_widget.h b/fpdfsdk/cpdfsdk_widget.h
index 954369da1d..5c63400443 100644
--- a/fpdfsdk/cpdfsdk_widget.h
+++ b/fpdfsdk/cpdfsdk_widget.h
@@ -135,7 +135,7 @@ class CPDFSDK_Widget : public CPDFSDK_BAAnnot {
bool IsWidgetAppearanceValid(CPDF_Annot::AppearanceMode mode);
void DrawAppearance(CFX_RenderDevice* pDevice,
- const CFX_Matrix* pUser2Device,
+ const CFX_Matrix& mtUser2Device,
CPDF_Annot::AppearanceMode mode,
const CPDF_RenderOptions* pOptions) override;
diff --git a/fpdfsdk/cpdfsdk_widgethandler.cpp b/fpdfsdk/cpdfsdk_widgethandler.cpp
index f5cd802001..d20d29af67 100644
--- a/fpdfsdk/cpdfsdk_widgethandler.cpp
+++ b/fpdfsdk/cpdfsdk_widgethandler.cpp
@@ -95,7 +95,7 @@ void CPDFSDK_WidgetHandler::OnDraw(CPDFSDK_PageView* pPageView,
bool bDrawAnnots) {
if (pAnnot->IsSignatureWidget()) {
static_cast<CPDFSDK_BAAnnot*>(pAnnot)->DrawAppearance(
- pDevice, pUser2Device, CPDF_Annot::Normal, nullptr);
+ pDevice, *pUser2Device, CPDF_Annot::Normal, nullptr);
} else {
if (m_pFormFiller)
m_pFormFiller->OnDraw(pPageView, pAnnot, pDevice, pUser2Device);
diff --git a/fpdfsdk/formfiller/cffl_button.cpp b/fpdfsdk/formfiller/cffl_button.cpp
index 2a290ed213..4fd02ae178 100644
--- a/fpdfsdk/formfiller/cffl_button.cpp
+++ b/fpdfsdk/formfiller/cffl_button.cpp
@@ -67,30 +67,32 @@ void CFFL_Button::OnDraw(CPDFSDK_PageView* pPageView,
CPDFSDK_Widget* pWidget = static_cast<CPDFSDK_Widget*>(pAnnot);
CPDF_FormControl* pCtrl = pWidget->GetFormControl();
if (pCtrl->GetHighlightingMode() != CPDF_FormControl::Push) {
- pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, nullptr);
+ pWidget->DrawAppearance(pDevice, *pUser2Device, CPDF_Annot::Normal,
+ nullptr);
return;
}
if (m_bMouseDown) {
if (pWidget->IsWidgetAppearanceValid(CPDF_Annot::Down)) {
- pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Down, nullptr);
+ pWidget->DrawAppearance(pDevice, *pUser2Device, CPDF_Annot::Down,
+ nullptr);
} else {
- pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal,
+ pWidget->DrawAppearance(pDevice, *pUser2Device, CPDF_Annot::Normal,
nullptr);
}
return;
}
if (m_bMouseIn) {
if (pWidget->IsWidgetAppearanceValid(CPDF_Annot::Rollover)) {
- pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Rollover,
+ pWidget->DrawAppearance(pDevice, *pUser2Device, CPDF_Annot::Rollover,
nullptr);
} else {
- pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal,
+ pWidget->DrawAppearance(pDevice, *pUser2Device, CPDF_Annot::Normal,
nullptr);
}
return;
}
- pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, nullptr);
+ pWidget->DrawAppearance(pDevice, *pUser2Device, CPDF_Annot::Normal, nullptr);
}
void CFFL_Button::OnDrawDeactive(CPDFSDK_PageView* pPageView,
diff --git a/fpdfsdk/formfiller/cffl_formfiller.cpp b/fpdfsdk/formfiller/cffl_formfiller.cpp
index f682122083..3e2e0c74e0 100644
--- a/fpdfsdk/formfiller/cffl_formfiller.cpp
+++ b/fpdfsdk/formfiller/cffl_formfiller.cpp
@@ -96,14 +96,14 @@ void CFFL_FormFiller::OnDraw(CPDFSDK_PageView* pPageView,
if (!CFFL_InteractiveFormFiller::IsVisible(pWidget))
return;
- pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, nullptr);
+ pWidget->DrawAppearance(pDevice, *pUser2Device, CPDF_Annot::Normal, nullptr);
}
void CFFL_FormFiller::OnDrawDeactive(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
CFX_RenderDevice* pDevice,
CFX_Matrix* pUser2Device) {
- CPDFSDKAnnotToWidget(pAnnot)->DrawAppearance(pDevice, pUser2Device,
+ CPDFSDKAnnotToWidget(pAnnot)->DrawAppearance(pDevice, *pUser2Device,
CPDF_Annot::Normal, nullptr);
}
diff --git a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
index 6d250408f0..27a4560581 100644
--- a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
+++ b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
@@ -96,10 +96,12 @@ void CFFL_InteractiveFormFiller::OnDraw(CPDFSDK_PageView* pPageView,
}
pFormFiller = GetFormFiller(pAnnot, false);
- if (pFormFiller)
+ if (pFormFiller) {
pFormFiller->OnDrawDeactive(pPageView, pAnnot, pDevice, pUser2Device);
- else
- pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, nullptr);
+ } else {
+ pWidget->DrawAppearance(pDevice, *pUser2Device, CPDF_Annot::Normal,
+ nullptr);
+ }
if (!IsReadOnly(pWidget) && IsFillingAllowed(pWidget))
pWidget->DrawShadow(pDevice, pPageView);