summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-11-05 21:05:13 +0100
committerMiklos Vajna <vmiklos@collabora.com>2020-11-06 08:17:24 +0100
commit6e921467c411718793422a43fb3e3060fdeaeda9 (patch)
tree9f4c633764f93c1837befc55ee10b4f7a21876ea /vcl
parent686a032f82d0b0ecb7982b5dece75eb4b3afa762 (diff)
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 <vmiklos@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/filter/ipdf/pdfread.cxx5
-rw-r--r--vcl/source/pdf/PDFiumLibrary.cxx7
2 files changed, 9 insertions, 3 deletions
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<BitmapEx>& r
{
BitmapScopedWriteAccess pWriteAccess(aBitmap);
AlphaScopedWriteAccess pMaskAccess(aMask);
- const auto pPdfBuffer
- = static_cast<ConstScanline>(FPDFBitmap_GetBuffer(pPdfBitmap->getPointer()));
- const int nStride = FPDFBitmap_GetStride(pPdfBitmap->getPointer());
+ ConstScanline pPdfBuffer = pPdfBitmap->getBuffer();
+ const int nStride = pPdfBitmap->getStride();
std::vector<sal_uInt8> 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<ConstScanline>(FPDFBitmap_GetBuffer(mpBitmap));
+}
+
+int PDFiumBitmap::getStride() { return FPDFBitmap_GetStride(mpBitmap); }
+
PDFiumAnnotation::PDFiumAnnotation(FPDF_ANNOTATION pAnnotation)
: mpAnnotation(pAnnotation)
{