[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - vcl/source

Mike Kaganski (via logerrit) logerrit at kemper.freedesktop.org
Mon Aug 24 08:34:12 UTC 2020


 vcl/source/outdev/transparent.cxx |   14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

New commits:
commit 3e4510c06d7561b5b72146b999c8053cba3917bc
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Mon Aug 24 07:56:46 2020 +0300
Commit:     Adolfo Jayme Barrientos <fitojb at ubuntu.com>
CommitDate: Mon Aug 24 10:33:42 2020 +0200

    Don't apply transparency twice when drawing to mpAlphaVDev
    
    We pass fTransparency to mpAlphaVDev->DrawTransparent; using adjusted
    fill/line color is wrong. The correct COL_BLACK/COL_TRANSPARENT were
    already set in mpAlphaVDev when SetFillColor/SetLineColor were called
    to the virtual device.
    
    Wrong implementation from commit 9c621ee8ea41a1c53bfeca49827290826785973e.
    
    Change-Id: Ic858ede1ba793ac00f831a3960f748ad20ccb70a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101262
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
    (cherry picked from commit 1f5ac5b08fd8c1ddadc5f38595a487db2895957e)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101159
    Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>

diff --git a/vcl/source/outdev/transparent.cxx b/vcl/source/outdev/transparent.cxx
index 717e9584162a..56e4f2d039f8 100644
--- a/vcl/source/outdev/transparent.cxx
+++ b/vcl/source/outdev/transparent.cxx
@@ -248,6 +248,8 @@ void OutputDevice::DrawTransparent(
 
         // create ObjectToDevice transformation
         const basegfx::B2DHomMatrix aFullTransform(ImplGetDeviceTransformation() * rObjectTransform);
+        // TODO: this must not drop transparency for mpAlphaVDev case, but instead use premultiplied
+        // aplha... but that requires using premultiplied alpha also for already drawn data
         const double fAdjustedTransparency = mpAlphaVDev ? 0 : fTransparency;
         bool bDrawnOk(true);
 
@@ -294,20 +296,8 @@ void OutputDevice::DrawTransparent(
             }
 
             if (mpAlphaVDev)
-            {
-                const Color aFillCol(mpAlphaVDev->GetFillColor());
-                const Color aLineColor(mpAlphaVDev->GetLineColor());
-                const auto nGreyScale = static_cast<sal_uInt8>(std::round(255 * fTransparency));
-                const Color aNewColor(nGreyScale, nGreyScale, nGreyScale);
-                mpAlphaVDev->SetFillColor(aNewColor);
-                mpAlphaVDev->SetLineColor(aNewColor);
-
                 mpAlphaVDev->DrawTransparent(rObjectTransform, rB2DPolyPoly, fTransparency);
 
-                mpAlphaVDev->SetFillColor(aFillCol);
-                mpAlphaVDev->SetLineColor(aLineColor);
-            }
-
             return;
         }
     }


More information about the Libreoffice-commits mailing list