[Libreoffice-commits] core.git: vcl/source
Mike Kaganski (via logerrit)
logerrit at kemper.freedesktop.org
Mon Aug 24 05:49:37 UTC 2020
vcl/source/outdev/transparent.cxx | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)
New commits:
commit 1f5ac5b08fd8c1ddadc5f38595a487db2895957e
Author: Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Mon Aug 24 07:56:46 2020 +0300
Commit: Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Mon Aug 24 07:49:02 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>
diff --git a/vcl/source/outdev/transparent.cxx b/vcl/source/outdev/transparent.cxx
index f9da8c9975da..839550c0fe1c 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