summaryrefslogtreecommitdiff
path: root/core/fxge/cfx_renderdevice.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-04-10 17:55:46 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-04-10 17:55:46 +0000
commit85ba2610cf05a75b52681f381bba2da3ba37b984 (patch)
treedcf1553a49ca032eaadab986fdc12f1fcf893b59 /core/fxge/cfx_renderdevice.cpp
parent537115b5a3ceccfe8ce2ca79577b61c5ec31c432 (diff)
downloadpdfium-85ba2610cf05a75b52681f381bba2da3ba37b984.tar.xz
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 <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'core/fxge/cfx_renderdevice.cpp')
-rw-r--r--core/fxge/cfx_renderdevice.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/core/fxge/cfx_renderdevice.cpp b/core/fxge/cfx_renderdevice.cpp
index 2fd48d2c80..a479517d0e 100644
--- a/core/fxge/cfx_renderdevice.cpp
+++ b/core/fxge/cfx_renderdevice.cpp
@@ -564,7 +564,7 @@ bool CFX_RenderDevice::DrawPathWithBlend(const CFX_PathData* pPathData,
--rect_i.bottom;
}
}
- if (FillRectWithBlend(&rect_i, fill_color, blend_type))
+ if (FillRectWithBlend(rect_i, fill_color, blend_type))
return true;
}
}
@@ -664,28 +664,28 @@ bool CFX_RenderDevice::DrawFillStrokePath(const CFX_PathData* pPathData,
FXDIB_BLEND_NORMAL);
}
-bool CFX_RenderDevice::FillRectWithBlend(const FX_RECT* pRect,
+bool CFX_RenderDevice::FillRectWithBlend(const FX_RECT& rect,
uint32_t fill_color,
int blend_type) {
- if (m_pDeviceDriver->FillRectWithBlend(pRect, fill_color, blend_type))
+ if (m_pDeviceDriver->FillRectWithBlend(rect, fill_color, blend_type))
return true;
if (!(m_RenderCaps & FXRC_GET_BITS))
return false;
auto bitmap = pdfium::MakeRetain<CFX_DIBitmap>();
- if (!CreateCompatibleBitmap(bitmap, pRect->Width(), pRect->Height()))
+ if (!CreateCompatibleBitmap(bitmap, rect.Width(), rect.Height()))
return false;
- if (!m_pDeviceDriver->GetDIBits(bitmap, pRect->left, pRect->top))
+ if (!m_pDeviceDriver->GetDIBits(bitmap, rect.left, rect.top))
return false;
- if (!bitmap->CompositeRect(0, 0, pRect->Width(), pRect->Height(), fill_color,
+ if (!bitmap->CompositeRect(0, 0, rect.Width(), rect.Height(), fill_color,
0)) {
return false;
}
- FX_RECT src_rect(0, 0, pRect->Width(), pRect->Height());
- m_pDeviceDriver->SetDIBits(bitmap, 0, &src_rect, pRect->left, pRect->top,
+ FX_RECT src_rect(0, 0, rect.Width(), rect.Height());
+ m_pDeviceDriver->SetDIBits(bitmap, 0, &src_rect, rect.left, rect.top,
FXDIB_BLEND_NORMAL);
return true;
}