[Libreoffice-commits] core.git: include/vcl vcl/source
Miklos Vajna (via logerrit)
logerrit at kemper.freedesktop.org
Wed Oct 28 07:37:29 UTC 2020
include/vcl/filter/PDFiumLibrary.hxx | 1 +
vcl/source/filter/ipdf/pdfread.cxx | 4 ++--
vcl/source/pdf/PDFiumLibrary.cxx | 5 +++++
3 files changed, 8 insertions(+), 2 deletions(-)
New commits:
commit 2beecc277959051026d7d1303e3c3ad7922c326c
Author: Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Tue Oct 27 21:04:04 2020 +0100
Commit: Miklos Vajna <vmiklos at collabora.com>
CommitDate: Wed Oct 28 08:36:45 2020 +0100
pdfium: add an FPDFBitmap_FillRect() wrapper
Change-Id: I4201a9ead756cf814c8452ef504acd054c4fe38b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104908
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
diff --git a/include/vcl/filter/PDFiumLibrary.hxx b/include/vcl/filter/PDFiumLibrary.hxx
index 556ca44ac4fd..43cbdb2f9a12 100644
--- a/include/vcl/filter/PDFiumLibrary.hxx
+++ b/include/vcl/filter/PDFiumLibrary.hxx
@@ -74,6 +74,7 @@ public:
PDFiumBitmap(FPDF_BITMAP pBitmap);
~PDFiumBitmap();
FPDF_BITMAP getPointer() { return mpBitmap; }
+ void fillRect(int left, int top, int width, int height, sal_uInt32 nColor);
};
class VCL_DLLPUBLIC PDFiumAnnotation final
diff --git a/vcl/source/filter/ipdf/pdfread.cxx b/vcl/source/filter/ipdf/pdfread.cxx
index f9d367002f2e..3e0207e86bd5 100644
--- a/vcl/source/filter/ipdf/pdfread.cxx
+++ b/vcl/source/filter/ipdf/pdfread.cxx
@@ -178,8 +178,8 @@ size_t RenderPDFBitmaps(const void* pBuffer, int nSize, std::vector<BitmapEx>& r
// the PDF is not transparent.
bTransparent = true;
}
- const FPDF_DWORD nColor = bTransparent ? 0x00000000 : 0xFFFFFFFF;
- FPDFBitmap_FillRect(pPdfBitmap->getPointer(), 0, 0, nPageWidth, nPageHeight, nColor);
+ const sal_uInt32 nColor = bTransparent ? 0x00000000 : 0xFFFFFFFF;
+ pPdfBitmap->fillRect(0, 0, nPageWidth, nPageHeight, nColor);
FPDF_RenderPageBitmap(pPdfBitmap->getPointer(), pPdfPage->getPointer(), /*start_x=*/0,
/*start_y=*/0, nPageWidth, nPageHeight, /*rotate=*/0, /*flags=*/0);
diff --git a/vcl/source/pdf/PDFiumLibrary.cxx b/vcl/source/pdf/PDFiumLibrary.cxx
index fa5baeebb0c3..607ad7ab9d2c 100644
--- a/vcl/source/pdf/PDFiumLibrary.cxx
+++ b/vcl/source/pdf/PDFiumLibrary.cxx
@@ -498,6 +498,11 @@ PDFiumBitmap::~PDFiumBitmap()
}
}
+void PDFiumBitmap::fillRect(int left, int top, int width, int height, sal_uInt32 nColor)
+{
+ FPDFBitmap_FillRect(mpBitmap, left, top, width, height, nColor);
+}
+
PDFiumAnnotation::PDFiumAnnotation(FPDF_ANNOTATION pAnnotation)
: mpAnnotation(pAnnotation)
{
More information about the Libreoffice-commits
mailing list