summaryrefslogtreecommitdiff
path: root/xfa
diff options
context:
space:
mode:
authorNicolas Pena <npm@chromium.org>2017-06-29 12:02:06 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-06-29 20:50:09 +0000
commitb21f174ad87e46c823c2ef8c11682167e2d12864 (patch)
tree79c3661672cbd2f84ee835f9922231bb90a634b3 /xfa
parent8ce58f522e046ae3b1561d592ca7b3cd7c894731 (diff)
downloadpdfium-b21f174ad87e46c823c2ef8c11682167e2d12864.tar.xz
Change SetReverse to GetInverse in CFX_Matrix
CFX_Matrix::GetInverse is much clearer. Change-Id: Id10ab1723735332e1a78de853f28415ec3a4d834 Reviewed-on: https://pdfium-review.googlesource.com/7090 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'xfa')
-rw-r--r--xfa/fde/cfde_rendercontext.cpp4
-rw-r--r--xfa/fde/cfde_textout.cpp4
-rw-r--r--xfa/fwl/cfwl_widget.cpp5
-rw-r--r--xfa/fwl/cfwl_widgetmgr.cpp7
-rw-r--r--xfa/fxfa/cxfa_ffwidget.cpp4
-rw-r--r--xfa/fxfa/cxfa_rendercontext.cpp4
6 files changed, 7 insertions, 21 deletions
diff --git a/xfa/fde/cfde_rendercontext.cpp b/xfa/fde/cfde_rendercontext.cpp
index 702f7ce295..dc2a628c23 100644
--- a/xfa/fde/cfde_rendercontext.cpp
+++ b/xfa/fde/cfde_rendercontext.cpp
@@ -40,15 +40,13 @@ void CFDE_RenderContext::DoRender() {
if (!m_pRenderDevice || !m_pIterator)
return;
- CFX_Matrix rm;
- rm.SetReverse(m_Transform);
CFX_RectF rtDocClip = m_pRenderDevice->GetClipRect();
if (rtDocClip.IsEmpty()) {
rtDocClip.left = rtDocClip.top = 0;
rtDocClip.width = (float)m_pRenderDevice->GetWidth();
rtDocClip.height = (float)m_pRenderDevice->GetHeight();
}
- rm.TransformRect(rtDocClip);
+ m_Transform.GetInverse().TransformRect(rtDocClip);
IFDE_VisualSet* pVisualSet;
FDE_TEXTEDITPIECE* pPiece;
int32_t iCount = 0;
diff --git a/xfa/fde/cfde_textout.cpp b/xfa/fde/cfde_textout.cpp
index 6d5ab2a980..5d84b6d12b 100644
--- a/xfa/fde/cfde_textout.cpp
+++ b/xfa/fde/cfde_textout.cpp
@@ -294,9 +294,7 @@ void CFDE_TextOut::DrawText(const wchar_t* pwsStr,
int32_t iLength,
const CFX_RectF& rect) {
CFX_RectF rtText(rect.left, rect.top, rect.width, rect.height);
- CFX_Matrix rm;
- rm.SetReverse(m_Matrix);
- rm.TransformRect(rtText);
+ m_Matrix.GetInverse().TransformRect(rtText);
DrawText(pwsStr, iLength, rtText, m_rtClip);
}
diff --git a/xfa/fwl/cfwl_widget.cpp b/xfa/fwl/cfwl_widget.cpp
index 172014da62..45ae9c0b0c 100644
--- a/xfa/fwl/cfwl_widget.cpp
+++ b/xfa/fwl/cfwl_widget.cpp
@@ -197,9 +197,8 @@ CFX_PointF CFWL_Widget::TransformTo(CFWL_Widget* pWidget,
if (!parent)
return ret;
- CFX_Matrix m;
- m.SetReverse(pWidget->GetMatrix());
- return m.Transform(ret) - pWidget->GetWidgetRect().TopLeft();
+ return pWidget->GetMatrix().GetInverse().Transform(ret) -
+ pWidget->GetWidgetRect().TopLeft();
}
CFX_Matrix CFWL_Widget::GetMatrix() {
diff --git a/xfa/fwl/cfwl_widgetmgr.cpp b/xfa/fwl/cfwl_widgetmgr.cpp
index 67a63ba921..3abe14d89b 100644
--- a/xfa/fwl/cfwl_widgetmgr.cpp
+++ b/xfa/fwl/cfwl_widgetmgr.cpp
@@ -266,12 +266,7 @@ CFWL_Widget* CFWL_WidgetMgr::GetWidgetAtPoint(CFWL_Widget* parent,
CFWL_Widget* child = GetLastChildWidget(parent);
while (child) {
if ((child->GetStates() & FWL_WGTSTATE_Invisible) == 0) {
- CFX_Matrix m;
- m.SetIdentity();
-
- CFX_Matrix matrixOnParent;
- m.SetReverse(matrixOnParent);
- pos = m.Transform(point);
+ pos = parent->GetMatrix().GetInverse().Transform(point);
CFX_RectF bounds = child->GetWidgetRect();
if (bounds.Contains(pos)) {
diff --git a/xfa/fxfa/cxfa_ffwidget.cpp b/xfa/fxfa/cxfa_ffwidget.cpp
index 9de99255ab..f72b29127a 100644
--- a/xfa/fxfa/cxfa_ffwidget.cpp
+++ b/xfa/fxfa/cxfa_ffwidget.cpp
@@ -348,9 +348,7 @@ CFX_PointF CXFA_FFWidget::Rotate2Normal(const CFX_PointF& point) {
if (mt.IsIdentity())
return point;
- CFX_Matrix mtReverse;
- mtReverse.SetReverse(mt);
- return mtReverse.Transform(point);
+ return mt.GetInverse().Transform(point);
}
static void XFA_GetMatrix(CFX_Matrix& m,
diff --git a/xfa/fxfa/cxfa_rendercontext.cpp b/xfa/fxfa/cxfa_rendercontext.cpp
index 02c7cbb371..d709502ec8 100644
--- a/xfa/fxfa/cxfa_rendercontext.cpp
+++ b/xfa/fxfa/cxfa_rendercontext.cpp
@@ -14,9 +14,7 @@ CXFA_RenderContext::CXFA_RenderContext(CXFA_FFPageView* pPageView,
const CFX_RectF& clipRect,
const CFX_Matrix& matrix)
: m_pWidget(nullptr), m_matrix(matrix), m_rtClipRect(clipRect) {
- CFX_Matrix mtRes;
- mtRes.SetReverse(matrix);
- mtRes.TransformRect(m_rtClipRect);
+ matrix.GetInverse().TransformRect(m_rtClipRect);
m_pWidgetIterator = pPageView->CreateWidgetIterator(
XFA_TRAVERSEWAY_Form,