From 7d75650672a848428aaadb603b2814d33dfb479f Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Thu, 15 Mar 2018 19:27:17 +0000 Subject: Add a CFX_PathData::AppendRect() variant. One that takes a CFX_FloatRect instead of LBRT floats. Use it where appropriate. Change-Id: I8ba19e86c61c91d8b4ef685b5cb65c8fb717f013 Reviewed-on: https://pdfium-review.googlesource.com/28581 Reviewed-by: Henrique Nakashima Commit-Queue: Lei Zhang --- core/fxge/cfx_renderdevice.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'core/fxge/cfx_renderdevice.cpp') diff --git a/core/fxge/cfx_renderdevice.cpp b/core/fxge/cfx_renderdevice.cpp index 6c7e896b01..2e279d636f 100644 --- a/core/fxge/cfx_renderdevice.cpp +++ b/core/fxge/cfx_renderdevice.cpp @@ -1134,8 +1134,7 @@ void CFX_RenderDevice::DrawFillRect(const CFX_Matrix* pUser2Device, const CFX_FloatRect& rect, const FX_COLORREF& color) { CFX_PathData path; - CFX_FloatRect rcTemp(rect); - path.AppendRect(rcTemp.left, rcTemp.bottom, rcTemp.right, rcTemp.top); + path.AppendRect(rect); DrawPath(&path, pUser2Device, nullptr, color, 0, FXFILL_WINDING); } @@ -1155,13 +1154,11 @@ void CFX_RenderDevice::DrawStrokeRect(const CFX_Matrix* pUser2Device, const CFX_FloatRect& rect, const FX_COLORREF& color, float fWidth) { - CFX_PathData path; - CFX_FloatRect rcTemp(rect); - path.AppendRect(rcTemp.left, rcTemp.bottom, rcTemp.right, rcTemp.top); - CFX_GraphStateData gsd; gsd.m_LineWidth = fWidth; + CFX_PathData path; + path.AppendRect(rect); DrawPath(&path, pUser2Device, &gsd, 0, color, FXFILL_ALTERNATE); } -- cgit v1.2.3