diff options
author | Lei Zhang <thestig@chromium.org> | 2017-08-17 13:53:52 -0700 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-08-17 21:22:30 +0000 |
commit | 7c9d4c272c57965cb1d407a156bab1110c65e0f6 (patch) | |
tree | 1f8cb5b5f21b5f0bdcde82caf3f9a8359477d985 /xfa/fxfa | |
parent | ba1897b238b421e36cb34f223b8b24be2845d413 (diff) | |
download | pdfium-7c9d4c272c57965cb1d407a156bab1110c65e0f6.tar.xz |
Change CXFA_FFWidget::RenderWidget() to take a const CFX_Matrix&.
Change some related code to take a const CFX_Matrix* since it is not
immediately obvious if the matrix can be made into a const-ref.
Change-Id: I15c840222b575cc479b1f6f0b6d3b3c0e50d5515
Reviewed-on: https://pdfium-review.googlesource.com/11113
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa')
29 files changed, 76 insertions, 88 deletions
diff --git a/xfa/fxfa/cxfa_ffarc.cpp b/xfa/fxfa/cxfa_ffarc.cpp index 6c2fa4e2cc..ec60faab05 100644 --- a/xfa/fxfa/cxfa_ffarc.cpp +++ b/xfa/fxfa/cxfa_ffarc.cpp @@ -11,7 +11,7 @@ CXFA_FFArc::CXFA_FFArc(CXFA_WidgetAcc* pDataAcc) : CXFA_FFDraw(pDataAcc) {} CXFA_FFArc::~CXFA_FFArc() {} void CXFA_FFArc::RenderWidget(CXFA_Graphics* pGS, - CFX_Matrix* pMatrix, + const CFX_Matrix& matrix, uint32_t dwStatus) { if (!IsMatchVisibleStatus(dwStatus)) return; @@ -22,8 +22,7 @@ void CXFA_FFArc::RenderWidget(CXFA_Graphics* pGS, CXFA_Arc arcObj = value.GetArc(); CFX_Matrix mtRotate = GetRotateMatrix(); - if (pMatrix) - mtRotate.Concat(*pMatrix); + mtRotate.Concat(matrix); CFX_RectF rtArc = GetRectWithoutRotate(); if (CXFA_Margin mgWidget = m_pDataAcc->GetMargin()) diff --git a/xfa/fxfa/cxfa_ffarc.h b/xfa/fxfa/cxfa_ffarc.h index 7d8aabcaaf..cc34352362 100644 --- a/xfa/fxfa/cxfa_ffarc.h +++ b/xfa/fxfa/cxfa_ffarc.h @@ -16,7 +16,7 @@ class CXFA_FFArc : public CXFA_FFDraw { // CXFA_FFWidget void RenderWidget(CXFA_Graphics* pGS, - CFX_Matrix* pMatrix, + const CFX_Matrix& matrix, uint32_t dwStatus) override; }; diff --git a/xfa/fxfa/cxfa_ffbarcode.cpp b/xfa/fxfa/cxfa_ffbarcode.cpp index eff9cec603..b6d0eed792 100644 --- a/xfa/fxfa/cxfa_ffbarcode.cpp +++ b/xfa/fxfa/cxfa_ffbarcode.cpp @@ -138,16 +138,15 @@ bool CXFA_FFBarcode::LoadWidget() { } void CXFA_FFBarcode::RenderWidget(CXFA_Graphics* pGS, - CFX_Matrix* pMatrix, + const CFX_Matrix& matrix, uint32_t dwStatus) { if (!IsMatchVisibleStatus(dwStatus)) return; CFX_Matrix mtRotate = GetRotateMatrix(); - if (pMatrix) - mtRotate.Concat(*pMatrix); + mtRotate.Concat(matrix); - CXFA_FFWidget::RenderWidget(pGS, &mtRotate, dwStatus); + CXFA_FFWidget::RenderWidget(pGS, mtRotate, dwStatus); CXFA_Border borderUI = m_pDataAcc->GetUIBorder(); DrawBorder(pGS, borderUI, m_rtUI, &mtRotate); RenderCaption(pGS, &mtRotate); diff --git a/xfa/fxfa/cxfa_ffbarcode.h b/xfa/fxfa/cxfa_ffbarcode.h index c9b36b3bde..13e5032594 100644 --- a/xfa/fxfa/cxfa_ffbarcode.h +++ b/xfa/fxfa/cxfa_ffbarcode.h @@ -93,7 +93,7 @@ class CXFA_FFBarcode : public CXFA_FFTextEdit { // CXFA_FFTextEdit bool LoadWidget() override; void RenderWidget(CXFA_Graphics* pGS, - CFX_Matrix* pMatrix, + const CFX_Matrix& matrix, uint32_t dwStatus) override; void UpdateWidgetProperty() override; bool OnLButtonDown(uint32_t dwFlags, const CFX_PointF& point) override; diff --git a/xfa/fxfa/cxfa_ffcheckbutton.cpp b/xfa/fxfa/cxfa_ffcheckbutton.cpp index 34fd8431e9..6e23d58fc6 100644 --- a/xfa/fxfa/cxfa_ffcheckbutton.cpp +++ b/xfa/fxfa/cxfa_ffcheckbutton.cpp @@ -223,16 +223,15 @@ void CXFA_FFCheckButton::AddUIMargin(int32_t iCapPlacement) { } void CXFA_FFCheckButton::RenderWidget(CXFA_Graphics* pGS, - CFX_Matrix* pMatrix, + const CFX_Matrix& matrix, uint32_t dwStatus) { if (!IsMatchVisibleStatus(dwStatus)) return; CFX_Matrix mtRotate = GetRotateMatrix(); - if (pMatrix) - mtRotate.Concat(*pMatrix); + mtRotate.Concat(matrix); - CXFA_FFWidget::RenderWidget(pGS, &mtRotate, dwStatus); + CXFA_FFWidget::RenderWidget(pGS, mtRotate, dwStatus); CXFA_Border borderUI = m_pDataAcc->GetUIBorder(); DrawBorderWithFlags( pGS, borderUI, m_rtUI, &mtRotate, diff --git a/xfa/fxfa/cxfa_ffcheckbutton.h b/xfa/fxfa/cxfa_ffcheckbutton.h index d6fd09d2c9..b993545ae3 100644 --- a/xfa/fxfa/cxfa_ffcheckbutton.h +++ b/xfa/fxfa/cxfa_ffcheckbutton.h @@ -17,7 +17,7 @@ class CXFA_FFCheckButton : public CXFA_FFField { // CXFA_FFField void RenderWidget(CXFA_Graphics* pGS, - CFX_Matrix* pMatrix, + const CFX_Matrix& matrix, uint32_t dwStatus) override; bool LoadWidget() override; diff --git a/xfa/fxfa/cxfa_ffexclgroup.cpp b/xfa/fxfa/cxfa_ffexclgroup.cpp index cf6fafa72e..81c76bd712 100644 --- a/xfa/fxfa/cxfa_ffexclgroup.cpp +++ b/xfa/fxfa/cxfa_ffexclgroup.cpp @@ -17,14 +17,13 @@ CXFA_FFExclGroup::CXFA_FFExclGroup(CXFA_WidgetAcc* pDataAcc) CXFA_FFExclGroup::~CXFA_FFExclGroup() {} void CXFA_FFExclGroup::RenderWidget(CXFA_Graphics* pGS, - CFX_Matrix* pMatrix, + const CFX_Matrix& matrix, uint32_t dwStatus) { if (!IsMatchVisibleStatus(dwStatus)) return; CFX_Matrix mtRotate = GetRotateMatrix(); - if (pMatrix) - mtRotate.Concat(*pMatrix); + mtRotate.Concat(matrix); - CXFA_FFWidget::RenderWidget(pGS, &mtRotate, dwStatus); + CXFA_FFWidget::RenderWidget(pGS, mtRotate, dwStatus); } diff --git a/xfa/fxfa/cxfa_ffexclgroup.h b/xfa/fxfa/cxfa_ffexclgroup.h index a67b24b78d..bf97702d40 100644 --- a/xfa/fxfa/cxfa_ffexclgroup.h +++ b/xfa/fxfa/cxfa_ffexclgroup.h @@ -17,7 +17,7 @@ class CXFA_FFExclGroup : public CXFA_FFWidget { // CXFA_FFWidget void RenderWidget(CXFA_Graphics* pGS, - CFX_Matrix* pMatrix, + const CFX_Matrix& matrix, uint32_t dwStatus) override; }; diff --git a/xfa/fxfa/cxfa_fffield.cpp b/xfa/fxfa/cxfa_fffield.cpp index 1ef8824a3b..c62f4dcaec 100644 --- a/xfa/fxfa/cxfa_fffield.cpp +++ b/xfa/fxfa/cxfa_fffield.cpp @@ -58,16 +58,15 @@ CFX_RectF CXFA_FFField::GetBBox(uint32_t dwStatus, bool bDrawFocus) { } void CXFA_FFField::RenderWidget(CXFA_Graphics* pGS, - CFX_Matrix* pMatrix, + const CFX_Matrix& matrix, uint32_t dwStatus) { if (!IsMatchVisibleStatus(dwStatus)) return; CFX_Matrix mtRotate = GetRotateMatrix(); - if (pMatrix) - mtRotate.Concat(*pMatrix); + mtRotate.Concat(matrix); - CXFA_FFWidget::RenderWidget(pGS, &mtRotate, dwStatus); + CXFA_FFWidget::RenderWidget(pGS, mtRotate, dwStatus); CXFA_Border borderUI = m_pDataAcc->GetUIBorder(); DrawBorder(pGS, borderUI, m_rtUI, &mtRotate); RenderCaption(pGS, &mtRotate); diff --git a/xfa/fxfa/cxfa_fffield.h b/xfa/fxfa/cxfa_fffield.h index 06f7a2d06b..5ed6b48fce 100644 --- a/xfa/fxfa/cxfa_fffield.h +++ b/xfa/fxfa/cxfa_fffield.h @@ -25,7 +25,7 @@ class CXFA_FFField : public CXFA_FFWidget, public IFWL_WidgetDelegate { // CXFA_FFWidget CFX_RectF GetBBox(uint32_t dwStatus, bool bDrawFocus = false) override; void RenderWidget(CXFA_Graphics* pGS, - CFX_Matrix* pMatrix, + const CFX_Matrix& matrix, uint32_t dwStatus) override; bool IsLoaded() override; bool LoadWidget() override; diff --git a/xfa/fxfa/cxfa_ffimage.cpp b/xfa/fxfa/cxfa_ffimage.cpp index 75f8c3609b..ec6a29cd28 100644 --- a/xfa/fxfa/cxfa_ffimage.cpp +++ b/xfa/fxfa/cxfa_ffimage.cpp @@ -35,16 +35,15 @@ void CXFA_FFImage::UnloadWidget() { } void CXFA_FFImage::RenderWidget(CXFA_Graphics* pGS, - CFX_Matrix* pMatrix, + const CFX_Matrix& matrix, uint32_t dwStatus) { if (!IsMatchVisibleStatus(dwStatus)) return; CFX_Matrix mtRotate = GetRotateMatrix(); - if (pMatrix) - mtRotate.Concat(*pMatrix); + mtRotate.Concat(matrix); - CXFA_FFWidget::RenderWidget(pGS, &mtRotate, dwStatus); + CXFA_FFWidget::RenderWidget(pGS, mtRotate, dwStatus); CFX_RetainPtr<CFX_DIBitmap> pDIBitmap = GetDataAcc()->GetImageImage(); if (!pDIBitmap) @@ -67,6 +66,6 @@ void CXFA_FFImage::RenderWidget(CXFA_Graphics* pGS, int32_t iImageXDpi = 0; int32_t iImageYDpi = 0; m_pDataAcc->GetImageDpi(iImageXDpi, iImageYDpi); - XFA_DrawImage(pGS, rtImage, &mtRotate, pDIBitmap, iAspect, iImageXDpi, + XFA_DrawImage(pGS, rtImage, mtRotate, pDIBitmap, iAspect, iImageXDpi, iImageYDpi, iHorzAlign, iVertAlign); } diff --git a/xfa/fxfa/cxfa_ffimage.h b/xfa/fxfa/cxfa_ffimage.h index e58983fdca..869654b8df 100644 --- a/xfa/fxfa/cxfa_ffimage.h +++ b/xfa/fxfa/cxfa_ffimage.h @@ -16,7 +16,7 @@ class CXFA_FFImage : public CXFA_FFDraw { // CXFA_FFWidget void RenderWidget(CXFA_Graphics* pGS, - CFX_Matrix* pMatrix, + const CFX_Matrix& matrix, uint32_t dwStatus) override; bool IsLoaded() override; bool LoadWidget() override; diff --git a/xfa/fxfa/cxfa_ffimageedit.cpp b/xfa/fxfa/cxfa_ffimageedit.cpp index 02eeb98d84..bc5678ac90 100644 --- a/xfa/fxfa/cxfa_ffimageedit.cpp +++ b/xfa/fxfa/cxfa_ffimageedit.cpp @@ -52,16 +52,15 @@ void CXFA_FFImageEdit::UnloadWidget() { } void CXFA_FFImageEdit::RenderWidget(CXFA_Graphics* pGS, - CFX_Matrix* pMatrix, + const CFX_Matrix& matrix, uint32_t dwStatus) { if (!IsMatchVisibleStatus(dwStatus)) return; CFX_Matrix mtRotate = GetRotateMatrix(); - if (pMatrix) - mtRotate.Concat(*pMatrix); + mtRotate.Concat(matrix); - CXFA_FFWidget::RenderWidget(pGS, &mtRotate, dwStatus); + CXFA_FFWidget::RenderWidget(pGS, mtRotate, dwStatus); CXFA_Border borderUI = m_pDataAcc->GetUIBorder(); DrawBorder(pGS, borderUI, m_rtUI, &mtRotate); RenderCaption(pGS, &mtRotate); @@ -86,7 +85,7 @@ void CXFA_FFImageEdit::RenderWidget(CXFA_Graphics* pGS, int32_t iImageXDpi = 0; int32_t iImageYDpi = 0; m_pDataAcc->GetImageEditDpi(iImageXDpi, iImageYDpi); - XFA_DrawImage(pGS, rtImage, &mtRotate, pDIBitmap, iAspect, iImageXDpi, + XFA_DrawImage(pGS, rtImage, mtRotate, pDIBitmap, iAspect, iImageXDpi, iImageYDpi, iHorzAlign, iVertAlign); } diff --git a/xfa/fxfa/cxfa_ffimageedit.h b/xfa/fxfa/cxfa_ffimageedit.h index 2d0a649775..adda3028c3 100644 --- a/xfa/fxfa/cxfa_ffimageedit.h +++ b/xfa/fxfa/cxfa_ffimageedit.h @@ -16,7 +16,7 @@ class CXFA_FFImageEdit : public CXFA_FFField { // CXFA_FFField void RenderWidget(CXFA_Graphics* pGS, - CFX_Matrix* pMatrix, + const CFX_Matrix& matrix, uint32_t dwStatus) override; bool LoadWidget() override; void UnloadWidget() override; diff --git a/xfa/fxfa/cxfa_ffline.cpp b/xfa/fxfa/cxfa_ffline.cpp index 4353e684a4..358b8c3714 100644 --- a/xfa/fxfa/cxfa_ffline.cpp +++ b/xfa/fxfa/cxfa_ffline.cpp @@ -48,7 +48,7 @@ void CXFA_FFLine::GetRectFromHand(CFX_RectF& rect, } void CXFA_FFLine::RenderWidget(CXFA_Graphics* pGS, - CFX_Matrix* pMatrix, + const CFX_Matrix& matrix, uint32_t dwStatus) { if (!IsMatchVisibleStatus(dwStatus)) return; @@ -74,8 +74,7 @@ void CXFA_FFLine::RenderWidget(CXFA_Graphics* pGS, } CFX_Matrix mtRotate = GetRotateMatrix(); - if (pMatrix) - mtRotate.Concat(*pMatrix); + mtRotate.Concat(matrix); CFX_RectF rtLine = GetRectWithoutRotate(); if (CXFA_Margin mgWidget = m_pDataAcc->GetMargin()) diff --git a/xfa/fxfa/cxfa_ffline.h b/xfa/fxfa/cxfa_ffline.h index a5c7ee19f6..fc13096d49 100644 --- a/xfa/fxfa/cxfa_ffline.h +++ b/xfa/fxfa/cxfa_ffline.h @@ -16,7 +16,7 @@ class CXFA_FFLine : public CXFA_FFDraw { // CXFA_FFWidget void RenderWidget(CXFA_Graphics* pGS, - CFX_Matrix* pMatrix, + const CFX_Matrix& matrix, uint32_t dwStatus) override; private: diff --git a/xfa/fxfa/cxfa_ffpushbutton.cpp b/xfa/fxfa/cxfa_ffpushbutton.cpp index b6ba0f56b1..45d4e71b3f 100644 --- a/xfa/fxfa/cxfa_ffpushbutton.cpp +++ b/xfa/fxfa/cxfa_ffpushbutton.cpp @@ -29,16 +29,15 @@ CXFA_FFPushButton::~CXFA_FFPushButton() { } void CXFA_FFPushButton::RenderWidget(CXFA_Graphics* pGS, - CFX_Matrix* pMatrix, + const CFX_Matrix& matrix, uint32_t dwStatus) { if (!IsMatchVisibleStatus(dwStatus)) return; CFX_Matrix mtRotate = GetRotateMatrix(); - if (pMatrix) - mtRotate.Concat(*pMatrix); + mtRotate.Concat(matrix); - CXFA_FFWidget::RenderWidget(pGS, &mtRotate, dwStatus); + CXFA_FFWidget::RenderWidget(pGS, mtRotate, dwStatus); RenderHighlightCaption(pGS, &mtRotate); CFX_RectF rtWidget = GetRectWithoutRotate(); diff --git a/xfa/fxfa/cxfa_ffpushbutton.h b/xfa/fxfa/cxfa_ffpushbutton.h index e8b8909bb2..dda06068cd 100644 --- a/xfa/fxfa/cxfa_ffpushbutton.h +++ b/xfa/fxfa/cxfa_ffpushbutton.h @@ -25,7 +25,7 @@ class CXFA_FFPushButton : public CXFA_FFField { // CXFA_FFField void RenderWidget(CXFA_Graphics* pGS, - CFX_Matrix* pMatrix, + const CFX_Matrix& matrix, uint32_t dwStatus) override; bool LoadWidget() override; void UnloadWidget() override; diff --git a/xfa/fxfa/cxfa_ffrectangle.cpp b/xfa/fxfa/cxfa_ffrectangle.cpp index 670ad2b98f..476f3acfac 100644 --- a/xfa/fxfa/cxfa_ffrectangle.cpp +++ b/xfa/fxfa/cxfa_ffrectangle.cpp @@ -12,7 +12,7 @@ CXFA_FFRectangle::CXFA_FFRectangle(CXFA_WidgetAcc* pDataAcc) CXFA_FFRectangle::~CXFA_FFRectangle() {} void CXFA_FFRectangle::RenderWidget(CXFA_Graphics* pGS, - CFX_Matrix* pMatrix, + const CFX_Matrix& matrix, uint32_t dwStatus) { if (!IsMatchVisibleStatus(dwStatus)) return; @@ -27,8 +27,7 @@ void CXFA_FFRectangle::RenderWidget(CXFA_Graphics* pGS, XFA_RectWidthoutMargin(rect, mgWidget); CFX_Matrix mtRotate = GetRotateMatrix(); - if (pMatrix) - mtRotate.Concat(*pMatrix); + mtRotate.Concat(matrix); DrawBorder(pGS, rtObj, rect, &mtRotate); } diff --git a/xfa/fxfa/cxfa_ffrectangle.h b/xfa/fxfa/cxfa_ffrectangle.h index bec5d080a0..24da214093 100644 --- a/xfa/fxfa/cxfa_ffrectangle.h +++ b/xfa/fxfa/cxfa_ffrectangle.h @@ -16,7 +16,7 @@ class CXFA_FFRectangle : public CXFA_FFDraw { // CXFA_FFWidget void RenderWidget(CXFA_Graphics* pGS, - CFX_Matrix* pMatrix, + const CFX_Matrix& matrix, uint32_t dwStatus) override; }; diff --git a/xfa/fxfa/cxfa_ffsignature.cpp b/xfa/fxfa/cxfa_ffsignature.cpp index 96de0a69b0..f527cd9cf8 100644 --- a/xfa/fxfa/cxfa_ffsignature.cpp +++ b/xfa/fxfa/cxfa_ffsignature.cpp @@ -21,16 +21,15 @@ bool CXFA_FFSignature::LoadWidget() { } void CXFA_FFSignature::RenderWidget(CXFA_Graphics* pGS, - CFX_Matrix* pMatrix, + const CFX_Matrix& matrix, uint32_t dwStatus) { if (!IsMatchVisibleStatus(dwStatus)) return; CFX_Matrix mtRotate = GetRotateMatrix(); - if (pMatrix) - mtRotate.Concat(*pMatrix); + mtRotate.Concat(matrix); - CXFA_FFWidget::RenderWidget(pGS, &mtRotate, dwStatus); + CXFA_FFWidget::RenderWidget(pGS, mtRotate, dwStatus); CXFA_Border borderUI = m_pDataAcc->GetUIBorder(); DrawBorder(pGS, borderUI, m_rtUI, &mtRotate); diff --git a/xfa/fxfa/cxfa_ffsignature.h b/xfa/fxfa/cxfa_ffsignature.h index b4b9f8e5b9..b9051962e3 100644 --- a/xfa/fxfa/cxfa_ffsignature.h +++ b/xfa/fxfa/cxfa_ffsignature.h @@ -16,7 +16,7 @@ class CXFA_FFSignature final : public CXFA_FFField { // CXFA_FFField void RenderWidget(CXFA_Graphics* pGS, - CFX_Matrix* pMatrix, + const CFX_Matrix& matrix, uint32_t dwStatus) override; bool LoadWidget() override; bool OnMouseEnter() override; diff --git a/xfa/fxfa/cxfa_fftext.cpp b/xfa/fxfa/cxfa_fftext.cpp index 9b646230c2..6246ec5731 100644 --- a/xfa/fxfa/cxfa_fftext.cpp +++ b/xfa/fxfa/cxfa_fftext.cpp @@ -24,16 +24,15 @@ CXFA_FFText::CXFA_FFText(CXFA_WidgetAcc* pDataAcc) : CXFA_FFDraw(pDataAcc) {} CXFA_FFText::~CXFA_FFText() {} void CXFA_FFText::RenderWidget(CXFA_Graphics* pGS, - CFX_Matrix* pMatrix, + const CFX_Matrix& matrix, uint32_t dwStatus) { if (!IsMatchVisibleStatus(dwStatus)) return; CFX_Matrix mtRotate = GetRotateMatrix(); - if (pMatrix) - mtRotate.Concat(*pMatrix); + mtRotate.Concat(matrix); - CXFA_FFWidget::RenderWidget(pGS, &mtRotate, dwStatus); + CXFA_FFWidget::RenderWidget(pGS, mtRotate, dwStatus); CXFA_TextLayout* pTextLayout = m_pDataAcc->GetTextLayout(); if (!pTextLayout) diff --git a/xfa/fxfa/cxfa_fftext.h b/xfa/fxfa/cxfa_fftext.h index 00c57c7cfc..2695f4568b 100644 --- a/xfa/fxfa/cxfa_fftext.h +++ b/xfa/fxfa/cxfa_fftext.h @@ -20,7 +20,7 @@ class CXFA_FFText : public CXFA_FFDraw { bool OnMouseMove(uint32_t dwFlags, const CFX_PointF& point) override; FWL_WidgetHit OnHitTest(const CFX_PointF& point) override; void RenderWidget(CXFA_Graphics* pGS, - CFX_Matrix* pMatrix, + const CFX_Matrix& matrix, uint32_t dwStatus) override; bool IsLoaded() override; bool PerformLayout() override; diff --git a/xfa/fxfa/cxfa_ffwidget.cpp b/xfa/fxfa/cxfa_ffwidget.cpp index 6996b647d3..ee445bbf25 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, - CFX_Matrix* pMatrix) { + const CFX_Matrix* pMatrix) { CXFA_Fill fill = box.GetFill(); FX_ARGB crStart, crEnd; crStart = fill.GetColor(); @@ -414,7 +414,7 @@ void XFA_BOX_Fill_Pattern(CXFA_Box box, CXFA_Graphics* pGS, CXFA_Path& fillPath, CFX_RectF rtFill, - CFX_Matrix* pMatrix) { + const CFX_Matrix* pMatrix) { CXFA_Fill fill = box.GetFill(); FX_ARGB crStart, crEnd; crStart = fill.GetColor(); @@ -449,7 +449,7 @@ void XFA_BOX_Fill_Linear(CXFA_Box box, CXFA_Graphics* pGS, CXFA_Path& fillPath, CFX_RectF rtFill, - CFX_Matrix* pMatrix) { + const CFX_Matrix* pMatrix) { CXFA_Fill fill = box.GetFill(); FX_ARGB crStart = fill.GetColor(); FX_ARGB crEnd; @@ -485,7 +485,7 @@ void XFA_BOX_Fill(CXFA_Box box, const std::vector<CXFA_Stroke>& strokes, CXFA_Graphics* pGS, const CFX_RectF& rtWidget, - CFX_Matrix* pMatrix, + const CFX_Matrix* pMatrix, uint32_t dwFlags) { CXFA_Fill fill = box.GetFill(); if (!fill || fill.GetPresence() != XFA_ATTRIBUTEENUM_Visible) @@ -530,7 +530,7 @@ void XFA_BOX_Fill(CXFA_Box box, void XFA_BOX_StrokePath(CXFA_Stroke stroke, CXFA_Path* pPath, CXFA_Graphics* pGS, - CFX_Matrix* pMatrix) { + const CFX_Matrix* pMatrix) { if (!stroke || !stroke.IsVisible()) { return; } @@ -555,7 +555,7 @@ void XFA_BOX_StrokePath(CXFA_Stroke stroke, void XFA_BOX_StrokeArc(CXFA_Box box, CXFA_Graphics* pGS, CFX_RectF rtWidget, - CFX_Matrix* pMatrix, + const CFX_Matrix* pMatrix, uint32_t dwFlags) { CXFA_Edge edge = box.GetEdge(0); if (!edge || !edge.IsVisible()) { @@ -641,7 +641,7 @@ void XFA_BOX_StrokeArc(CXFA_Box box, void XFA_Draw3DRect(CXFA_Graphics* pGraphic, const CFX_RectF& rt, float fLineWidth, - CFX_Matrix* pMatrix, + const CFX_Matrix* pMatrix, FX_ARGB argbTopLeft, FX_ARGB argbBottomRight) { float fBottom = rt.bottom(); @@ -672,7 +672,7 @@ void XFA_Draw3DRect(CXFA_Graphics* pGraphic, void XFA_BOX_Stroke_3DRect_Lowered(CXFA_Graphics* pGS, CFX_RectF rt, float fThickness, - CFX_Matrix* pMatrix) { + const CFX_Matrix* pMatrix) { float fHalfWidth = fThickness / 2.0f; CFX_RectF rtInner(rt); rtInner.Deflate(fHalfWidth, fHalfWidth); @@ -688,7 +688,7 @@ void XFA_BOX_Stroke_3DRect_Lowered(CXFA_Graphics* pGS, void XFA_BOX_Stroke_3DRect_Raised(CXFA_Graphics* pGS, CFX_RectF rt, float fThickness, - CFX_Matrix* pMatrix) { + const CFX_Matrix* pMatrix) { float fHalfWidth = fThickness / 2.0f; CFX_RectF rtInner(rt); rtInner.Deflate(fHalfWidth, fHalfWidth); @@ -704,7 +704,7 @@ void XFA_BOX_Stroke_3DRect_Raised(CXFA_Graphics* pGS, void XFA_BOX_Stroke_3DRect_Etched(CXFA_Graphics* pGS, CFX_RectF rt, float fThickness, - CFX_Matrix* pMatrix) { + const CFX_Matrix* pMatrix) { float fHalfWidth = fThickness / 2.0f; XFA_Draw3DRect(pGS, rt, fThickness, pMatrix, 0xFF808080, 0xFFFFFFFF); CFX_RectF rtInner(rt); @@ -715,7 +715,7 @@ void XFA_BOX_Stroke_3DRect_Etched(CXFA_Graphics* pGS, void XFA_BOX_Stroke_3DRect_Embossed(CXFA_Graphics* pGS, CFX_RectF rt, float fThickness, - CFX_Matrix* pMatrix) { + const CFX_Matrix* pMatrix) { float fHalfWidth = fThickness / 2.0f; XFA_Draw3DRect(pGS, rt, fThickness, pMatrix, 0xFF808080, 0xFF000000); CFX_RectF rtInner(rt); @@ -727,7 +727,7 @@ void XFA_BOX_Stroke_Rect(CXFA_Box box, const std::vector<CXFA_Stroke>& strokes, CXFA_Graphics* pGS, CFX_RectF rtWidget, - CFX_Matrix* pMatrix) { + const CFX_Matrix* pMatrix) { bool bVisible = false; float fThickness = 0; int32_t i3DType = box.Get3DStyle(bVisible, fThickness); @@ -816,7 +816,7 @@ void XFA_BOX_Stroke(CXFA_Box box, const std::vector<CXFA_Stroke>& strokes, CXFA_Graphics* pGS, CFX_RectF rtWidget, - CFX_Matrix* pMatrix, + const CFX_Matrix* pMatrix, uint32_t dwFlags) { if (box.IsArc() || (dwFlags & XFA_DRAWBOX_ForceRound) != 0) { XFA_BOX_StrokeArc(box, pGS, rtWidget, pMatrix, dwFlags); @@ -881,7 +881,7 @@ void XFA_BOX_Stroke(CXFA_Box box, void XFA_DrawBox(CXFA_Box box, CXFA_Graphics* pGS, const CFX_RectF& rtWidget, - CFX_Matrix* pMatrix, + const CFX_Matrix* pMatrix, uint32_t dwFlags) { if (!box || box.GetPresence() != XFA_ATTRIBUTEENUM_Visible) return; @@ -976,7 +976,7 @@ bool CXFA_FFWidget::GetToolTip(CFX_WideString& wsToolTip) { } void CXFA_FFWidget::RenderWidget(CXFA_Graphics* pGS, - CFX_Matrix* pMatrix, + const CFX_Matrix& matrix, uint32_t dwStatus) { if (!IsMatchVisibleStatus(dwStatus)) return; @@ -991,7 +991,7 @@ void CXFA_FFWidget::RenderWidget(CXFA_Graphics* pGS, XFA_RectWidthoutMargin(rtBorder, margin); rtBorder.Normalize(); - DrawBorder(pGS, border, rtBorder, pMatrix); + DrawBorder(pGS, border, rtBorder, &matrix); } bool CXFA_FFWidget::IsLoaded() { @@ -1014,14 +1014,14 @@ void CXFA_FFWidget::UpdateWidgetProperty() {} void CXFA_FFWidget::DrawBorder(CXFA_Graphics* pGS, CXFA_Box box, const CFX_RectF& rtBorder, - CFX_Matrix* pMatrix) { + const CFX_Matrix* pMatrix) { XFA_DrawBox(box, pGS, rtBorder, pMatrix, 0); } void CXFA_FFWidget::DrawBorderWithFlags(CXFA_Graphics* pGS, CXFA_Box box, const CFX_RectF& rtBorder, - CFX_Matrix* pMatrix, + const CFX_Matrix* pMatrix, uint32_t dwFlags) { XFA_DrawBox(box, pGS, rtBorder, pMatrix, dwFlags); } @@ -1683,7 +1683,7 @@ void CXFA_ImageRenderer::CompositeDIBitmap( void XFA_DrawImage(CXFA_Graphics* pGS, const CFX_RectF& rtImage, - CFX_Matrix* pMatrix, + const CFX_Matrix& matrix, const CFX_RetainPtr<CFX_DIBitmap>& pDIBitmap, int32_t iAspect, int32_t iImageXDpi, @@ -1738,12 +1738,12 @@ void XFA_DrawImage(CXFA_Graphics* pGS, CFX_RenderDevice::StateRestorer restorer(pRenderDevice); CFX_PathData path; path.AppendRect(rtImage.left, rtImage.bottom(), rtImage.right(), rtImage.top); - pRenderDevice->SetClip_PathFill(&path, pMatrix, FXFILL_WINDING); + pRenderDevice->SetClip_PathFill(&path, &matrix, FXFILL_WINDING); CFX_Matrix mtImage(1, 0, 0, -1, 0, 1); mtImage.Concat( CFX_Matrix(rtFit.width, 0, 0, rtFit.height, rtFit.left, rtFit.top)); - mtImage.Concat(*pMatrix); + mtImage.Concat(matrix); CXFA_ImageRenderer imageRender; if (!imageRender.Start(pRenderDevice, pDIBitmap, 0, 255, &mtImage, diff --git a/xfa/fxfa/cxfa_ffwidget.h b/xfa/fxfa/cxfa_ffwidget.h index d7d8707457..cac229416e 100644 --- a/xfa/fxfa/cxfa_ffwidget.h +++ b/xfa/fxfa/cxfa_ffwidget.h @@ -41,7 +41,7 @@ int32_t XFA_StrokeTypeSetLineDash(CXFA_Graphics* pGraphics, CFX_GraphStateData::LineCap XFA_LineCapToFXGE(int32_t iLineCap); void XFA_DrawImage(CXFA_Graphics* pGS, const CFX_RectF& rtImage, - CFX_Matrix* pMatrix, + const CFX_Matrix& matrix, const CFX_RetainPtr<CFX_DIBitmap>& pDIBitmap, int32_t iAspect, int32_t iImageXDpi, @@ -88,7 +88,7 @@ class CXFA_FFWidget : public CXFA_ContentLayoutItem { virtual CFX_RectF GetBBox(uint32_t dwStatus, bool bDrawFocus = false); virtual void RenderWidget(CXFA_Graphics* pGS, - CFX_Matrix* pMatrix, + const CFX_Matrix& matrix, uint32_t dwStatus); virtual bool IsLoaded(); virtual bool LoadWidget(); @@ -169,11 +169,11 @@ class CXFA_FFWidget : public CXFA_ContentLayoutItem { void DrawBorder(CXFA_Graphics* pGS, CXFA_Box box, const CFX_RectF& rtBorder, - CFX_Matrix* pMatrix); + const CFX_Matrix* pMatrix); void DrawBorderWithFlags(CXFA_Graphics* pGS, CXFA_Box box, const CFX_RectF& rtBorder, - CFX_Matrix* pMatrix, + const CFX_Matrix* pMatrix, uint32_t dwFlags); CFX_RectF GetRectWithoutRotate(); diff --git a/xfa/fxfa/cxfa_ffwidgethandler.cpp b/xfa/fxfa/cxfa_ffwidgethandler.cpp index c78b5e8837..524bbed9e2 100644 --- a/xfa/fxfa/cxfa_ffwidgethandler.cpp +++ b/xfa/fxfa/cxfa_ffwidgethandler.cpp @@ -156,9 +156,9 @@ bool CXFA_FFWidgetHandler::OnSetCursor(CXFA_FFWidget* hWidget, void CXFA_FFWidgetHandler::RenderWidget(CXFA_FFWidget* hWidget, CXFA_Graphics* pGS, - CFX_Matrix* pMatrix, + const CFX_Matrix& matrix, bool bHighlight) { - hWidget->RenderWidget(pGS, pMatrix, + hWidget->RenderWidget(pGS, matrix, bHighlight ? XFA_WidgetStatus_Highlight : 0); } diff --git a/xfa/fxfa/cxfa_ffwidgethandler.h b/xfa/fxfa/cxfa_ffwidgethandler.h index 36d91a709c..474412069e 100644 --- a/xfa/fxfa/cxfa_ffwidgethandler.h +++ b/xfa/fxfa/cxfa_ffwidgethandler.h @@ -60,7 +60,7 @@ class CXFA_FFWidgetHandler { bool OnSetCursor(CXFA_FFWidget* hWidget, const CFX_PointF& point); void RenderWidget(CXFA_FFWidget* hWidget, CXFA_Graphics* pGS, - CFX_Matrix* pMatrix, + const CFX_Matrix& matrix, bool bHighlight); bool HasEvent(CXFA_WidgetAcc* pWidgetAcc, XFA_EVENTTYPE eEventType); int32_t ProcessEvent(CXFA_WidgetAcc* pWidgetAcc, CXFA_EventParam* pParam); diff --git a/xfa/fxfa/cxfa_rendercontext.cpp b/xfa/fxfa/cxfa_rendercontext.cpp index bac13f3676..6667d46068 100644 --- a/xfa/fxfa/cxfa_rendercontext.cpp +++ b/xfa/fxfa/cxfa_rendercontext.cpp @@ -30,7 +30,7 @@ void CXFA_RenderContext::DoRender(CXFA_Graphics* gs) { rtWidgetBox.width += 1; rtWidgetBox.height += 1; if (rtWidgetBox.IntersectWith(m_rtClipRect)) - m_pWidget->RenderWidget(gs, &m_matrix, XFA_WidgetStatus_Highlight); + m_pWidget->RenderWidget(gs, m_matrix, XFA_WidgetStatus_Highlight); m_pWidget = m_pWidgetIterator->MoveToNext(); } |