summaryrefslogtreecommitdiff
path: root/fpdfsdk/cpdfsdk_widget.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-02-09 13:07:43 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-02-09 19:02:55 +0000
commitafb44560a21298b3588b36cbaf45e2be50f2e75b (patch)
tree21f3ececad017e6be64a19c4370cfe9fd7f9c29c /fpdfsdk/cpdfsdk_widget.cpp
parent67e4faaf8be0aebc67ebfb96d33933d9f9119d20 (diff)
downloadpdfium-afb44560a21298b3588b36cbaf45e2be50f2e75b.tar.xz
Remove Transform in favour of TransformPoint
This CL removes the two Transform() overrides from CFX_Matrix and calls the TransformPoint methods directly. In the case of the 4 param version the values were assigned to the out values before calling. Change-Id: Id633826caec75b848774dcda6cfdcef2dbf5a7db Reviewed-on: https://pdfium-review.googlesource.com/2573 Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/cpdfsdk_widget.cpp')
-rw-r--r--fpdfsdk/cpdfsdk_widget.cpp20
1 files changed, 7 insertions, 13 deletions
diff --git a/fpdfsdk/cpdfsdk_widget.cpp b/fpdfsdk/cpdfsdk_widget.cpp
index 108690665c..1af4703da0 100644
--- a/fpdfsdk/cpdfsdk_widget.cpp
+++ b/fpdfsdk/cpdfsdk_widget.cpp
@@ -841,24 +841,18 @@ void CPDFSDK_Widget::DrawShadow(CFX_RenderDevice* pDevice,
if (!m_pInterForm->IsNeedHighLight(nFieldType))
return;
- CFX_FloatRect rc = GetRect();
- FX_COLORREF color = m_pInterForm->GetHighlightColor(nFieldType);
- uint8_t alpha = m_pInterForm->GetHighlightAlpha();
-
- CFX_FloatRect rcDevice;
CFX_Matrix page2device;
pPageView->GetCurrentMatrix(page2device);
- page2device.Transform(((FX_FLOAT)rc.left), ((FX_FLOAT)rc.bottom),
- rcDevice.left, rcDevice.bottom);
- page2device.Transform(((FX_FLOAT)rc.right), ((FX_FLOAT)rc.top),
- rcDevice.right, rcDevice.top);
+ CFX_FloatRect rcDevice = GetRect();
+ page2device.TransformPoint(rcDevice.left, rcDevice.bottom);
+ page2device.TransformPoint(rcDevice.right, rcDevice.top);
rcDevice.Normalize();
- FX_ARGB argb = ArgbEncode((int)alpha, color);
- FX_RECT rcDev((int)rcDevice.left, (int)rcDevice.top, (int)rcDevice.right,
- (int)rcDevice.bottom);
- pDevice->FillRect(&rcDev, argb);
+ FX_RECT rcDev = rcDevice.ToFxRect();
+ pDevice->FillRect(
+ &rcDev, ArgbEncode(static_cast<int>(m_pInterForm->GetHighlightAlpha()),
+ m_pInterForm->GetHighlightColor(nFieldType)));
}
void CPDFSDK_Widget::ResetAppearance_PushButton() {