From 6e921467c411718793422a43fb3e3060fdeaeda9 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Thu, 5 Nov 2020 21:05:13 +0100 Subject: pdfium: add FPDFBitmap_GetBuffer/Stride wrappers Change-Id: I7013e0870868017f72a8053bfe53491504f811e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105379 Tested-by: Jenkins Reviewed-by: Miklos Vajna --- vcl/source/filter/ipdf/pdfread.cxx | 5 ++--- vcl/source/pdf/PDFiumLibrary.cxx | 7 +++++++ 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'vcl') diff --git a/vcl/source/filter/ipdf/pdfread.cxx b/vcl/source/filter/ipdf/pdfread.cxx index c027acb38777..a36eacbfd41a 100644 --- a/vcl/source/filter/ipdf/pdfread.cxx +++ b/vcl/source/filter/ipdf/pdfread.cxx @@ -189,9 +189,8 @@ size_t RenderPDFBitmaps(const void* pBuffer, int nSize, std::vector& r { BitmapScopedWriteAccess pWriteAccess(aBitmap); AlphaScopedWriteAccess pMaskAccess(aMask); - const auto pPdfBuffer - = static_cast(FPDFBitmap_GetBuffer(pPdfBitmap->getPointer())); - const int nStride = FPDFBitmap_GetStride(pPdfBitmap->getPointer()); + ConstScanline pPdfBuffer = pPdfBitmap->getBuffer(); + const int nStride = pPdfBitmap->getStride(); std::vector aScanlineAlpha(nPageWidth); for (size_t nRow = 0; nRow < nPageHeight; ++nRow) { diff --git a/vcl/source/pdf/PDFiumLibrary.cxx b/vcl/source/pdf/PDFiumLibrary.cxx index c3deee13d889..69facd1bf001 100644 --- a/vcl/source/pdf/PDFiumLibrary.cxx +++ b/vcl/source/pdf/PDFiumLibrary.cxx @@ -510,6 +510,13 @@ void PDFiumBitmap::renderPageBitmap(PDFiumPage* pPage, int nStartX, int nStartY, /*rotate=*/0, /*flags=*/0); } +ConstScanline PDFiumBitmap::getBuffer() +{ + return static_cast(FPDFBitmap_GetBuffer(mpBitmap)); +} + +int PDFiumBitmap::getStride() { return FPDFBitmap_GetStride(mpBitmap); } + PDFiumAnnotation::PDFiumAnnotation(FPDF_ANNOTATION pAnnotation) : mpAnnotation(pAnnotation) { -- cgit