diff options
author | Lei Zhang <thestig@chromium.org> | 2017-08-17 14:30:08 -0700 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-08-17 21:30:51 +0000 |
commit | 4b47214ac95ee1ac7c09688363e48c3e6eb77ea8 (patch) | |
tree | 4bb575c4d6eda2cb40779ebaae04f98e3b95d216 /xfa/fxfa | |
parent | 7c9d4c272c57965cb1d407a156bab1110c65e0f6 (diff) | |
download | pdfium-4b47214ac95ee1ac7c09688363e48c3e6eb77ea8.tar.xz |
Change XFA DrawWidget() code to take its CFX_Matrix by const-ref.chromium/3192chromium/3191chromium/3190chromium/3189
Change-Id: Idc9dfcafe6727c1689443ce8f9568567e55d51c8
Reviewed-on: https://pdfium-review.googlesource.com/11114
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa')
-rw-r--r-- | xfa/fxfa/cxfa_ffarc.cpp | 2 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_ffbarcode.cpp | 4 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_ffcheckbutton.cpp | 8 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_ffcheckbutton.h | 2 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_ffcombobox.cpp | 4 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_ffcombobox.h | 2 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_fffield.cpp | 6 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_fffield.h | 2 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_ffimageedit.cpp | 6 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_ffimageedit.h | 2 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_fflistbox.cpp | 4 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_fflistbox.h | 2 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_ffpushbutton.cpp | 8 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_ffpushbutton.h | 2 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_ffrectangle.cpp | 2 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_ffsignature.cpp | 2 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_fftextedit.cpp | 4 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_fftextedit.h | 2 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_ffwidget.cpp | 106 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_ffwidget.h | 4 |
20 files changed, 87 insertions, 87 deletions
diff --git a/xfa/fxfa/cxfa_ffarc.cpp b/xfa/fxfa/cxfa_ffarc.cpp index ec60faab05..5929cb9001 100644 --- a/xfa/fxfa/cxfa_ffarc.cpp +++ b/xfa/fxfa/cxfa_ffarc.cpp @@ -28,5 +28,5 @@ void CXFA_FFArc::RenderWidget(CXFA_Graphics* pGS, if (CXFA_Margin mgWidget = m_pDataAcc->GetMargin()) XFA_RectWidthoutMargin(rtArc, mgWidget); - DrawBorder(pGS, arcObj, rtArc, &mtRotate); + DrawBorder(pGS, arcObj, rtArc, mtRotate); } diff --git a/xfa/fxfa/cxfa_ffbarcode.cpp b/xfa/fxfa/cxfa_ffbarcode.cpp index b6d0eed792..03a7c7d915 100644 --- a/xfa/fxfa/cxfa_ffbarcode.cpp +++ b/xfa/fxfa/cxfa_ffbarcode.cpp @@ -148,13 +148,13 @@ void CXFA_FFBarcode::RenderWidget(CXFA_Graphics* pGS, CXFA_FFWidget::RenderWidget(pGS, mtRotate, dwStatus); CXFA_Border borderUI = m_pDataAcc->GetUIBorder(); - DrawBorder(pGS, borderUI, m_rtUI, &mtRotate); + DrawBorder(pGS, borderUI, m_rtUI, mtRotate); RenderCaption(pGS, &mtRotate); CFX_RectF rtWidget = m_pNormalWidget->GetWidgetRect(); CFX_Matrix mt(1, 0, 0, 1, rtWidget.left, rtWidget.top); mt.Concat(mtRotate); - m_pNormalWidget->DrawWidget(pGS, &mt); + m_pNormalWidget->DrawWidget(pGS, mt); } void CXFA_FFBarcode::UpdateWidgetProperty() { diff --git a/xfa/fxfa/cxfa_ffcheckbutton.cpp b/xfa/fxfa/cxfa_ffcheckbutton.cpp index 6e23d58fc6..5b8766d79c 100644 --- a/xfa/fxfa/cxfa_ffcheckbutton.cpp +++ b/xfa/fxfa/cxfa_ffcheckbutton.cpp @@ -234,7 +234,7 @@ void CXFA_FFCheckButton::RenderWidget(CXFA_Graphics* pGS, CXFA_FFWidget::RenderWidget(pGS, mtRotate, dwStatus); CXFA_Border borderUI = m_pDataAcc->GetUIBorder(); DrawBorderWithFlags( - pGS, borderUI, m_rtUI, &mtRotate, + pGS, borderUI, m_rtUI, mtRotate, m_pDataAcc->GetCheckButtonShape() == XFA_ATTRIBUTEENUM_Round ? XFA_DRAWBOX_ForceRound : 0); @@ -243,7 +243,7 @@ void CXFA_FFCheckButton::RenderWidget(CXFA_Graphics* pGS, m_pDataAcc->GetCheckButtonShape() == XFA_ATTRIBUTEENUM_Round); CFX_Matrix mt(1, 0, 0, 1, m_rtCheckBox.left, m_rtCheckBox.top); mt.Concat(mtRotate); - GetApp()->GetWidgetMgr()->OnDrawWidget(m_pNormalWidget.get(), pGS, &mt); + GetApp()->GetWidgetMgr()->OnDrawWidget(m_pNormalWidget.get(), pGS, mt); } bool CXFA_FFCheckButton::OnLButtonUp(uint32_t dwFlags, @@ -339,6 +339,6 @@ void CXFA_FFCheckButton::OnProcessEvent(CFWL_Event* pEvent) { } void CXFA_FFCheckButton::OnDrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) { - m_pOldDelegate->OnDrawWidget(pGraphics, pMatrix); + const CFX_Matrix& matrix) { + m_pOldDelegate->OnDrawWidget(pGraphics, matrix); } diff --git a/xfa/fxfa/cxfa_ffcheckbutton.h b/xfa/fxfa/cxfa_ffcheckbutton.h index b993545ae3..e405381fc8 100644 --- a/xfa/fxfa/cxfa_ffcheckbutton.h +++ b/xfa/fxfa/cxfa_ffcheckbutton.h @@ -28,7 +28,7 @@ class CXFA_FFCheckButton : public CXFA_FFField { void OnProcessMessage(CFWL_Message* pMessage) override; void OnProcessEvent(CFWL_Event* pEvent) override; void OnDrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix = nullptr) override; + const CFX_Matrix& matrix) override; void SetFWLCheckState(XFA_CHECKSTATE eCheckState); diff --git a/xfa/fxfa/cxfa_ffcombobox.cpp b/xfa/fxfa/cxfa_ffcombobox.cpp index e256616521..0c8c80c290 100644 --- a/xfa/fxfa/cxfa_ffcombobox.cpp +++ b/xfa/fxfa/cxfa_ffcombobox.cpp @@ -355,6 +355,6 @@ void CXFA_FFComboBox::OnProcessEvent(CFWL_Event* pEvent) { } void CXFA_FFComboBox::OnDrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) { - m_pOldDelegate->OnDrawWidget(pGraphics, pMatrix); + const CFX_Matrix& matrix) { + m_pOldDelegate->OnDrawWidget(pGraphics, matrix); } diff --git a/xfa/fxfa/cxfa_ffcombobox.h b/xfa/fxfa/cxfa_ffcombobox.h index 6c93646195..33e7d7cc1f 100644 --- a/xfa/fxfa/cxfa_ffcombobox.h +++ b/xfa/fxfa/cxfa_ffcombobox.h @@ -40,7 +40,7 @@ class CXFA_FFComboBox : public CXFA_FFField { void OnProcessMessage(CFWL_Message* pMessage) override; void OnProcessEvent(CFWL_Event* pEvent) override; void OnDrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix = nullptr) override; + const CFX_Matrix& matrix) override; virtual void OpenDropDownList(); diff --git a/xfa/fxfa/cxfa_fffield.cpp b/xfa/fxfa/cxfa_fffield.cpp index c62f4dcaec..31003417a8 100644 --- a/xfa/fxfa/cxfa_fffield.cpp +++ b/xfa/fxfa/cxfa_fffield.cpp @@ -68,14 +68,14 @@ void CXFA_FFField::RenderWidget(CXFA_Graphics* pGS, CXFA_FFWidget::RenderWidget(pGS, mtRotate, dwStatus); CXFA_Border borderUI = m_pDataAcc->GetUIBorder(); - DrawBorder(pGS, borderUI, m_rtUI, &mtRotate); + DrawBorder(pGS, borderUI, m_rtUI, mtRotate); RenderCaption(pGS, &mtRotate); DrawHighlight(pGS, &mtRotate, dwStatus, false); CFX_RectF rtWidget = m_pNormalWidget->GetWidgetRect(); CFX_Matrix mt(1, 0, 0, 1, rtWidget.left, rtWidget.top); mt.Concat(mtRotate); - GetApp()->GetWidgetMgr()->OnDrawWidget(m_pNormalWidget.get(), pGS, &mt); + GetApp()->GetWidgetMgr()->OnDrawWidget(m_pNormalWidget.get(), pGS, mt); } void CXFA_FFField::DrawHighlight(CXFA_Graphics* pGS, @@ -779,4 +779,4 @@ void CXFA_FFField::OnProcessEvent(CFWL_Event* pEvent) { } void CXFA_FFField::OnDrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) {} + const CFX_Matrix& matrix) {} diff --git a/xfa/fxfa/cxfa_fffield.h b/xfa/fxfa/cxfa_fffield.h index 5ed6b48fce..e47664291a 100644 --- a/xfa/fxfa/cxfa_fffield.h +++ b/xfa/fxfa/cxfa_fffield.h @@ -56,7 +56,7 @@ class CXFA_FFField : public CXFA_FFWidget, public IFWL_WidgetDelegate { void OnProcessMessage(CFWL_Message* pMessage) override; void OnProcessEvent(CFWL_Event* pEvent) override; void OnDrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix = nullptr) override; + const CFX_Matrix& matrix) override; void UpdateFWL(); uint32_t UpdateUIProperty(); diff --git a/xfa/fxfa/cxfa_ffimageedit.cpp b/xfa/fxfa/cxfa_ffimageedit.cpp index bc5678ac90..1c9e014256 100644 --- a/xfa/fxfa/cxfa_ffimageedit.cpp +++ b/xfa/fxfa/cxfa_ffimageedit.cpp @@ -62,7 +62,7 @@ void CXFA_FFImageEdit::RenderWidget(CXFA_Graphics* pGS, CXFA_FFWidget::RenderWidget(pGS, mtRotate, dwStatus); CXFA_Border borderUI = m_pDataAcc->GetUIBorder(); - DrawBorder(pGS, borderUI, m_rtUI, &mtRotate); + DrawBorder(pGS, borderUI, m_rtUI, mtRotate); RenderCaption(pGS, &mtRotate); CFX_RetainPtr<CFX_DIBitmap> pDIBitmap = m_pDataAcc->GetImageEditImage(); if (!pDIBitmap) @@ -137,6 +137,6 @@ void CXFA_FFImageEdit::OnProcessEvent(CFWL_Event* pEvent) { } void CXFA_FFImageEdit::OnDrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) { - m_pOldDelegate->OnDrawWidget(pGraphics, pMatrix); + const CFX_Matrix& matrix) { + m_pOldDelegate->OnDrawWidget(pGraphics, matrix); } diff --git a/xfa/fxfa/cxfa_ffimageedit.h b/xfa/fxfa/cxfa_ffimageedit.h index adda3028c3..d9ab6152f5 100644 --- a/xfa/fxfa/cxfa_ffimageedit.h +++ b/xfa/fxfa/cxfa_ffimageedit.h @@ -24,7 +24,7 @@ class CXFA_FFImageEdit : public CXFA_FFField { void OnProcessMessage(CFWL_Message* pMessage) override; void OnProcessEvent(CFWL_Event* pEvent) override; void OnDrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix = nullptr) override; + const CFX_Matrix& matrix) override; private: void SetFWLRect() override; diff --git a/xfa/fxfa/cxfa_fflistbox.cpp b/xfa/fxfa/cxfa_fflistbox.cpp index c086953a29..66e1fdb4d0 100644 --- a/xfa/fxfa/cxfa_fflistbox.cpp +++ b/xfa/fxfa/cxfa_fflistbox.cpp @@ -205,6 +205,6 @@ void CXFA_FFListBox::OnProcessEvent(CFWL_Event* pEvent) { } void CXFA_FFListBox::OnDrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) { - m_pOldDelegate->OnDrawWidget(pGraphics, pMatrix); + const CFX_Matrix& matrix) { + m_pOldDelegate->OnDrawWidget(pGraphics, matrix); } diff --git a/xfa/fxfa/cxfa_fflistbox.h b/xfa/fxfa/cxfa_fflistbox.h index f89df4c529..bf97d931d8 100644 --- a/xfa/fxfa/cxfa_fflistbox.h +++ b/xfa/fxfa/cxfa_fflistbox.h @@ -20,7 +20,7 @@ class CXFA_FFListBox : public CXFA_FFField { void OnProcessMessage(CFWL_Message* pMessage) override; void OnProcessEvent(CFWL_Event* pEvent) override; void OnDrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix = nullptr) override; + const CFX_Matrix& matrix) override; void OnSelectChanged(CFWL_Widget* pWidget); void SetItemState(int32_t nIndex, bool bSelected); diff --git a/xfa/fxfa/cxfa_ffpushbutton.cpp b/xfa/fxfa/cxfa_ffpushbutton.cpp index 45d4e71b3f..d201e42c86 100644 --- a/xfa/fxfa/cxfa_ffpushbutton.cpp +++ b/xfa/fxfa/cxfa_ffpushbutton.cpp @@ -43,7 +43,7 @@ void CXFA_FFPushButton::RenderWidget(CXFA_Graphics* pGS, CFX_RectF rtWidget = GetRectWithoutRotate(); CFX_Matrix mt(1, 0, 0, 1, rtWidget.left, rtWidget.top); mt.Concat(mtRotate); - GetApp()->GetWidgetMgr()->OnDrawWidget(m_pNormalWidget.get(), pGS, &mt); + GetApp()->GetWidgetMgr()->OnDrawWidget(m_pNormalWidget.get(), pGS, mt); } bool CXFA_FFPushButton::LoadWidget() { @@ -204,7 +204,7 @@ void CXFA_FFPushButton::OnProcessEvent(CFWL_Event* pEvent) { } void CXFA_FFPushButton::OnDrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) { + const CFX_Matrix& matrix) { if (m_pNormalWidget->GetStylesEx() & XFA_FWL_PSBSTYLEEXT_HiliteInverted) { if ((m_pNormalWidget->GetStates() & FWL_STATE_PSB_Pressed) && (m_pNormalWidget->GetStates() & FWL_STATE_PSB_Hovered)) { @@ -214,7 +214,7 @@ void CXFA_FFPushButton::OnDrawWidget(CXFA_Graphics* pGraphics, CXFA_Path path; path.AddRectangle(rtFill.left, rtFill.top, rtFill.width, rtFill.height); pGraphics->SetFillColor(CXFA_Color(FXARGB_MAKE(128, 128, 255, 255))); - pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix); + pGraphics->FillPath(&path, FXFILL_WINDING, &matrix); } return; } @@ -229,7 +229,7 @@ void CXFA_FFPushButton::OnDrawWidget(CXFA_Graphics* pGraphics, CXFA_Path path; CFX_RectF rect = m_pNormalWidget->GetWidgetRect(); path.AddRectangle(0, 0, rect.width, rect.height); - pGraphics->StrokePath(&path, (CFX_Matrix*)pMatrix); + pGraphics->StrokePath(&path, &matrix); } } } diff --git a/xfa/fxfa/cxfa_ffpushbutton.h b/xfa/fxfa/cxfa_ffpushbutton.h index dda06068cd..f5b7f06e7e 100644 --- a/xfa/fxfa/cxfa_ffpushbutton.h +++ b/xfa/fxfa/cxfa_ffpushbutton.h @@ -34,7 +34,7 @@ class CXFA_FFPushButton : public CXFA_FFField { void OnProcessMessage(CFWL_Message* pMessage) override; void OnProcessEvent(CFWL_Event* pEvent) override; void OnDrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix = nullptr) override; + const CFX_Matrix& matrix) override; private: void LoadHighlightCaption(); diff --git a/xfa/fxfa/cxfa_ffrectangle.cpp b/xfa/fxfa/cxfa_ffrectangle.cpp index 476f3acfac..fe71048bc7 100644 --- a/xfa/fxfa/cxfa_ffrectangle.cpp +++ b/xfa/fxfa/cxfa_ffrectangle.cpp @@ -29,5 +29,5 @@ void CXFA_FFRectangle::RenderWidget(CXFA_Graphics* pGS, CFX_Matrix mtRotate = GetRotateMatrix(); mtRotate.Concat(matrix); - DrawBorder(pGS, rtObj, rect, &mtRotate); + DrawBorder(pGS, rtObj, rect, mtRotate); } diff --git a/xfa/fxfa/cxfa_ffsignature.cpp b/xfa/fxfa/cxfa_ffsignature.cpp index f527cd9cf8..202e387f89 100644 --- a/xfa/fxfa/cxfa_ffsignature.cpp +++ b/xfa/fxfa/cxfa_ffsignature.cpp @@ -32,7 +32,7 @@ void CXFA_FFSignature::RenderWidget(CXFA_Graphics* pGS, CXFA_FFWidget::RenderWidget(pGS, mtRotate, dwStatus); CXFA_Border borderUI = m_pDataAcc->GetUIBorder(); - DrawBorder(pGS, borderUI, m_rtUI, &mtRotate); + DrawBorder(pGS, borderUI, m_rtUI, mtRotate); RenderCaption(pGS, &mtRotate); DrawHighlight(pGS, &mtRotate, dwStatus, false); } diff --git a/xfa/fxfa/cxfa_fftextedit.cpp b/xfa/fxfa/cxfa_fftextedit.cpp index 9d6cffb2d7..dfa4c41309 100644 --- a/xfa/fxfa/cxfa_fftextedit.cpp +++ b/xfa/fxfa/cxfa_fftextedit.cpp @@ -354,6 +354,6 @@ void CXFA_FFTextEdit::OnProcessEvent(CFWL_Event* pEvent) { } void CXFA_FFTextEdit::OnDrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) { - m_pOldDelegate->OnDrawWidget(pGraphics, pMatrix); + const CFX_Matrix& matrix) { + m_pOldDelegate->OnDrawWidget(pGraphics, matrix); } diff --git a/xfa/fxfa/cxfa_fftextedit.h b/xfa/fxfa/cxfa_fftextedit.h index 48656adfc1..2a3da37350 100644 --- a/xfa/fxfa/cxfa_fftextedit.h +++ b/xfa/fxfa/cxfa_fftextedit.h @@ -34,7 +34,7 @@ class CXFA_FFTextEdit : public CXFA_FFField { void OnProcessMessage(CFWL_Message* pMessage) override; void OnProcessEvent(CFWL_Event* pEvent) override; void OnDrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix = nullptr) override; + const CFX_Matrix& matrix) override; void OnTextChanged(CFWL_Widget* pWidget, const CFX_WideString& wsChanged, diff --git a/xfa/fxfa/cxfa_ffwidget.cpp b/xfa/fxfa/cxfa_ffwidget.cpp index ee445bbf25..26ab37d53c 100644 --- a/xfa/fxfa/cxfa_ffwidget.cpp +++ b/xfa/fxfa/cxfa_ffwidget.cpp @@ -391,7 +391,7 @@ void XFA_BOX_Fill_Radial(CXFA_Box box, CXFA_Graphics* pGS, CXFA_Path& fillPath, CFX_RectF rtFill, - const CFX_Matrix* pMatrix) { + const CFX_Matrix& matrix) { CXFA_Fill fill = box.GetFill(); FX_ARGB crStart, crEnd; crStart = fill.GetColor(); @@ -407,14 +407,14 @@ void XFA_BOX_Fill_Radial(CXFA_Box box, 2, true, true, crStart, crEnd); pGS->SetFillColor(CXFA_Color(&shading)); - pGS->FillPath(&fillPath, FXFILL_WINDING, pMatrix); + pGS->FillPath(&fillPath, FXFILL_WINDING, &matrix); } void XFA_BOX_Fill_Pattern(CXFA_Box box, CXFA_Graphics* pGS, CXFA_Path& fillPath, CFX_RectF rtFill, - const CFX_Matrix* pMatrix) { + const CFX_Matrix& matrix) { CXFA_Fill fill = box.GetFill(); FX_ARGB crStart, crEnd; crStart = fill.GetColor(); @@ -442,14 +442,14 @@ void XFA_BOX_Fill_Pattern(CXFA_Box box, CXFA_Pattern pattern(iHatch, crEnd, crStart); pGS->SetFillColor(CXFA_Color(&pattern, 0x0)); - pGS->FillPath(&fillPath, FXFILL_WINDING, pMatrix); + pGS->FillPath(&fillPath, FXFILL_WINDING, &matrix); } void XFA_BOX_Fill_Linear(CXFA_Box box, CXFA_Graphics* pGS, CXFA_Path& fillPath, CFX_RectF rtFill, - const CFX_Matrix* pMatrix) { + const CFX_Matrix& matrix) { CXFA_Fill fill = box.GetFill(); FX_ARGB crStart = fill.GetColor(); FX_ARGB crEnd; @@ -478,14 +478,14 @@ void XFA_BOX_Fill_Linear(CXFA_Box box, } CXFA_Shading shading(ptStart, ptEnd, false, false, crStart, crEnd); pGS->SetFillColor(CXFA_Color(&shading)); - pGS->FillPath(&fillPath, FXFILL_WINDING, pMatrix); + pGS->FillPath(&fillPath, FXFILL_WINDING, &matrix); } void XFA_BOX_Fill(CXFA_Box box, const std::vector<CXFA_Stroke>& strokes, CXFA_Graphics* pGS, const CFX_RectF& rtWidget, - const CFX_Matrix* pMatrix, + const CFX_Matrix& matrix, uint32_t dwFlags) { CXFA_Fill fill = box.GetFill(); if (!fill || fill.GetPresence() != XFA_ATTRIBUTEENUM_Visible) @@ -499,13 +499,13 @@ void XFA_BOX_Fill(CXFA_Box box, XFA_Element eType = fill.GetFillType(); switch (eType) { case XFA_Element::Radial: - XFA_BOX_Fill_Radial(box, pGS, fillPath, rtWidget, pMatrix); + XFA_BOX_Fill_Radial(box, pGS, fillPath, rtWidget, matrix); break; case XFA_Element::Pattern: - XFA_BOX_Fill_Pattern(box, pGS, fillPath, rtWidget, pMatrix); + XFA_BOX_Fill_Pattern(box, pGS, fillPath, rtWidget, matrix); break; case XFA_Element::Linear: - XFA_BOX_Fill_Linear(box, pGS, fillPath, rtWidget, pMatrix); + XFA_BOX_Fill_Linear(box, pGS, fillPath, rtWidget, matrix); break; default: { FX_ARGB cr; @@ -521,7 +521,7 @@ void XFA_BOX_Fill(CXFA_Box box, cr = fill.GetColor(); } pGS->SetFillColor(CXFA_Color(cr)); - pGS->FillPath(&fillPath, FXFILL_WINDING, pMatrix); + pGS->FillPath(&fillPath, FXFILL_WINDING, &matrix); } break; } pGS->RestoreGraphState(); @@ -530,7 +530,7 @@ void XFA_BOX_Fill(CXFA_Box box, void XFA_BOX_StrokePath(CXFA_Stroke stroke, CXFA_Path* pPath, CXFA_Graphics* pGS, - const CFX_Matrix* pMatrix) { + const CFX_Matrix& matrix) { if (!stroke || !stroke.IsVisible()) { return; } @@ -548,14 +548,14 @@ void XFA_BOX_StrokePath(CXFA_Stroke stroke, XFA_StrokeTypeSetLineDash(pGS, stroke.GetStrokeType(), XFA_ATTRIBUTEENUM_Butt); pGS->SetStrokeColor(CXFA_Color(stroke.GetColor())); - pGS->StrokePath(pPath, pMatrix); + pGS->StrokePath(pPath, &matrix); pGS->RestoreGraphState(); } void XFA_BOX_StrokeArc(CXFA_Box box, CXFA_Graphics* pGS, CFX_RectF rtWidget, - const CFX_Matrix* pMatrix, + const CFX_Matrix& matrix, uint32_t dwFlags) { CXFA_Edge edge = box.GetEdge(0); if (!edge || !edge.IsVisible()) { @@ -586,7 +586,7 @@ void XFA_BOX_StrokeArc(CXFA_Box box, CXFA_Path arcPath; XFA_BOX_GetPath_Arc(box, rtWidget, arcPath, dwFlags); - XFA_BOX_StrokePath(edge, &arcPath, pGS, pMatrix); + XFA_BOX_StrokePath(edge, &arcPath, pGS, matrix); return; } pGS->SaveGraphState(); @@ -615,33 +615,33 @@ void XFA_BOX_StrokeArc(CXFA_Box box, FX_PI); pGS->SetStrokeColor(CXFA_Color(0xFF808080)); - pGS->StrokePath(&arcPath, pMatrix); + pGS->StrokePath(&arcPath, &matrix); arcPath.Clear(); arcPath.AddArc(rtWidget.TopLeft(), rtWidget.Size(), -1.0f * FX_PI / 4.0f, FX_PI); pGS->SetStrokeColor(CXFA_Color(0xFFFFFFFF)); - pGS->StrokePath(&arcPath, pMatrix); + pGS->StrokePath(&arcPath, &matrix); rtWidget.Deflate(fHalf, fHalf); arcPath.Clear(); arcPath.AddArc(rtWidget.TopLeft(), rtWidget.Size(), 3.0f * FX_PI / 4.0f, FX_PI); pGS->SetStrokeColor(CXFA_Color(0xFF404040)); - pGS->StrokePath(&arcPath, pMatrix); + pGS->StrokePath(&arcPath, &matrix); arcPath.Clear(); arcPath.AddArc(rtWidget.TopLeft(), rtWidget.Size(), -1.0f * FX_PI / 4.0f, FX_PI); pGS->SetStrokeColor(CXFA_Color(0xFFC0C0C0)); - pGS->StrokePath(&arcPath, pMatrix); + pGS->StrokePath(&arcPath, &matrix); pGS->RestoreGraphState(); } void XFA_Draw3DRect(CXFA_Graphics* pGraphic, const CFX_RectF& rt, float fLineWidth, - const CFX_Matrix* pMatrix, + const CFX_Matrix& matrix, FX_ARGB argbTopLeft, FX_ARGB argbBottomRight) { float fBottom = rt.bottom(); @@ -655,7 +655,7 @@ void XFA_Draw3DRect(CXFA_Graphics* pGraphic, pathLT.LineTo(CFX_PointF(rt.left + fLineWidth, fBottom - fLineWidth)); pathLT.LineTo(CFX_PointF(rt.left, fBottom)); pGraphic->SetFillColor(CXFA_Color(argbTopLeft)); - pGraphic->FillPath(&pathLT, FXFILL_WINDING, pMatrix); + pGraphic->FillPath(&pathLT, FXFILL_WINDING, &matrix); CXFA_Path pathRB; pathRB.MoveTo(CFX_PointF(fRight, rt.top)); @@ -666,13 +666,13 @@ void XFA_Draw3DRect(CXFA_Graphics* pGraphic, pathRB.LineTo(CFX_PointF(fRight - fLineWidth, rt.top + fLineWidth)); pathRB.LineTo(CFX_PointF(fRight, rt.top)); pGraphic->SetFillColor(CXFA_Color(argbBottomRight)); - pGraphic->FillPath(&pathRB, FXFILL_WINDING, pMatrix); + pGraphic->FillPath(&pathRB, FXFILL_WINDING, &matrix); } void XFA_BOX_Stroke_3DRect_Lowered(CXFA_Graphics* pGS, CFX_RectF rt, float fThickness, - const CFX_Matrix* pMatrix) { + const CFX_Matrix& matrix) { float fHalfWidth = fThickness / 2.0f; CFX_RectF rtInner(rt); rtInner.Deflate(fHalfWidth, fHalfWidth); @@ -681,14 +681,14 @@ void XFA_BOX_Stroke_3DRect_Lowered(CXFA_Graphics* pGS, path.AddRectangle(rt.left, rt.top, rt.width, rt.height); path.AddRectangle(rtInner.left, rtInner.top, rtInner.width, rtInner.height); pGS->SetFillColor(CXFA_Color(0xFF000000)); - pGS->FillPath(&path, FXFILL_ALTERNATE, pMatrix); - XFA_Draw3DRect(pGS, rtInner, fHalfWidth, pMatrix, 0xFF808080, 0xFFC0C0C0); + pGS->FillPath(&path, FXFILL_ALTERNATE, &matrix); + XFA_Draw3DRect(pGS, rtInner, fHalfWidth, matrix, 0xFF808080, 0xFFC0C0C0); } void XFA_BOX_Stroke_3DRect_Raised(CXFA_Graphics* pGS, CFX_RectF rt, float fThickness, - const CFX_Matrix* pMatrix) { + const CFX_Matrix& matrix) { float fHalfWidth = fThickness / 2.0f; CFX_RectF rtInner(rt); rtInner.Deflate(fHalfWidth, fHalfWidth); @@ -697,37 +697,37 @@ void XFA_BOX_Stroke_3DRect_Raised(CXFA_Graphics* pGS, path.AddRectangle(rt.left, rt.top, rt.width, rt.height); path.AddRectangle(rtInner.left, rtInner.top, rtInner.width, rtInner.height); pGS->SetFillColor(CXFA_Color(0xFF000000)); - pGS->FillPath(&path, FXFILL_ALTERNATE, pMatrix); - XFA_Draw3DRect(pGS, rtInner, fHalfWidth, pMatrix, 0xFFFFFFFF, 0xFF808080); + pGS->FillPath(&path, FXFILL_ALTERNATE, &matrix); + XFA_Draw3DRect(pGS, rtInner, fHalfWidth, matrix, 0xFFFFFFFF, 0xFF808080); } void XFA_BOX_Stroke_3DRect_Etched(CXFA_Graphics* pGS, CFX_RectF rt, float fThickness, - const CFX_Matrix* pMatrix) { + const CFX_Matrix& matrix) { float fHalfWidth = fThickness / 2.0f; - XFA_Draw3DRect(pGS, rt, fThickness, pMatrix, 0xFF808080, 0xFFFFFFFF); + XFA_Draw3DRect(pGS, rt, fThickness, matrix, 0xFF808080, 0xFFFFFFFF); CFX_RectF rtInner(rt); rtInner.Deflate(fHalfWidth, fHalfWidth); - XFA_Draw3DRect(pGS, rtInner, fHalfWidth, pMatrix, 0xFFFFFFFF, 0xFF808080); + XFA_Draw3DRect(pGS, rtInner, fHalfWidth, matrix, 0xFFFFFFFF, 0xFF808080); } void XFA_BOX_Stroke_3DRect_Embossed(CXFA_Graphics* pGS, CFX_RectF rt, float fThickness, - const CFX_Matrix* pMatrix) { + const CFX_Matrix& matrix) { float fHalfWidth = fThickness / 2.0f; - XFA_Draw3DRect(pGS, rt, fThickness, pMatrix, 0xFF808080, 0xFF000000); + XFA_Draw3DRect(pGS, rt, fThickness, matrix, 0xFF808080, 0xFF000000); CFX_RectF rtInner(rt); rtInner.Deflate(fHalfWidth, fHalfWidth); - XFA_Draw3DRect(pGS, rtInner, fHalfWidth, pMatrix, 0xFF000000, 0xFF808080); + XFA_Draw3DRect(pGS, rtInner, fHalfWidth, matrix, 0xFF000000, 0xFF808080); } void XFA_BOX_Stroke_Rect(CXFA_Box box, const std::vector<CXFA_Stroke>& strokes, CXFA_Graphics* pGS, CFX_RectF rtWidget, - const CFX_Matrix* pMatrix) { + const CFX_Matrix& matrix) { bool bVisible = false; float fThickness = 0; int32_t i3DType = box.Get3DStyle(bVisible, fThickness); @@ -737,16 +737,16 @@ void XFA_BOX_Stroke_Rect(CXFA_Box box, } switch (i3DType) { case XFA_ATTRIBUTEENUM_Lowered: - XFA_BOX_Stroke_3DRect_Lowered(pGS, rtWidget, fThickness, pMatrix); + XFA_BOX_Stroke_3DRect_Lowered(pGS, rtWidget, fThickness, matrix); break; case XFA_ATTRIBUTEENUM_Raised: - XFA_BOX_Stroke_3DRect_Raised(pGS, rtWidget, fThickness, pMatrix); + XFA_BOX_Stroke_3DRect_Raised(pGS, rtWidget, fThickness, matrix); break; case XFA_ATTRIBUTEENUM_Etched: - XFA_BOX_Stroke_3DRect_Etched(pGS, rtWidget, fThickness, pMatrix); + XFA_BOX_Stroke_3DRect_Etched(pGS, rtWidget, fThickness, matrix); break; case XFA_ATTRIBUTEENUM_Embossed: - XFA_BOX_Stroke_3DRect_Embossed(pGS, rtWidget, fThickness, pMatrix); + XFA_BOX_Stroke_3DRect_Embossed(pGS, rtWidget, fThickness, matrix); break; } return; @@ -789,7 +789,7 @@ void XFA_BOX_Stroke_Rect(CXFA_Box box, if ((i % 1) == 0 && stroke.GetRadius() < 0) { bool bEmpty = path.IsEmpty(); if (!bEmpty) { - XFA_BOX_StrokePath(stroke, &path, pGS, pMatrix); + XFA_BOX_StrokePath(stroke, &path, pGS, matrix); path.Clear(); } bStart = true; @@ -799,7 +799,7 @@ void XFA_BOX_Stroke_Rect(CXFA_Box box, CXFA_Stroke stroke2 = strokes[(i + 1) % 8]; bStart = !stroke.SameStyles(stroke2); if (bStart) { - XFA_BOX_StrokePath(stroke, &path, pGS, pMatrix); + XFA_BOX_StrokePath(stroke, &path, pGS, matrix); path.Clear(); } } @@ -808,7 +808,7 @@ void XFA_BOX_Stroke_Rect(CXFA_Box box, if (bClose) { path.Close(); } - XFA_BOX_StrokePath(strokes[7], &path, pGS, pMatrix); + XFA_BOX_StrokePath(strokes[7], &path, pGS, matrix); } } @@ -816,10 +816,10 @@ void XFA_BOX_Stroke(CXFA_Box box, const std::vector<CXFA_Stroke>& strokes, CXFA_Graphics* pGS, CFX_RectF rtWidget, - const CFX_Matrix* pMatrix, + const CFX_Matrix& matrix, uint32_t dwFlags) { if (box.IsArc() || (dwFlags & XFA_DRAWBOX_ForceRound) != 0) { - XFA_BOX_StrokeArc(box, pGS, rtWidget, pMatrix, dwFlags); + XFA_BOX_StrokeArc(box, pGS, rtWidget, matrix, dwFlags); return; } bool bVisible = false; @@ -875,13 +875,13 @@ void XFA_BOX_Stroke(CXFA_Box box, break; } } - XFA_BOX_Stroke_Rect(box, strokes, pGS, rtWidget, pMatrix); + XFA_BOX_Stroke_Rect(box, strokes, pGS, rtWidget, matrix); } void XFA_DrawBox(CXFA_Box box, CXFA_Graphics* pGS, const CFX_RectF& rtWidget, - const CFX_Matrix* pMatrix, + const CFX_Matrix& matrix, uint32_t dwFlags) { if (!box || box.GetPresence() != XFA_ATTRIBUTEENUM_Visible) return; @@ -895,8 +895,8 @@ void XFA_DrawBox(CXFA_Box box, if (!(dwFlags & XFA_DRAWBOX_ForceRound) && eType != XFA_Element::Arc) box.GetStrokes(&strokes); - XFA_BOX_Fill(box, strokes, pGS, rtWidget, pMatrix, dwFlags); - XFA_BOX_Stroke(box, strokes, pGS, rtWidget, pMatrix, dwFlags); + XFA_BOX_Fill(box, strokes, pGS, rtWidget, matrix, dwFlags); + XFA_BOX_Stroke(box, strokes, pGS, rtWidget, matrix, dwFlags); } } // namespace @@ -991,7 +991,7 @@ void CXFA_FFWidget::RenderWidget(CXFA_Graphics* pGS, XFA_RectWidthoutMargin(rtBorder, margin); rtBorder.Normalize(); - DrawBorder(pGS, border, rtBorder, &matrix); + DrawBorder(pGS, border, rtBorder, matrix); } bool CXFA_FFWidget::IsLoaded() { @@ -1014,16 +1014,16 @@ void CXFA_FFWidget::UpdateWidgetProperty() {} void CXFA_FFWidget::DrawBorder(CXFA_Graphics* pGS, CXFA_Box box, const CFX_RectF& rtBorder, - const CFX_Matrix* pMatrix) { - XFA_DrawBox(box, pGS, rtBorder, pMatrix, 0); + const CFX_Matrix& matrix) { + XFA_DrawBox(box, pGS, rtBorder, matrix, 0); } void CXFA_FFWidget::DrawBorderWithFlags(CXFA_Graphics* pGS, CXFA_Box box, const CFX_RectF& rtBorder, - const CFX_Matrix* pMatrix, + const CFX_Matrix& matrix, uint32_t dwFlags) { - XFA_DrawBox(box, pGS, rtBorder, pMatrix, dwFlags); + XFA_DrawBox(box, pGS, rtBorder, matrix, dwFlags); } void CXFA_FFWidget::AddInvalidateRect() { diff --git a/xfa/fxfa/cxfa_ffwidget.h b/xfa/fxfa/cxfa_ffwidget.h index cac229416e..f2ca86f774 100644 --- a/xfa/fxfa/cxfa_ffwidget.h +++ b/xfa/fxfa/cxfa_ffwidget.h @@ -169,11 +169,11 @@ class CXFA_FFWidget : public CXFA_ContentLayoutItem { void DrawBorder(CXFA_Graphics* pGS, CXFA_Box box, const CFX_RectF& rtBorder, - const CFX_Matrix* pMatrix); + const CFX_Matrix& matrix); void DrawBorderWithFlags(CXFA_Graphics* pGS, CXFA_Box box, const CFX_RectF& rtBorder, - const CFX_Matrix* pMatrix, + const CFX_Matrix& matrix, uint32_t dwFlags); CFX_RectF GetRectWithoutRotate(); |