Remove CFX_RenderDevice::FillRectWithBlend()
Since all of its callers pass in BlendMode::kNormal, merge it into
FillRect().
Change-Id: Ib186692a441b540942021217f0bd5c897e5e9d54
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/123834
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Tom Sepez <tsepez@google.com>
diff --git a/core/fxge/cfx_renderdevice.cpp b/core/fxge/cfx_renderdevice.cpp
index d9227ab..72c24e6 100644
--- a/core/fxge/cfx_renderdevice.cpp
+++ b/core/fxge/cfx_renderdevice.cpp
@@ -659,7 +659,7 @@
--rect_i.bottom;
}
}
- if (FillRectWithBlend(rect_i, fill_color, BlendMode::kNormal)) {
+ if (FillRect(rect_i, fill_color)) {
return true;
}
}
@@ -779,24 +779,28 @@
rect.left, rect.top, BlendMode::kNormal);
}
-bool CFX_RenderDevice::FillRectWithBlend(const FX_RECT& rect,
- uint32_t fill_color,
- BlendMode blend_type) {
- if (m_pDeviceDriver->FillRectWithBlend(rect, fill_color, blend_type))
+bool CFX_RenderDevice::FillRect(const FX_RECT& rect, uint32_t fill_color) {
+ if (m_pDeviceDriver->FillRectWithBlend(rect, fill_color,
+ BlendMode::kNormal)) {
return true;
+ }
- if (!(m_RenderCaps & FXRC_GET_BITS))
+ if (!(m_RenderCaps & FXRC_GET_BITS)) {
return false;
+ }
auto bitmap = pdfium::MakeRetain<CFX_DIBitmap>();
- if (!CreateCompatibleBitmap(bitmap, rect.Width(), rect.Height()))
+ if (!CreateCompatibleBitmap(bitmap, rect.Width(), rect.Height())) {
return false;
+ }
- if (!m_pDeviceDriver->GetDIBits(bitmap, rect.left, rect.top))
+ if (!m_pDeviceDriver->GetDIBits(bitmap, rect.left, rect.top)) {
return false;
+ }
- if (!bitmap->CompositeRect(0, 0, rect.Width(), rect.Height(), fill_color))
+ if (!bitmap->CompositeRect(0, 0, rect.Width(), rect.Height(), fill_color)) {
return false;
+ }
FX_RECT src_rect(0, 0, rect.Width(), rect.Height());
m_pDeviceDriver->SetDIBits(std::move(bitmap), /*color=*/0, src_rect,
diff --git a/core/fxge/cfx_renderdevice.h b/core/fxge/cfx_renderdevice.h
index 0f236f0..a15e9e2 100644
--- a/core/fxge/cfx_renderdevice.h
+++ b/core/fxge/cfx_renderdevice.h
@@ -82,9 +82,7 @@
uint32_t fill_color,
uint32_t stroke_color,
const CFX_FillRenderOptions& fill_options);
- bool FillRect(const FX_RECT& rect, uint32_t color) {
- return FillRectWithBlend(rect, color, BlendMode::kNormal);
- }
+ bool FillRect(const FX_RECT& rect, uint32_t color);
RetainPtr<const CFX_DIBitmap> GetBackDrop() const;
bool GetDIBits(RetainPtr<CFX_DIBitmap> bitmap, int left, int top) const;
@@ -235,9 +233,6 @@
bool aliased_path,
uint32_t fill_color,
uint8_t fill_alpha);
- bool FillRectWithBlend(const FX_RECT& rect,
- uint32_t color,
- BlendMode blend_type);
RetainPtr<CFX_DIBitmap> m_pBitmap;
int m_Width = 0;