From e5c3ebd923a21c6c82bd214ca27a5d7396b852c2 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Tue, 10 Apr 2018 19:02:15 +0000 Subject: 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 Reviewed-by: Ryan Harrison --- core/fpdfapi/render/cpdf_rendercontext.cpp | 4 ++-- core/fxge/cfx_renderdevice.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'core') diff --git a/core/fpdfapi/render/cpdf_rendercontext.cpp b/core/fpdfapi/render/cpdf_rendercontext.cpp index 0656edda22..73f9a4c3ff 100644 --- a/core/fpdfapi/render/cpdf_rendercontext.cpp +++ b/core/fpdfapi/render/cpdf_rendercontext.cpp @@ -38,8 +38,8 @@ void CPDF_RenderContext::GetBackground(const RetainPtr& pBuffer, CFX_DefaultRenderDevice device; device.Attach(pBuffer, false, nullptr, false); - FX_RECT rect(0, 0, device.GetWidth(), device.GetHeight()); - device.FillRect(&rect, 0xffffffff); + device.FillRect(FX_RECT(0, 0, device.GetWidth(), device.GetHeight()), + 0xffffffff); Render(&device, pObj, pOptions, pFinalMatrix); } diff --git a/core/fxge/cfx_renderdevice.h b/core/fxge/cfx_renderdevice.h index 6c91d55140..e6c44ff35f 100644 --- a/core/fxge/cfx_renderdevice.h +++ b/core/fxge/cfx_renderdevice.h @@ -144,8 +144,8 @@ class CFX_RenderDevice { uint32_t stroke_color, int fill_mode, int blend_type); - bool FillRect(const FX_RECT* pRect, uint32_t color) { - return FillRectWithBlend(*pRect, color, FXDIB_BLEND_NORMAL); + bool FillRect(const FX_RECT& rect, uint32_t color) { + return FillRectWithBlend(rect, color, FXDIB_BLEND_NORMAL); } RetainPtr GetBackDrop(); -- cgit v1.2.3