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/skia/fx_skia_device.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'core/fxge/skia/fx_skia_device.cpp') diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp index 190ad9e80c..598dc480c2 100644 --- a/core/fxge/skia/fx_skia_device.cpp +++ b/core/fxge/skia/fx_skia_device.cpp @@ -1960,7 +1960,7 @@ bool CFX_SkiaDeviceDriver::DrawCosmeticLine(const CFX_PointF& ptMoveTo, return false; } -bool CFX_SkiaDeviceDriver::FillRectWithBlend(const FX_RECT* pRect, +bool CFX_SkiaDeviceDriver::FillRectWithBlend(const FX_RECT& rect, uint32_t fill_color, int blend_type) { m_pCache->FlushForDraw(); @@ -1968,11 +1968,10 @@ bool CFX_SkiaDeviceDriver::FillRectWithBlend(const FX_RECT* pRect, spaint.setAntiAlias(true); spaint.setColor(fill_color); spaint.setBlendMode(GetSkiaBlendMode(blend_type)); - SkRect rect = - SkRect::MakeLTRB(pRect->left, SkTMin(pRect->top, pRect->bottom), - pRect->right, SkTMax(pRect->bottom, pRect->top)); - DebugShowSkiaDrawRect(this, m_pCanvas, spaint, rect); - m_pCanvas->drawRect(rect, spaint); + SkRect srect = SkRect::MakeLTRB(rect.left, SkTMin(rect.top, rect.bottom), + rect.right, SkTMax(rect.bottom, rect.top)); + DebugShowSkiaDrawRect(this, m_pCanvas, spaint, srect); + m_pCanvas->drawRect(srect, spaint); return true; } -- cgit v1.2.3