vcl/source/outdev/textline.cxx |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

New commits:
commit e1a5bcb20e15400320f926165b6d798fa36c564e
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Tue Sep 14 20:30:58 2021 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Wed Sep 15 09:43:09 2021 +0200

    tdf#143831 fix black background appearing on spellchecking wavy lines
    
    SetBackground() doesn't fill the outputdevice automatically, Erase()
    has to be called to do that.
    
    Then the way the horrible transparency split 24bit rgb + 8bit alpha
    thing works is that the same thing has to be drawn into the 24bit
    surface and the 8bit surface with black used as the line/fill color
    in the 8bit surface.
    
    OutputDevice::SetAntialiasing only mirrors its arg to the secondary
    mpAlphaVDev if it exists, and it doesn't exist until the size is set so
    move that call down a bit (this is probably another preexisting bug
    maybe worth following up on to set that when mpAlphaVDev is created)
    
    Change-Id: I39f71def6b51d78746b41ed2e30a36dc150370bc
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122097
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/vcl/source/outdev/textline.cxx b/vcl/source/outdev/textline.cxx
index 9fd82541262f..f9153d823fe4 100644
--- a/vcl/source/outdev/textline.cxx
+++ b/vcl/source/outdev/textline.cxx
@@ -1049,10 +1049,11 @@ void OutputDevice::DrawWaveLine(const Point& rStartPos, 
const Point& rEndPos, to
             nWordLength = nWordLength < 1024 ? 1024 : nWordLength;
             ScopedVclPtrInstance< VirtualDevice > pVirtDev( *this, 
DeviceFormat::DEFAULT,
                                                            
DeviceFormat::DEFAULT );
-            pVirtDev->SetAntialiasing( AntialiasingFlags::Enable );
             pVirtDev->SetOutputSizePixel( Size( nWordLength, nWaveHeight * 2 
), false );
             pVirtDev->SetLineColor( GetLineColor() );
             pVirtDev->SetBackground( Wallpaper( COL_TRANSPARENT ) );
+            pVirtDev->Erase();
+            pVirtDev->SetAntialiasing( AntialiasingFlags::Enable );
             pVirtDev->ImplDrawWaveLineBezier( 0, 0, nWordLength, 0, 
nWaveHeight, fOrientation, nLineWidth );
             rLineCache.insert( pVirtDev->GetBitmapEx( Point( 0, 0 ), 
pVirtDev->GetOutputSize() ), GetLineColor(), nLineWidth, nWaveHeight, 
nWordLength, aWavylinebmp );
         }
@@ -1065,9 +1066,6 @@ void OutputDevice::DrawWaveLine(const Point& rStartPos, 
const Point& rEndPos, to
     }
 
     ImplDrawWaveLineBezier( nStartX, nStartY, nEndX, nEndY, nWaveHeight, 
fOrientation, nLineWidth );
-
-    if( mpAlphaVDev )
-        mpAlphaVDev->DrawWaveLine( rStartPos, rEndPos, nLineWidth );
 }
 
 void OutputDevice::ImplDrawWaveLineBezier(tools::Long nStartX, tools::Long 
nStartY, tools::Long nEndX, tools::Long nEndY, tools::Long nWaveHeight, double 
fOrientation, tools::Long nLineWidth)
@@ -1089,6 +1087,9 @@ void OutputDevice::ImplDrawWaveLineBezier(tools::Long 
nStartX, tools::Long nStar
             basegfx::deg2rad(15.0),
             bPixelSnapHairline,
             *this);
+
+    if( mpAlphaVDev )
+        mpAlphaVDev->ImplDrawWaveLineBezier(nStartX, nStartY, nEndX, nEndY, 
nWaveHeight, fOrientation, nLineWidth);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Reply via email to