summaryrefslogtreecommitdiff
path: root/xfa/fxgraphics/cxfa_graphics.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-04-10 19:02:15 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-04-10 19:02:15 +0000
commite5c3ebd923a21c6c82bd214ca27a5d7396b852c2 (patch)
treed952cc04bd711b5dd21ad2dcce7ea307024c719b /xfa/fxgraphics/cxfa_graphics.cpp
parent85ba2610cf05a75b52681f381bba2da3ba37b984 (diff)
downloadpdfium-e5c3ebd923a21c6c82bd214ca27a5d7396b852c2.tar.xz
Change CFX_RenderDevice::FillRect() to take FX_RECT by const-ref.
It currently takes const FX_RECT*, but the pointer is never nullptr. Change-Id: I571e9e8dd04756bc4daa25a61a5af8d1f902914b Reviewed-on: https://pdfium-review.googlesource.com/30052 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'xfa/fxgraphics/cxfa_graphics.cpp')
-rw-r--r--xfa/fxgraphics/cxfa_graphics.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/xfa/fxgraphics/cxfa_graphics.cpp b/xfa/fxgraphics/cxfa_graphics.cpp
index d1e2f35c7e..b13ecc060d 100644
--- a/xfa/fxgraphics/cxfa_graphics.cpp
+++ b/xfa/fxgraphics/cxfa_graphics.cpp
@@ -282,14 +282,13 @@ void CXFA_Graphics::FillPathWithPattern(const CXFA_GEPath* path,
auto mask = pdfium::MakeRetain<CFX_DIBitmap>();
mask->Create(data.width, data.height, FXDIB_1bppMask);
memcpy(mask->GetBuffer(), data.maskBits, mask->GetPitch() * data.height);
- CFX_FloatRect rectf =
+ const CFX_FloatRect rectf =
matrix.TransformRect(path->GetPathData()->GetBoundingBox());
+ const FX_RECT rect = rectf.ToRoundedFxRect();
- FX_RECT rect(FXSYS_round(rectf.left), FXSYS_round(rectf.top),
- FXSYS_round(rectf.right), FXSYS_round(rectf.bottom));
CFX_DefaultRenderDevice device;
device.Attach(bmp, false, nullptr, false);
- device.FillRect(&rect, m_info.fillColor.GetPattern()->m_backArgb);
+ device.FillRect(rect, m_info.fillColor.GetPattern()->m_backArgb);
for (int32_t j = rect.bottom; j < rect.top; j += mask->GetHeight()) {
for (int32_t i = rect.left; i < rect.right; i += mask->GetWidth())
device.SetBitMask(mask, i, j, m_info.fillColor.GetPattern()->m_foreArgb);