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 | |
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')
55 files changed, 226 insertions, 234 deletions
diff --git a/xfa/fwl/cfwl_barcode.cpp b/xfa/fwl/cfwl_barcode.cpp index b51bb24366..8db40d2b19 100644 --- a/xfa/fwl/cfwl_barcode.cpp +++ b/xfa/fwl/cfwl_barcode.cpp @@ -36,7 +36,7 @@ void CFWL_Barcode::Update() { } void CFWL_Barcode::DrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) { + const CFX_Matrix& matrix) { if (!pGraphics) return; if (!m_pProperties->m_pThemeProvider) @@ -49,13 +49,12 @@ void CFWL_Barcode::DrawWidget(CXFA_Graphics* pGraphics, CFX_Matrix mt; mt.e = GetRTClient().left; mt.f = GetRTClient().top; - if (pMatrix) - mt.Concat(*pMatrix); + mt.Concat(matrix); - m_pBarcodeEngine->RenderDevice(pGraphics->GetRenderDevice(), pMatrix); + m_pBarcodeEngine->RenderDevice(pGraphics->GetRenderDevice(), &matrix); return; } - CFWL_Edit::DrawWidget(pGraphics, pMatrix); + CFWL_Edit::DrawWidget(pGraphics, matrix); } void CFWL_Barcode::SetType(BC_TYPE type) { diff --git a/xfa/fwl/cfwl_barcode.h b/xfa/fwl/cfwl_barcode.h index c913a17b10..48bdeabdd3 100644 --- a/xfa/fwl/cfwl_barcode.h +++ b/xfa/fwl/cfwl_barcode.h @@ -45,7 +45,7 @@ class CFWL_Barcode : public CFWL_Edit { // CFWL_Widget FWL_Type GetClassID() const override; void Update() override; - void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; + void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix& matrix) override; void OnProcessEvent(CFWL_Event* pEvent) override; // CFWL_Edit diff --git a/xfa/fwl/cfwl_caret.cpp b/xfa/fwl/cfwl_caret.cpp index be7ecbf331..1cef4f673a 100644 --- a/xfa/fwl/cfwl_caret.cpp +++ b/xfa/fwl/cfwl_caret.cpp @@ -44,7 +44,7 @@ FWL_Type CFWL_Caret::GetClassID() const { void CFWL_Caret::Update() {} void CFWL_Caret::DrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) { + const CFX_Matrix& matrix) { if (!pGraphics) return; if (!m_pProperties->m_pThemeProvider) @@ -52,7 +52,7 @@ void CFWL_Caret::DrawWidget(CXFA_Graphics* pGraphics, if (!m_pProperties->m_pThemeProvider) return; - DrawCaretBK(pGraphics, m_pProperties->m_pThemeProvider, pMatrix); + DrawCaretBK(pGraphics, m_pProperties->m_pThemeProvider, &matrix); } void CFWL_Caret::ShowCaret() { @@ -90,8 +90,8 @@ void CFWL_Caret::DrawCaretBK(CXFA_Graphics* pGraphics, void CFWL_Caret::OnProcessMessage(CFWL_Message* pMessage) {} void CFWL_Caret::OnDrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) { - DrawWidget(pGraphics, pMatrix); + const CFX_Matrix& matrix) { + DrawWidget(pGraphics, matrix); } CFWL_Caret::Timer::Timer(CFWL_Caret* pCaret) : CFWL_Timer(pCaret) {} diff --git a/xfa/fwl/cfwl_caret.h b/xfa/fwl/cfwl_caret.h index d00f38a29c..32bc79535a 100644 --- a/xfa/fwl/cfwl_caret.h +++ b/xfa/fwl/cfwl_caret.h @@ -27,10 +27,10 @@ class CFWL_Caret : public CFWL_Widget { // CFWL_Widget FWL_Type GetClassID() const override; - void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; + void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix& matrix) override; void OnProcessMessage(CFWL_Message* pMessage) override; void OnDrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) override; + const CFX_Matrix& matrix) override; void Update() override; void ShowCaret(); diff --git a/xfa/fwl/cfwl_checkbox.cpp b/xfa/fwl/cfwl_checkbox.cpp index bc45e5a792..42b6cadc83 100644 --- a/xfa/fwl/cfwl_checkbox.cpp +++ b/xfa/fwl/cfwl_checkbox.cpp @@ -62,7 +62,7 @@ void CFWL_CheckBox::Update() { } void CFWL_CheckBox::DrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) { + const CFX_Matrix& matrix) { if (!pGraphics) return; if (!m_pProperties->m_pThemeProvider) @@ -71,7 +71,7 @@ void CFWL_CheckBox::DrawWidget(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider; if (HasBorder()) { DrawBorder(pGraphics, CFWL_Part::Border, m_pProperties->m_pThemeProvider, - pMatrix); + matrix); } int32_t dwStates = GetPartStates(); @@ -81,8 +81,7 @@ void CFWL_CheckBox::DrawWidget(CXFA_Graphics* pGraphics, param.m_iPart = CFWL_Part::Background; param.m_dwStates = dwStates; param.m_pGraphics = pGraphics; - if (pMatrix) - param.m_matrix.Concat(*pMatrix); + param.m_matrix.Concat(matrix); param.m_rtPart = m_rtClient; if (m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) param.m_pData = &m_rtFocus; @@ -97,8 +96,7 @@ void CFWL_CheckBox::DrawWidget(CXFA_Graphics* pGraphics, textParam.m_iPart = CFWL_Part::Caption; textParam.m_dwStates = dwStates; textParam.m_pGraphics = pGraphics; - if (pMatrix) - textParam.m_matrix.Concat(*pMatrix); + textParam.m_matrix.Concat(matrix); textParam.m_rtPart = m_rtCaption; textParam.m_wsText = L"Check box"; textParam.m_dwTTOStyles = m_dwTTOStyles; @@ -268,8 +266,8 @@ void CFWL_CheckBox::OnProcessMessage(CFWL_Message* pMessage) { } void CFWL_CheckBox::OnDrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) { - DrawWidget(pGraphics, pMatrix); + const CFX_Matrix& matrix) { + DrawWidget(pGraphics, matrix); } void CFWL_CheckBox::OnFocusChanged(bool bSet) { diff --git a/xfa/fwl/cfwl_checkbox.h b/xfa/fwl/cfwl_checkbox.h index e90fbd1b93..9ae6590b2f 100644 --- a/xfa/fwl/cfwl_checkbox.h +++ b/xfa/fwl/cfwl_checkbox.h @@ -41,11 +41,11 @@ class CFWL_CheckBox : public CFWL_Widget { // CFWL_Widget FWL_Type GetClassID() const override; void Update() override; - void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; + void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix& matrix) override; void OnProcessMessage(CFWL_Message* pMessage) override; void OnDrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) override; + const CFX_Matrix& matrix) override; void SetBoxSize(float fHeight); diff --git a/xfa/fwl/cfwl_combobox.cpp b/xfa/fwl/cfwl_combobox.cpp index ec90a15684..a3dbe8c946 100644 --- a/xfa/fwl/cfwl_combobox.cpp +++ b/xfa/fwl/cfwl_combobox.cpp @@ -126,9 +126,9 @@ FWL_WidgetHit CFWL_ComboBox::HitTest(const CFX_PointF& point) { } void CFWL_ComboBox::DrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) { + const CFX_Matrix& matrix) { if (m_pWidgetMgr->IsFormDisabled()) { - DisForm_DrawWidget(pGraphics, pMatrix); + DisForm_DrawWidget(pGraphics, &matrix); return; } @@ -139,7 +139,7 @@ void CFWL_ComboBox::DrawWidget(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider; if (HasBorder()) - DrawBorder(pGraphics, CFWL_Part::Border, pTheme, pMatrix); + DrawBorder(pGraphics, CFWL_Part::Border, pTheme, matrix); if (!IsDropDownStyle()) { CFX_RectF rtTextBk(m_rtClient); @@ -149,8 +149,7 @@ void CFWL_ComboBox::DrawWidget(CXFA_Graphics* pGraphics, param.m_pWidget = this; param.m_iPart = CFWL_Part::Background; param.m_pGraphics = pGraphics; - if (pMatrix) - param.m_matrix.Concat(*pMatrix); + param.m_matrix.Concat(matrix); param.m_rtPart = rtTextBk; if (m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled) { @@ -174,7 +173,7 @@ void CFWL_ComboBox::DrawWidget(CXFA_Graphics* pGraphics, theme_text.m_iPart = CFWL_Part::Caption; theme_text.m_dwStates = m_iBtnState; theme_text.m_pGraphics = pGraphics; - theme_text.m_matrix.Concat(*pMatrix); + theme_text.m_matrix.Concat(matrix); theme_text.m_rtPart = rtTextBk; theme_text.m_dwStates = (m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) ? CFWL_PartState_Selected @@ -193,7 +192,7 @@ void CFWL_ComboBox::DrawWidget(CXFA_Graphics* pGraphics, ? CFWL_PartState_Disabled : m_iBtnState; param.m_pGraphics = pGraphics; - param.m_matrix.Concat(*pMatrix); + param.m_matrix.Concat(matrix); param.m_rtPart = m_rtBtn; pTheme->DrawBackground(¶m); } @@ -639,13 +638,13 @@ void CFWL_ComboBox::DisForm_DrawWidget(CXFA_Graphics* pGraphics, CFX_RectF rtEdit = m_pEdit->GetWidgetRect(); CFX_Matrix mt(1, 0, 0, 1, rtEdit.left, rtEdit.top); mt.Concat(mtOrg); - m_pEdit->DrawWidget(pGraphics, &mt); + m_pEdit->DrawWidget(pGraphics, mt); } if (m_pListBox && DisForm_IsDropListVisible()) { CFX_RectF rtList = m_pListBox->GetWidgetRect(); CFX_Matrix mt(1, 0, 0, 1, rtList.left, rtList.top); mt.Concat(mtOrg); - m_pListBox->DrawWidget(pGraphics, &mt); + m_pListBox->DrawWidget(pGraphics, mt); } } @@ -757,8 +756,8 @@ void CFWL_ComboBox::OnProcessEvent(CFWL_Event* pEvent) { } void CFWL_ComboBox::OnDrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) { - DrawWidget(pGraphics, pMatrix); + const CFX_Matrix& matrix) { + DrawWidget(pGraphics, matrix); } void CFWL_ComboBox::OnFocusChanged(CFWL_Message* pMsg, bool bSet) { diff --git a/xfa/fwl/cfwl_combobox.h b/xfa/fwl/cfwl_combobox.h index 396aa6c9d5..0e1f815872 100644 --- a/xfa/fwl/cfwl_combobox.h +++ b/xfa/fwl/cfwl_combobox.h @@ -52,12 +52,12 @@ class CFWL_ComboBox : public CFWL_Widget { void RemoveStates(uint32_t dwStates) override; void Update() override; FWL_WidgetHit HitTest(const CFX_PointF& point) override; - void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; + void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix& matrix) override; void SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) override; void OnProcessMessage(CFWL_Message* pMessage) override; void OnProcessEvent(CFWL_Event* pEvent) override; void OnDrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) override; + const CFX_Matrix& matrix) override; CFX_WideString GetTextByIndex(int32_t iIndex) const; int32_t GetCurSel() const { return m_iCurSel; } diff --git a/xfa/fwl/cfwl_comboboxproxy.cpp b/xfa/fwl/cfwl_comboboxproxy.cpp index 28c403fb0a..d1db1c01a8 100644 --- a/xfa/fwl/cfwl_comboboxproxy.cpp +++ b/xfa/fwl/cfwl_comboboxproxy.cpp @@ -59,8 +59,8 @@ void CFWL_ComboBoxProxy::OnProcessMessage(CFWL_Message* pMessage) { } void CFWL_ComboBoxProxy::OnDrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) { - m_pComboBox->DrawStretchHandler(pGraphics, pMatrix); + const CFX_Matrix& matrix) { + m_pComboBox->DrawStretchHandler(pGraphics, &matrix); } void CFWL_ComboBoxProxy::OnLButtonDown(CFWL_Message* pMessage) { diff --git a/xfa/fwl/cfwl_comboboxproxy.h b/xfa/fwl/cfwl_comboboxproxy.h index 8282348657..bb21707851 100644 --- a/xfa/fwl/cfwl_comboboxproxy.h +++ b/xfa/fwl/cfwl_comboboxproxy.h @@ -24,7 +24,7 @@ class CFWL_ComboBoxProxy : public CFWL_FormProxy { // CFWL_FormProxy void OnProcessMessage(CFWL_Message* pMessage) override; void OnDrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) override; + const CFX_Matrix& matrix) override; void Reset() { m_bLButtonUpSelf = false; } diff --git a/xfa/fwl/cfwl_datetimepicker.cpp b/xfa/fwl/cfwl_datetimepicker.cpp index 1a82a5c7ee..7383729ad4 100644 --- a/xfa/fwl/cfwl_datetimepicker.cpp +++ b/xfa/fwl/cfwl_datetimepicker.cpp @@ -115,7 +115,7 @@ FWL_WidgetHit CFWL_DateTimePicker::HitTest(const CFX_PointF& point) { } void CFWL_DateTimePicker::DrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) { + const CFX_Matrix& matrix) { if (!pGraphics) return; if (!m_pProperties->m_pThemeProvider) @@ -123,11 +123,11 @@ void CFWL_DateTimePicker::DrawWidget(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider; if (HasBorder()) - DrawBorder(pGraphics, CFWL_Part::Border, pTheme, pMatrix); + DrawBorder(pGraphics, CFWL_Part::Border, pTheme, matrix); if (!m_rtBtn.IsEmpty()) - DrawDropDownButton(pGraphics, pTheme, pMatrix); + DrawDropDownButton(pGraphics, pTheme, &matrix); if (m_pWidgetMgr->IsFormDisabled()) { - DisForm_DrawWidget(pGraphics, pMatrix); + DisForm_DrawWidget(pGraphics, &matrix); return; } } @@ -453,7 +453,7 @@ void CFWL_DateTimePicker::DisForm_DrawWidget(CXFA_Graphics* pGraphics, CFX_Matrix mt(1, 0, 0, 1, rtEdit.left, rtEdit.top); if (pMatrix) mt.Concat(*pMatrix); - m_pEdit->DrawWidget(pGraphics, &mt); + m_pEdit->DrawWidget(pGraphics, mt); } if (!IsMonthCalendarVisible()) return; @@ -462,7 +462,7 @@ void CFWL_DateTimePicker::DisForm_DrawWidget(CXFA_Graphics* pGraphics, CFX_Matrix mt(1, 0, 0, 1, rtMonth.left, rtMonth.top); if (pMatrix) mt.Concat(*pMatrix); - m_pMonthCal->DrawWidget(pGraphics, &mt); + m_pMonthCal->DrawWidget(pGraphics, mt); } void CFWL_DateTimePicker::OnProcessMessage(CFWL_Message* pMessage) { @@ -511,8 +511,8 @@ void CFWL_DateTimePicker::OnProcessMessage(CFWL_Message* pMessage) { } void CFWL_DateTimePicker::OnDrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) { - DrawWidget(pGraphics, pMatrix); + const CFX_Matrix& matrix) { + DrawWidget(pGraphics, matrix); } void CFWL_DateTimePicker::OnFocusChanged(CFWL_Message* pMsg, bool bSet) { diff --git a/xfa/fwl/cfwl_datetimepicker.h b/xfa/fwl/cfwl_datetimepicker.h index 79e9cad9dd..fa7653ecf0 100644 --- a/xfa/fwl/cfwl_datetimepicker.h +++ b/xfa/fwl/cfwl_datetimepicker.h @@ -39,11 +39,11 @@ class CFWL_DateTimePicker : public CFWL_Widget { FWL_Type GetClassID() const override; void Update() override; FWL_WidgetHit HitTest(const CFX_PointF& point) override; - void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; + void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix& matrix) override; void SetThemeProvider(IFWL_ThemeProvider* pTP) override; void OnProcessMessage(CFWL_Message* pMessage) override; void OnDrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) override; + const CFX_Matrix& matrix) override; void GetCurSel(int32_t& iYear, int32_t& iMonth, int32_t& iDay); void SetCurSel(int32_t iYear, int32_t iMonth, int32_t iDay); diff --git a/xfa/fwl/cfwl_edit.cpp b/xfa/fwl/cfwl_edit.cpp index 184329fcac..fc8b0fa888 100644 --- a/xfa/fwl/cfwl_edit.cpp +++ b/xfa/fwl/cfwl_edit.cpp @@ -239,8 +239,7 @@ void CFWL_Edit::DrawSpellCheck(CXFA_Graphics* pGraphics, pGraphics->RestoreGraphState(); } -void CFWL_Edit::DrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) { +void CFWL_Edit::DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix& matrix) { if (!pGraphics) return; if (!m_pProperties->m_pThemeProvider) @@ -250,15 +249,15 @@ void CFWL_Edit::DrawWidget(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider; if (!m_pWidgetMgr->IsFormDisabled()) - DrawTextBk(pGraphics, pTheme, pMatrix); - DrawContent(pGraphics, pTheme, pMatrix); + DrawTextBk(pGraphics, pTheme, &matrix); + DrawContent(pGraphics, pTheme, &matrix); if ((m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) && !(m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_ReadOnly)) { - DrawSpellCheck(pGraphics, pMatrix); + DrawSpellCheck(pGraphics, &matrix); } if (HasBorder()) - DrawBorder(pGraphics, CFWL_Part::Border, pTheme, pMatrix); + DrawBorder(pGraphics, CFWL_Part::Border, pTheme, matrix); } void CFWL_Edit::SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) { @@ -1263,8 +1262,8 @@ void CFWL_Edit::OnProcessEvent(CFWL_Event* pEvent) { } void CFWL_Edit::OnDrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) { - DrawWidget(pGraphics, pMatrix); + const CFX_Matrix& matrix) { + DrawWidget(pGraphics, matrix); } void CFWL_Edit::DoButtonDown(CFWL_MessageMouse* pMsg) { diff --git a/xfa/fwl/cfwl_edit.h b/xfa/fwl/cfwl_edit.h index 9915f05c00..23d6158ee6 100644 --- a/xfa/fwl/cfwl_edit.h +++ b/xfa/fwl/cfwl_edit.h @@ -61,12 +61,12 @@ class CFWL_Edit : public CFWL_Widget { void Update() override; FWL_WidgetHit HitTest(const CFX_PointF& point) override; void SetStates(uint32_t dwStates) override; - void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; + void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix& matrix) override; void SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) override; void OnProcessMessage(CFWL_Message* pMessage) override; void OnProcessEvent(CFWL_Event* pEvent) override; void OnDrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) override; + const CFX_Matrix& matrix) override; virtual void SetText(const CFX_WideString& wsText); diff --git a/xfa/fwl/cfwl_form.cpp b/xfa/fwl/cfwl_form.cpp index c560a0d352..5ab7a567ac 100644 --- a/xfa/fwl/cfwl_form.cpp +++ b/xfa/fwl/cfwl_form.cpp @@ -75,8 +75,7 @@ FWL_WidgetHit CFWL_Form::HitTest(const CFX_PointF& point) { : FWL_WidgetHit::Client; } -void CFWL_Form::DrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) { +void CFWL_Form::DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix& matrix) { if (!pGraphics) return; if (!m_pProperties->m_pThemeProvider) @@ -93,8 +92,7 @@ void CFWL_Form::DrawWidget(CXFA_Graphics* pGraphics, param.m_dwStates = CFWL_PartState_Normal; param.m_pGraphics = pGraphics; param.m_rtPart = m_rtRelative; - if (pMatrix) - param.m_matrix.Concat(*pMatrix); + param.m_matrix.Concat(matrix); if (m_pProperties->m_dwStyles & FWL_WGTSTYLE_Border) { param.m_iPart = CFWL_Part::Border; pTheme->DrawBackground(¶m); @@ -240,8 +238,8 @@ void CFWL_Form::OnProcessMessage(CFWL_Message* pMessage) { } void CFWL_Form::OnDrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) { - DrawWidget(pGraphics, pMatrix); + const CFX_Matrix& matrix) { + DrawWidget(pGraphics, matrix); } void CFWL_Form::OnLButtonDown(CFWL_MessageMouse* pMsg) { diff --git a/xfa/fwl/cfwl_form.h b/xfa/fwl/cfwl_form.h index 96452e8e33..78fee4b915 100644 --- a/xfa/fwl/cfwl_form.h +++ b/xfa/fwl/cfwl_form.h @@ -38,10 +38,10 @@ class CFWL_Form : public CFWL_Widget { CFX_RectF GetClientRect() override; void Update() override; FWL_WidgetHit HitTest(const CFX_PointF& point) override; - void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; + void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix& matrix) override; void OnProcessMessage(CFWL_Message* pMessage) override; void OnDrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) override; + const CFX_Matrix& matrix) override; CFWL_Widget* DoModal(); void EndDoModal(); diff --git a/xfa/fwl/cfwl_formproxy.cpp b/xfa/fwl/cfwl_formproxy.cpp index af7703e9c0..123cf2509a 100644 --- a/xfa/fwl/cfwl_formproxy.cpp +++ b/xfa/fwl/cfwl_formproxy.cpp @@ -33,7 +33,7 @@ bool CFWL_FormProxy::IsInstance(const CFX_WideStringC& wsClass) const { void CFWL_FormProxy::Update() {} void CFWL_FormProxy::DrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) {} + const CFX_Matrix& matrix) {} void CFWL_FormProxy::OnProcessMessage(CFWL_Message* pMessage) { m_pOuter->GetDelegate()->OnProcessMessage(pMessage); diff --git a/xfa/fwl/cfwl_formproxy.h b/xfa/fwl/cfwl_formproxy.h index dbc49d8f5e..630719505d 100644 --- a/xfa/fwl/cfwl_formproxy.h +++ b/xfa/fwl/cfwl_formproxy.h @@ -24,7 +24,7 @@ class CFWL_FormProxy : public CFWL_Form { FWL_Type GetClassID() const override; bool IsInstance(const CFX_WideStringC& wsClass) const override; void Update() override; - void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; + void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix& matrix) override; void OnProcessMessage(CFWL_Message* pMessage) override; }; diff --git a/xfa/fwl/cfwl_listbox.cpp b/xfa/fwl/cfwl_listbox.cpp index d0455ff650..ce1c0133f9 100644 --- a/xfa/fwl/cfwl_listbox.cpp +++ b/xfa/fwl/cfwl_listbox.cpp @@ -91,7 +91,7 @@ FWL_WidgetHit CFWL_ListBox::HitTest(const CFX_PointF& point) { } void CFWL_ListBox::DrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) { + const CFX_Matrix& matrix) { if (!pGraphics) return; if (!m_pProperties->m_pThemeProvider) @@ -100,21 +100,20 @@ void CFWL_ListBox::DrawWidget(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider; pGraphics->SaveGraphState(); if (HasBorder()) - DrawBorder(pGraphics, CFWL_Part::Border, pTheme, pMatrix); + DrawBorder(pGraphics, CFWL_Part::Border, pTheme, matrix); CFX_RectF rtClip(m_rtConent); if (IsShowScrollBar(false)) rtClip.height -= m_fScorllBarWidth; if (IsShowScrollBar(true)) rtClip.width -= m_fScorllBarWidth; - if (pMatrix) - pMatrix->TransformRect(rtClip); + matrix.TransformRect(rtClip); pGraphics->SetClipRect(rtClip); if ((m_pProperties->m_dwStyles & FWL_WGTSTYLE_NoBackground) == 0) - DrawBkground(pGraphics, pTheme, pMatrix); + DrawBkground(pGraphics, pTheme, &matrix); - DrawItems(pGraphics, pTheme, pMatrix); + DrawItems(pGraphics, pTheme, &matrix); pGraphics->RestoreGraphState(); } @@ -714,8 +713,8 @@ void CFWL_ListBox::OnProcessEvent(CFWL_Event* pEvent) { } void CFWL_ListBox::OnDrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) { - DrawWidget(pGraphics, pMatrix); + const CFX_Matrix& matrix) { + DrawWidget(pGraphics, matrix); } void CFWL_ListBox::OnFocusChanged(CFWL_Message* pMsg, bool bSet) { diff --git a/xfa/fwl/cfwl_listbox.h b/xfa/fwl/cfwl_listbox.h index e98f21b464..4704a8a840 100644 --- a/xfa/fwl/cfwl_listbox.h +++ b/xfa/fwl/cfwl_listbox.h @@ -42,12 +42,12 @@ class CFWL_ListBox : public CFWL_Widget { FWL_Type GetClassID() const override; void Update() override; FWL_WidgetHit HitTest(const CFX_PointF& point) override; - void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; + void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix& matrix) override; void SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) override; void OnProcessMessage(CFWL_Message* pMessage) override; void OnProcessEvent(CFWL_Event* pEvent) override; void OnDrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) override; + const CFX_Matrix& matrix) override; int32_t CountItems(const CFWL_Widget* pWidget) const; CFWL_ListItem* GetItem(const CFWL_Widget* pWidget, int32_t nIndex) const; diff --git a/xfa/fwl/cfwl_monthcalendar.cpp b/xfa/fwl/cfwl_monthcalendar.cpp index 64e6977924..11712fefa4 100644 --- a/xfa/fwl/cfwl_monthcalendar.cpp +++ b/xfa/fwl/cfwl_monthcalendar.cpp @@ -147,7 +147,7 @@ void CFWL_MonthCalendar::Update() { } void CFWL_MonthCalendar::DrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) { + const CFX_Matrix& matrix) { if (!pGraphics) return; if (!m_pProperties->m_pThemeProvider) @@ -155,20 +155,20 @@ void CFWL_MonthCalendar::DrawWidget(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider; if (HasBorder()) - DrawBorder(pGraphics, CFWL_Part::Border, pTheme, pMatrix); - - DrawBackground(pGraphics, pTheme, pMatrix); - DrawHeadBK(pGraphics, pTheme, pMatrix); - DrawLButton(pGraphics, pTheme, pMatrix); - DrawRButton(pGraphics, pTheme, pMatrix); - DrawSeperator(pGraphics, pTheme, pMatrix); - DrawDatesInBK(pGraphics, pTheme, pMatrix); - DrawDatesInCircle(pGraphics, pTheme, pMatrix); - DrawCaption(pGraphics, pTheme, pMatrix); - DrawWeek(pGraphics, pTheme, pMatrix); - DrawDatesIn(pGraphics, pTheme, pMatrix); - DrawDatesOut(pGraphics, pTheme, pMatrix); - DrawToday(pGraphics, pTheme, pMatrix); + DrawBorder(pGraphics, CFWL_Part::Border, pTheme, matrix); + + DrawBackground(pGraphics, pTheme, &matrix); + DrawHeadBK(pGraphics, pTheme, &matrix); + DrawLButton(pGraphics, pTheme, &matrix); + DrawRButton(pGraphics, pTheme, &matrix); + DrawSeperator(pGraphics, pTheme, &matrix); + DrawDatesInBK(pGraphics, pTheme, &matrix); + DrawDatesInCircle(pGraphics, pTheme, &matrix); + DrawCaption(pGraphics, pTheme, &matrix); + DrawWeek(pGraphics, pTheme, &matrix); + DrawDatesIn(pGraphics, pTheme, &matrix); + DrawDatesOut(pGraphics, pTheme, &matrix); + DrawToday(pGraphics, pTheme, &matrix); } void CFWL_MonthCalendar::SetSelect(int32_t iYear, @@ -749,8 +749,8 @@ void CFWL_MonthCalendar::OnProcessMessage(CFWL_Message* pMessage) { } void CFWL_MonthCalendar::OnDrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) { - DrawWidget(pGraphics, pMatrix); + const CFX_Matrix& matrix) { + DrawWidget(pGraphics, matrix); } void CFWL_MonthCalendar::OnLButtonDown(CFWL_MessageMouse* pMsg) { diff --git a/xfa/fwl/cfwl_monthcalendar.h b/xfa/fwl/cfwl_monthcalendar.h index e537c331ef..6e0d4711f1 100644 --- a/xfa/fwl/cfwl_monthcalendar.h +++ b/xfa/fwl/cfwl_monthcalendar.h @@ -33,10 +33,10 @@ class CFWL_MonthCalendar : public CFWL_Widget { FWL_Type GetClassID() const override; CFX_RectF GetAutosizedWidgetRect() override; void Update() override; - void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; + void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix& matrix) override; void OnProcessMessage(CFWL_Message* pMessage) override; void OnDrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) override; + const CFX_Matrix& matrix) override; void SetSelect(int32_t iYear, int32_t iMonth, int32_t iDay); diff --git a/xfa/fwl/cfwl_picturebox.cpp b/xfa/fwl/cfwl_picturebox.cpp index 096b14ec61..637de94e7d 100644 --- a/xfa/fwl/cfwl_picturebox.cpp +++ b/xfa/fwl/cfwl_picturebox.cpp @@ -33,7 +33,7 @@ void CFWL_PictureBox::Update() { } void CFWL_PictureBox::DrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) { + const CFX_Matrix& matrix) { if (!pGraphics) return; if (!m_pProperties->m_pThemeProvider) @@ -41,10 +41,10 @@ void CFWL_PictureBox::DrawWidget(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme = GetAvailableTheme(); if (HasBorder()) - DrawBorder(pGraphics, CFWL_Part::Border, pTheme, pMatrix); + DrawBorder(pGraphics, CFWL_Part::Border, pTheme, matrix); } void CFWL_PictureBox::OnDrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) { - DrawWidget(pGraphics, pMatrix); + const CFX_Matrix& matrix) { + DrawWidget(pGraphics, matrix); } diff --git a/xfa/fwl/cfwl_picturebox.h b/xfa/fwl/cfwl_picturebox.h index e244c853b8..363db8a291 100644 --- a/xfa/fwl/cfwl_picturebox.h +++ b/xfa/fwl/cfwl_picturebox.h @@ -23,9 +23,9 @@ class CFWL_PictureBox : public CFWL_Widget { // CFWL_Widget FWL_Type GetClassID() const override; void Update() override; - void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; + void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix& matrix) override; void OnDrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) override; + const CFX_Matrix& matrix) override; private: CFX_RectF m_rtClient; diff --git a/xfa/fwl/cfwl_pushbutton.cpp b/xfa/fwl/cfwl_pushbutton.cpp index 1dfe2db2fd..a912108278 100644 --- a/xfa/fwl/cfwl_pushbutton.cpp +++ b/xfa/fwl/cfwl_pushbutton.cpp @@ -49,7 +49,7 @@ void CFWL_PushButton::Update() { } void CFWL_PushButton::DrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) { + const CFX_Matrix& matrix) { if (!pGraphics) return; if (!m_pProperties->m_pThemeProvider) @@ -57,9 +57,9 @@ void CFWL_PushButton::DrawWidget(CXFA_Graphics* pGraphics, if (HasBorder()) { DrawBorder(pGraphics, CFWL_Part::Border, m_pProperties->m_pThemeProvider, - pMatrix); + matrix); } - DrawBkground(pGraphics, m_pProperties->m_pThemeProvider, pMatrix); + DrawBkground(pGraphics, m_pProperties->m_pThemeProvider, &matrix); } void CFWL_PushButton::DrawBkground(CXFA_Graphics* pGraphics, @@ -137,8 +137,8 @@ void CFWL_PushButton::OnProcessMessage(CFWL_Message* pMessage) { } void CFWL_PushButton::OnDrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) { - DrawWidget(pGraphics, pMatrix); + const CFX_Matrix& matrix) { + DrawWidget(pGraphics, matrix); } void CFWL_PushButton::OnFocusChanged(CFWL_Message* pMsg, bool bSet) { diff --git a/xfa/fwl/cfwl_pushbutton.h b/xfa/fwl/cfwl_pushbutton.h index 84019ba181..5c509fb503 100644 --- a/xfa/fwl/cfwl_pushbutton.h +++ b/xfa/fwl/cfwl_pushbutton.h @@ -28,10 +28,10 @@ class CFWL_PushButton : public CFWL_Widget { FWL_Type GetClassID() const override; void SetStates(uint32_t dwStates) override; void Update() override; - void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; + void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix& matrix) override; void OnProcessMessage(CFWL_Message* pMessage) override; void OnDrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) override; + const CFX_Matrix& matrix) override; private: void DrawBkground(CXFA_Graphics* pGraphics, diff --git a/xfa/fwl/cfwl_scrollbar.cpp b/xfa/fwl/cfwl_scrollbar.cpp index 0e1a9be1ba..f723124e86 100644 --- a/xfa/fwl/cfwl_scrollbar.cpp +++ b/xfa/fwl/cfwl_scrollbar.cpp @@ -75,7 +75,7 @@ void CFWL_ScrollBar::Update() { } void CFWL_ScrollBar::DrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) { + const CFX_Matrix& matrix) { if (!pGraphics) return; if (!m_pProperties->m_pThemeProvider) @@ -83,12 +83,12 @@ void CFWL_ScrollBar::DrawWidget(CXFA_Graphics* pGraphics, IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider; if (HasBorder()) - DrawBorder(pGraphics, CFWL_Part::Border, pTheme, pMatrix); - DrawTrack(pGraphics, pTheme, true, pMatrix); - DrawTrack(pGraphics, pTheme, false, pMatrix); - DrawArrowBtn(pGraphics, pTheme, true, pMatrix); - DrawArrowBtn(pGraphics, pTheme, false, pMatrix); - DrawThumb(pGraphics, pTheme, pMatrix); + DrawBorder(pGraphics, CFWL_Part::Border, pTheme, matrix); + DrawTrack(pGraphics, pTheme, true, &matrix); + DrawTrack(pGraphics, pTheme, false, &matrix); + DrawArrowBtn(pGraphics, pTheme, true, &matrix); + DrawArrowBtn(pGraphics, pTheme, false, &matrix); + DrawThumb(pGraphics, pTheme, &matrix); } void CFWL_ScrollBar::SetTrackPos(float fTrackPos) { @@ -356,8 +356,8 @@ void CFWL_ScrollBar::OnProcessMessage(CFWL_Message* pMessage) { } void CFWL_ScrollBar::OnDrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) { - DrawWidget(pGraphics, pMatrix); + const CFX_Matrix& matrix) { + DrawWidget(pGraphics, matrix); } void CFWL_ScrollBar::OnLButtonDown(const CFX_PointF& point) { diff --git a/xfa/fwl/cfwl_scrollbar.h b/xfa/fwl/cfwl_scrollbar.h index 368dee96fe..b2523a6e15 100644 --- a/xfa/fwl/cfwl_scrollbar.h +++ b/xfa/fwl/cfwl_scrollbar.h @@ -30,10 +30,10 @@ class CFWL_ScrollBar : public CFWL_Widget { // CFWL_Widget FWL_Type GetClassID() const override; void Update() override; - void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; + void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix& matrix) override; void OnProcessMessage(CFWL_Message* pMessage) override; void OnDrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) override; + const CFX_Matrix& matrix) override; void GetRange(float* fMin, float* fMax) const { ASSERT(fMin); diff --git a/xfa/fwl/cfwl_spinbutton.cpp b/xfa/fwl/cfwl_spinbutton.cpp index 2943c205d7..3119c7517a 100644 --- a/xfa/fwl/cfwl_spinbutton.cpp +++ b/xfa/fwl/cfwl_spinbutton.cpp @@ -79,20 +79,19 @@ FWL_WidgetHit CFWL_SpinButton::HitTest(const CFX_PointF& point) { } void CFWL_SpinButton::DrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) { + const CFX_Matrix& matrix) { if (!pGraphics) return; CFX_RectF rtClip(m_rtClient); - if (pMatrix) - pMatrix->TransformRect(rtClip); + matrix.TransformRect(rtClip); IFWL_ThemeProvider* pTheme = GetAvailableTheme(); if (HasBorder()) - DrawBorder(pGraphics, CFWL_Part::Border, pTheme, pMatrix); + DrawBorder(pGraphics, CFWL_Part::Border, pTheme, matrix); - DrawUpButton(pGraphics, pTheme, pMatrix); - DrawDownButton(pGraphics, pTheme, pMatrix); + DrawUpButton(pGraphics, pTheme, &matrix); + DrawDownButton(pGraphics, pTheme, &matrix); } void CFWL_SpinButton::DisableButton() { @@ -183,8 +182,8 @@ void CFWL_SpinButton::OnProcessMessage(CFWL_Message* pMessage) { } void CFWL_SpinButton::OnDrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) { - DrawWidget(pGraphics, pMatrix); + const CFX_Matrix& matrix) { + DrawWidget(pGraphics, matrix); } void CFWL_SpinButton::OnFocusChanged(CFWL_Message* pMsg, bool bSet) { diff --git a/xfa/fwl/cfwl_spinbutton.h b/xfa/fwl/cfwl_spinbutton.h index 2dcb8483f2..2ebabb1799 100644 --- a/xfa/fwl/cfwl_spinbutton.h +++ b/xfa/fwl/cfwl_spinbutton.h @@ -28,10 +28,10 @@ class CFWL_SpinButton : public CFWL_Widget { FWL_Type GetClassID() const override; void Update() override; FWL_WidgetHit HitTest(const CFX_PointF& point) override; - void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; + void DrawWidget(CXFA_Graphics* pGraphics, const CFX_Matrix& matrix) override; void OnProcessMessage(CFWL_Message* pMessage) override; void OnDrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) override; + const CFX_Matrix& matrix) override; private: class Timer : public CFWL_Timer { diff --git a/xfa/fwl/cfwl_widget.cpp b/xfa/fwl/cfwl_widget.cpp index 8b8bf5d3cd..9071f0fb0e 100644 --- a/xfa/fwl/cfwl_widget.cpp +++ b/xfa/fwl/cfwl_widget.cpp @@ -538,13 +538,12 @@ void CFWL_Widget::DrawBackground(CXFA_Graphics* pGraphics, void CFWL_Widget::DrawBorder(CXFA_Graphics* pGraphics, CFWL_Part iPartBorder, IFWL_ThemeProvider* pTheme, - const CFX_Matrix* pMatrix) { + const CFX_Matrix& matrix) { CFWL_ThemeBackground param; param.m_pWidget = this; param.m_iPart = iPartBorder; param.m_pGraphics = pGraphics; - if (pMatrix) - param.m_matrix.Concat(*pMatrix, true); + param.m_matrix.Concat(matrix, true); param.m_rtPart = GetRelativeRect(); pTheme->DrawBackground(¶m); } @@ -614,4 +613,4 @@ void CFWL_Widget::OnProcessMessage(CFWL_Message* pMessage) { void CFWL_Widget::OnProcessEvent(CFWL_Event* pEvent) {} void CFWL_Widget::OnDrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) {} + const CFX_Matrix& matrix) {} diff --git a/xfa/fwl/cfwl_widget.h b/xfa/fwl/cfwl_widget.h index 11b3569dbd..3111e9e1b0 100644 --- a/xfa/fwl/cfwl_widget.h +++ b/xfa/fwl/cfwl_widget.h @@ -65,14 +65,14 @@ class CFWL_Widget : public IFWL_WidgetDelegate { virtual void Update() = 0; virtual FWL_WidgetHit HitTest(const CFX_PointF& point); virtual void DrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) = 0; + const CFX_Matrix& matrix) = 0; virtual void SetThemeProvider(IFWL_ThemeProvider* pThemeProvider); // IFWL_WidgetDelegate. void OnProcessMessage(CFWL_Message* pMessage) override; void OnProcessEvent(CFWL_Event* pEvent) override; void OnDrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) override; + const CFX_Matrix& matrix) override; void InflateWidgetRect(CFX_RectF& rect); void SetWidgetRect(const CFX_RectF& rect); @@ -147,7 +147,7 @@ class CFWL_Widget : public IFWL_WidgetDelegate { void DrawBorder(CXFA_Graphics* pGraphics, CFWL_Part iPartBorder, IFWL_ThemeProvider* pTheme, - const CFX_Matrix* pMatrix); + const CFX_Matrix& pMatrix); CFX_UnownedPtr<const CFWL_App> const m_pOwnerApp; CFX_UnownedPtr<CFWL_WidgetMgr> const m_pWidgetMgr; diff --git a/xfa/fwl/cfwl_widgetmgr.cpp b/xfa/fwl/cfwl_widgetmgr.cpp index d5b496a04b..f5beb411e6 100644 --- a/xfa/fwl/cfwl_widgetmgr.cpp +++ b/xfa/fwl/cfwl_widgetmgr.cpp @@ -419,7 +419,7 @@ void CFWL_WidgetMgr::OnProcessMessageToForm(CFWL_Message* pMessage) { void CFWL_WidgetMgr::OnDrawWidget(CFWL_Widget* pWidget, CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) { + const CFX_Matrix& matrix) { if (!pWidget || !pGraphics) return; @@ -430,22 +430,24 @@ void CFWL_WidgetMgr::OnDrawWidget(CFWL_Widget* pWidget, if (IsFormDisabled()) { #endif // _FX_OS_ == _FX_MACOSX_ - pWidget->GetDelegate()->OnDrawWidget(pGraphics, pMatrix); + pWidget->GetDelegate()->OnDrawWidget(pGraphics, matrix); clipBounds = pGraphics->GetClipRect(); clipCopy = clipBounds; #if _FX_OS_ == _FX_MACOSX_ } else { - clipBounds = CFX_RectF(pMatrix->a, pMatrix->b, pMatrix->c, pMatrix->d); - const_cast<CFX_Matrix*>(pMatrix)->SetIdentity(); // FIXME: const cast. - pWidget->GetDelegate()->OnDrawWidget(pGraphics, pMatrix); + clipBounds = CFX_RectF(matrix.a, matrix.b, matrix.c, matrix.d); + // FIXME: const cast + CFX_Matrix* pMatrixHack = const_cast<CFX_Matrix*>(&matrix); + pMatrixHack->SetIdentity(); + pWidget->GetDelegate()->OnDrawWidget(pGraphics, *pMatrixHack); } #endif // _FX_OS_ == _FX_MACOSX_ if (!IsFormDisabled()) clipBounds.Intersect(pWidget->GetClientRect()); if (!clipBounds.IsEmpty()) - DrawChild(pWidget, clipBounds, pGraphics, pMatrix); + DrawChild(pWidget, clipBounds, pGraphics, &matrix); GetWidgetMgrItem(pWidget)->iRedrawCounter = 0; ResetRedrawCounts(pWidget); @@ -492,7 +494,7 @@ void CFWL_WidgetMgr::DrawChild(CFWL_Widget* parent, if (IFWL_WidgetDelegate* pDelegate = child->GetDelegate()) { if (IsFormDisabled() || IsNeedRepaint(child, &widgetMatrix, rtClip)) - pDelegate->OnDrawWidget(pGraphics, &widgetMatrix); + pDelegate->OnDrawWidget(pGraphics, widgetMatrix); } if (!bFormDisable) pGraphics->RestoreGraphState(); diff --git a/xfa/fwl/cfwl_widgetmgr.h b/xfa/fwl/cfwl_widgetmgr.h index 9ea2238c4f..f633ba8706 100644 --- a/xfa/fwl/cfwl_widgetmgr.h +++ b/xfa/fwl/cfwl_widgetmgr.h @@ -32,7 +32,7 @@ class CFWL_WidgetMgr { void OnProcessMessageToForm(CFWL_Message* pMessage); void OnDrawWidget(CFWL_Widget* pWidget, CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix); + const CFX_Matrix& matrix); CFWL_Widget* GetParentWidget(CFWL_Widget* pWidget) const; CFWL_Widget* GetOwnerWidget(CFWL_Widget* pWidget) const; diff --git a/xfa/fwl/ifwl_widgetdelegate.h b/xfa/fwl/ifwl_widgetdelegate.h index 8dee6da7a9..09bac9ab4e 100644 --- a/xfa/fwl/ifwl_widgetdelegate.h +++ b/xfa/fwl/ifwl_widgetdelegate.h @@ -21,7 +21,7 @@ class IFWL_WidgetDelegate { virtual void OnProcessMessage(CFWL_Message* pMessage) = 0; virtual void OnProcessEvent(CFWL_Event* pEvent) = 0; virtual void OnDrawWidget(CXFA_Graphics* pGraphics, - const CFX_Matrix* pMatrix) = 0; + const CFX_Matrix& matrix) = 0; }; #endif // XFA_FWL_IFWL_WIDGETDELEGATE_H_ 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(); |