From 85ba2610cf05a75b52681f381bba2da3ba37b984 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Tue, 10 Apr 2018 17:55:46 +0000 Subject: Change FillRectWithBlend methods to take FX_RECT by const-ref. They currently take const FX_RECT*, but the pointer is never nullptr. Also add a comment to explain why FX_RECT is the way it is. It has the same layout as a win32 RECT. Change-Id: Icf0e4c3eb25fe03317590a736578e053b9dccf7a Reviewed-on: https://pdfium-review.googlesource.com/30051 Commit-Queue: Ryan Harrison Reviewed-by: Ryan Harrison --- core/fxge/win32/fx_win32_device.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'core/fxge/win32/fx_win32_device.cpp') diff --git a/core/fxge/win32/fx_win32_device.cpp b/core/fxge/win32/fx_win32_device.cpp index b857dde91b..337f9643d1 100644 --- a/core/fxge/win32/fx_win32_device.cpp +++ b/core/fxge/win32/fx_win32_device.cpp @@ -1061,7 +1061,7 @@ bool CGdiDeviceDriver::DrawPath(const CFX_PathData* pPathData, return true; } -bool CGdiDeviceDriver::FillRectWithBlend(const FX_RECT* pRect, +bool CGdiDeviceDriver::FillRectWithBlend(const FX_RECT& rect, uint32_t fill_color, int blend_type) { if (blend_type != FXDIB_BLEND_NORMAL) @@ -1077,7 +1077,8 @@ bool CGdiDeviceDriver::FillRectWithBlend(const FX_RECT* pRect, return false; HBRUSH hBrush = CreateSolidBrush(colorref); - ::FillRect(m_hDC, (RECT*)pRect, hBrush); + const RECT* pRect = reinterpret_cast(&rect); + ::FillRect(m_hDC, pRect, hBrush); DeleteObject(hBrush); return true; } -- cgit v1.2.3