vcl/source/filter/png/PngImageReader.cxx |    4 ----
 1 file changed, 4 deletions(-)

New commits:
commit 750f9f2ac4f713115b07c6ab8db014ff6e3270a9
Author:     Luboš Luňák <l.lu...@collabora.com>
AuthorDate: Thu Mar 11 11:28:27 2021 +0100
Commit:     Luboš Luňák <l.lu...@collabora.com>
CommitDate: Fri Mar 12 15:35:33 2021 +0100

    do not clear bitmaps in png loader just for broken images
    
    As Tomaž pointed out, this is optimizing for a rare scenario.
    The clearing is actually a memset(), so it's not that expensive,
    but fair enough, a broken image is a broken image.
    
    Change-Id: I42e3672be8c493d22599a856534b3cb9eaec4ae2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112325
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lu...@collabora.com>

diff --git a/vcl/source/filter/png/PngImageReader.cxx 
b/vcl/source/filter/png/PngImageReader.cxx
index ad778bce6aba..a510c6704686 100644
--- a/vcl/source/filter/png/PngImageReader.cxx
+++ b/vcl/source/filter/png/PngImageReader.cxx
@@ -177,7 +177,6 @@ bool reader(SvStream& rStream, BitmapEx& rBitmapEx, bool 
bUseBitmap32)
             size_t aRowSizeBytes = png_get_rowbytes(pPng, pInfo);
 
             aBitmap = Bitmap(Size(width, height), 24);
-            aBitmap.Erase(COL_WHITE);
             {
                 pWriteAccess = BitmapScopedWriteAccess(aBitmap);
                 ScanlineFormat eFormat = pWriteAccess->GetScanlineFormat();
@@ -215,7 +214,6 @@ bool reader(SvStream& rStream, BitmapEx& rBitmapEx, bool 
bUseBitmap32)
             if (bUseBitmap32)
             {
                 aBitmap = Bitmap(Size(width, height), 32);
-                aBitmap.Erase(COL_WHITE);
                 {
                     pWriteAccess = BitmapScopedWriteAccess(aBitmap);
                     ScanlineFormat eFormat = pWriteAccess->GetScanlineFormat();
@@ -264,8 +262,6 @@ bool reader(SvStream& rStream, BitmapEx& rBitmapEx, bool 
bUseBitmap32)
             {
                 aBitmap = Bitmap(Size(width, height), 24);
                 aBitmapAlpha = AlphaMask(Size(width, height), nullptr);
-                aBitmap.Erase(COL_WHITE);
-                aBitmapAlpha.Erase(0xff); // transparent
                 {
                     pWriteAccess = BitmapScopedWriteAccess(aBitmap);
                     ScanlineFormat eFormat = pWriteAccess->GetScanlineFormat();
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to