Remove unused RenderDeviceDriverIface methods.
SetPixel() and ClearDriver() have no callers, so remove them and their
overrides.
Change-Id: Idd892770a9f357822fcbf654d2c2a7cbea910a5e
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/73610
Reviewed-by: Daniel Hosseinian <dhoss@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fxge/agg/fx_agg_driver.cpp b/core/fxge/agg/fx_agg_driver.cpp
index 1d2b025..16ba887 100644
--- a/core/fxge/agg/fx_agg_driver.cpp
+++ b/core/fxge/agg/fx_agg_driver.cpp
@@ -46,26 +46,6 @@
pdfium::clamp(pos.y, -kMaxPos, kMaxPos));
}
-void RgbByteOrderSetPixel(const RetainPtr<CFX_DIBitmap>& pBitmap,
- int x,
- int y,
- uint32_t argb) {
- if (x < 0 || x >= pBitmap->GetWidth() || y < 0 || y >= pBitmap->GetHeight())
- return;
-
- uint8_t* pos = pBitmap->GetBuffer() + y * pBitmap->GetPitch() +
- x * pBitmap->GetBPP() / 8;
- if (pBitmap->GetFormat() == FXDIB_Argb) {
- FXARGB_SETRGBORDERDIB(pos, argb);
- return;
- }
-
- int alpha = FXARGB_A(argb);
- pos[0] = (FXARGB_R(argb) * alpha + pos[0] * (255 - alpha)) / 255;
- pos[1] = (FXARGB_G(argb) * alpha + pos[1] * (255 - alpha)) / 255;
- pos[2] = (FXARGB_B(argb) * alpha + pos[2] * (255 - alpha)) / 255;
-}
-
void RgbByteOrderCompositeRect(const RetainPtr<CFX_DIBitmap>& pBitmap,
int left,
int top,
@@ -232,20 +212,6 @@
}
}
-bool DibSetPixel(const RetainPtr<CFX_DIBitmap>& pDevice,
- int x,
- int y,
- uint32_t color) {
- int alpha = FXARGB_A(color);
- if (pDevice->IsCmykImage())
- return false;
-
- pDevice->SetPixel(x, y, color);
- if (pDevice->m_pAlphaMask)
- pDevice->m_pAlphaMask->SetPixel(x, y, alpha << 24);
- return true;
-}
-
void RasterizeStroke(agg::rasterizer_scanline_aa* rasterizer,
agg::path_storage* path_data,
const CFX_Matrix* pObject2Device,
@@ -1381,38 +1347,6 @@
m_bGroupKnockout);
}
-bool CFX_AggDeviceDriver::SetPixel(int x, int y, uint32_t color) {
- if (!m_pBitmap->GetBuffer())
- return true;
-
- if (!m_pClipRgn) {
- if (!m_bRgbByteOrder)
- return DibSetPixel(m_pBitmap, x, y, color);
- RgbByteOrderSetPixel(m_pBitmap, x, y, color);
- return true;
- }
- if (!m_pClipRgn->GetBox().Contains(x, y))
- return true;
-
- if (m_pClipRgn->GetType() == CFX_ClipRgn::RectI) {
- if (!m_bRgbByteOrder)
- return DibSetPixel(m_pBitmap, x, y, color);
- RgbByteOrderSetPixel(m_pBitmap, x, y, color);
- return true;
- }
- if (m_pClipRgn->GetType() != CFX_ClipRgn::MaskF)
- return true;
-
- int new_alpha =
- FXARGB_A(color) * m_pClipRgn->GetMask()->GetScanline(y)[x] / 255;
- color = (color & 0xffffff) | (new_alpha << 24);
- if (m_bRgbByteOrder) {
- RgbByteOrderSetPixel(m_pBitmap, x, y, color);
- return true;
- }
- return DibSetPixel(m_pBitmap, x, y, color);
-}
-
bool CFX_AggDeviceDriver::FillRectWithBlend(const FX_RECT& rect,
uint32_t fill_color,
BlendMode blend_type) {
diff --git a/core/fxge/agg/fx_agg_driver.h b/core/fxge/agg/fx_agg_driver.h
index 85a5754..35acf0c 100644
--- a/core/fxge/agg/fx_agg_driver.h
+++ b/core/fxge/agg/fx_agg_driver.h
@@ -61,7 +61,6 @@
uint32_t stroke_color,
const CFX_FillRenderOptions& fill_options,
BlendMode blend_type) override;
- bool SetPixel(int x, int y, uint32_t color) override;
bool FillRectWithBlend(const FX_RECT& rect,
uint32_t fill_color,
BlendMode blend_type) override;
diff --git a/core/fxge/renderdevicedriver_iface.cpp b/core/fxge/renderdevicedriver_iface.cpp
index 569afcf..f3a0685 100644
--- a/core/fxge/renderdevicedriver_iface.cpp
+++ b/core/fxge/renderdevicedriver_iface.cpp
@@ -27,10 +27,6 @@
void RenderDeviceDriverIface::SetBaseClip(const FX_RECT& rect) {}
-bool RenderDeviceDriverIface::SetPixel(int x, int y, uint32_t color) {
- return false;
-}
-
bool RenderDeviceDriverIface::FillRectWithBlend(const FX_RECT& rect,
uint32_t fill_color,
BlendMode blend_type) {
@@ -74,8 +70,6 @@
return 0;
}
-void RenderDeviceDriverIface::ClearDriver() {}
-
bool RenderDeviceDriverIface::DrawShading(const CPDF_ShadingPattern* pPattern,
const CFX_Matrix* pMatrix,
const FX_RECT& clip_rect,
diff --git a/core/fxge/renderdevicedriver_iface.h b/core/fxge/renderdevicedriver_iface.h
index f3b4d2a..5245c43 100644
--- a/core/fxge/renderdevicedriver_iface.h
+++ b/core/fxge/renderdevicedriver_iface.h
@@ -59,7 +59,6 @@
uint32_t stroke_color,
const CFX_FillRenderOptions& fill_options,
BlendMode blend_type) = 0;
- virtual bool SetPixel(int x, int y, uint32_t color);
virtual bool FillRectWithBlend(const FX_RECT& rect,
uint32_t fill_color,
BlendMode blend_type);
@@ -105,7 +104,6 @@
uint32_t color,
const CFX_TextRenderOptions& options);
virtual int GetDriverType() const;
- virtual void ClearDriver();
virtual bool DrawShading(const CPDF_ShadingPattern* pPattern,
const CFX_Matrix* pMatrix,
const FX_RECT& clip_rect,