[Libreoffice-commits] core.git: Branch 'feature/drawinglayercore' - vcl/inc vcl/source

Tomaž Vajngerl (via logerrit) logerrit at kemper.freedesktop.org
Sun Apr 19 08:46:04 UTC 2020


 vcl/inc/impgraph.hxx        |    2 
 vcl/source/gdi/impgraph.cxx |  134 ++++++++++++++++++++++----------------------
 2 files changed, 68 insertions(+), 68 deletions(-)

New commits:
commit d274d38d1267622ae8928b893936138987c4e48a
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sun Apr 19 10:45:11 2020 +0200
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sun Apr 19 10:45:11 2020 +0200

    ImpGraphic: rename maEx to maBitmapEx
    
    Change-Id: I49dd552010d008cc486c6aaf51e226cc5bf4a1cb

diff --git a/vcl/inc/impgraph.hxx b/vcl/inc/impgraph.hxx
index 8dc3e21de640..92dd0c078519 100644
--- a/vcl/inc/impgraph.hxx
+++ b/vcl/inc/impgraph.hxx
@@ -55,7 +55,7 @@ class ImpGraphic final
 private:
 
     GDIMetaFile                  maMetaFile;
-    BitmapEx                     maEx;
+    BitmapEx                     maBitmapEx;
     /// If maEx is empty, this preferred size will be set on it when it gets initialized.
     Size                         maExPrefSize;
     ImpSwapInfo                  maSwapInfo;
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index 568ab369991b..43463fd81b59 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -85,7 +85,7 @@ ImpGraphic::ImpGraphic() :
 
 ImpGraphic::ImpGraphic(const ImpGraphic& rImpGraphic)
     : maMetaFile(rImpGraphic.maMetaFile)
-    , maEx(rImpGraphic.maEx)
+    , maBitmapEx(rImpGraphic.maBitmapEx)
     , maSwapInfo(rImpGraphic.maSwapInfo)
     , mpContext(rImpGraphic.mpContext)
     , mpSwapFile(rImpGraphic.mpSwapFile)
@@ -102,13 +102,13 @@ ImpGraphic::ImpGraphic(const ImpGraphic& rImpGraphic)
     if( rImpGraphic.mpAnimation )
     {
         mpAnimation = std::make_unique<Animation>( *rImpGraphic.mpAnimation );
-        maEx = mpAnimation->GetBitmapEx();
+        maBitmapEx = mpAnimation->GetBitmapEx();
     }
 }
 
 ImpGraphic::ImpGraphic(ImpGraphic&& rImpGraphic) noexcept
     : maMetaFile(std::move(rImpGraphic.maMetaFile))
-    , maEx(std::move(rImpGraphic.maEx))
+    , maBitmapEx(std::move(rImpGraphic.maBitmapEx))
     , maSwapInfo(std::move(rImpGraphic.maSwapInfo))
     , mpAnimation(std::move(rImpGraphic.mpAnimation))
     , mpContext(std::move(rImpGraphic.mpContext))
@@ -139,7 +139,7 @@ ImpGraphic::ImpGraphic(GraphicExternalLink const & rGraphicExternalLink) :
 }
 
 ImpGraphic::ImpGraphic( const Bitmap& rBitmap ) :
-        maEx            ( rBitmap ),
+        maBitmapEx            ( rBitmap ),
         meType          ( !rBitmap.IsEmpty() ? GraphicType::Bitmap : GraphicType::NONE ),
         mnSizeBytes     ( 0 ),
         mbSwapOut       ( false ),
@@ -150,7 +150,7 @@ ImpGraphic::ImpGraphic( const Bitmap& rBitmap ) :
 }
 
 ImpGraphic::ImpGraphic( const BitmapEx& rBitmapEx ) :
-        maEx            ( rBitmapEx ),
+        maBitmapEx            ( rBitmapEx ),
         meType          ( !rBitmapEx.IsEmpty() ? GraphicType::Bitmap : GraphicType::NONE ),
         mnSizeBytes     ( 0 ),
         mbSwapOut       ( false ),
@@ -172,7 +172,7 @@ ImpGraphic::ImpGraphic(const std::shared_ptr<VectorGraphicData>& rVectorGraphicD
 }
 
 ImpGraphic::ImpGraphic( const Animation& rAnimation ) :
-        maEx            ( rAnimation.GetBitmapEx() ),
+        maBitmapEx      ( rAnimation.GetBitmapEx() ),
         mpAnimation     ( std::make_unique<Animation>( rAnimation ) ),
         meType          ( GraphicType::Bitmap ),
         mnSizeBytes     ( 0 ),
@@ -219,11 +219,11 @@ ImpGraphic& ImpGraphic::operator=( const ImpGraphic& rImpGraphic )
         if ( rImpGraphic.mpAnimation )
         {
             mpAnimation = std::make_unique<Animation>( *rImpGraphic.mpAnimation );
-            maEx = mpAnimation->GetBitmapEx();
+            maBitmapEx = mpAnimation->GetBitmapEx();
         }
         else
         {
-            maEx = rImpGraphic.maEx;
+            maBitmapEx = rImpGraphic.maBitmapEx;
         }
 
         mbSwapOut = rImpGraphic.mbSwapOut;
@@ -252,7 +252,7 @@ ImpGraphic& ImpGraphic::operator=(ImpGraphic&& rImpGraphic)
     mpContext = std::move(rImpGraphic.mpContext);
     mbDummyContext = rImpGraphic.mbDummyContext;
     mpAnimation = std::move(rImpGraphic.mpAnimation);
-    maEx = std::move(rImpGraphic.maEx);
+    maBitmapEx = std::move(rImpGraphic.maBitmapEx);
     mbSwapOut = rImpGraphic.mbSwapOut;
     mpSwapFile = std::move(rImpGraphic.mpSwapFile);
     mpGfxLink = std::move(rImpGraphic.mpGfxLink);
@@ -314,7 +314,7 @@ bool ImpGraphic::operator==( const ImpGraphic& rImpGraphic ) const
                     if( rImpGraphic.mpAnimation && ( *rImpGraphic.mpAnimation == *mpAnimation ) )
                         bRet = true;
                 }
-                else if( !rImpGraphic.mpAnimation && ( rImpGraphic.maEx == maEx ) )
+                else if( !rImpGraphic.mpAnimation && ( rImpGraphic.maBitmapEx == maBitmapEx ) )
                 {
                     bRet = true;
                 }
@@ -352,7 +352,7 @@ void ImpGraphic::ImplCreateSwapInfo()
 
 void ImpGraphic::ImplClearGraphics()
 {
-    maEx.Clear();
+    maBitmapEx.Clear();
     maMetaFile.Clear();
     mpAnimation.reset();
     mpGfxLink.reset();
@@ -448,7 +448,7 @@ bool ImpGraphic::ImplIsTransparent() const
     }
     else if (meType == GraphicType::Bitmap && !maVectorGraphicData.get())
     {
-        bRet = mpAnimation ? mpAnimation->IsTransparent() : maEx.IsTransparent();
+        bRet = mpAnimation ? mpAnimation->IsTransparent() : maBitmapEx.IsTransparent();
     }
 
     return bRet;
@@ -468,7 +468,7 @@ bool ImpGraphic::ImplIsAlpha() const
     }
     else if (meType == GraphicType::Bitmap)
     {
-        bRet = (nullptr == mpAnimation && maEx.IsAlpha());
+        bRet = (nullptr == mpAnimation && maBitmapEx.IsAlpha());
     }
 
     return bRet;
@@ -519,13 +519,13 @@ Bitmap ImpGraphic::ImplGetBitmap(const GraphicConversionParameters& rParameters)
 
     if( meType == GraphicType::Bitmap )
     {
-        if(maVectorGraphicData.get() && maEx.IsEmpty())
+        if(maVectorGraphicData.get() && maBitmapEx.IsEmpty())
         {
-            // use maEx as local buffer for rendered svg
-            const_cast< ImpGraphic* >(this)->maEx = getVectorGraphicReplacement();
+            // use maBitmapEx as local buffer for rendered svg
+            const_cast< ImpGraphic* >(this)->maBitmapEx = getVectorGraphicReplacement();
         }
 
-        const BitmapEx& rRetBmpEx = ( mpAnimation ? mpAnimation->GetBitmapEx() : maEx );
+        const BitmapEx& rRetBmpEx = ( mpAnimation ? mpAnimation->GetBitmapEx() : maBitmapEx );
 
         aRetBmp = rRetBmpEx.GetBitmap( COL_WHITE );
 
@@ -534,7 +534,7 @@ Bitmap ImpGraphic::ImplGetBitmap(const GraphicConversionParameters& rParameters)
     }
     else if( ( meType != GraphicType::Default ) && ImplIsSupportedGraphic() )
     {
-        if(maEx.IsEmpty())
+        if(maBitmapEx.IsEmpty())
         {
             // calculate size
             ScopedVclPtrInstance< VirtualDevice > aVDev;
@@ -603,12 +603,12 @@ Bitmap ImpGraphic::ImplGetBitmap(const GraphicConversionParameters& rParameters)
 
                 ImplDraw( aVDev.get(), Point(), aDrawSize );
 
-                // use maEx as local buffer for rendered metafile
-                const_cast< ImpGraphic* >(this)->maEx = aVDev->GetBitmapEx( Point(), aVDev->GetOutputSizePixel() );
+                // use maBitmapEx as local buffer for rendered metafile
+                const_cast< ImpGraphic* >(this)->maBitmapEx = aVDev->GetBitmapEx( Point(), aVDev->GetOutputSizePixel() );
             }
         }
 
-        aRetBmp = maEx.GetBitmap();
+        aRetBmp = maBitmapEx.GetBitmap();
     }
 
     if( !!aRetBmp )
@@ -628,13 +628,13 @@ BitmapEx ImpGraphic::ImplGetBitmapEx(const GraphicConversionParameters& rParamet
 
     if( meType == GraphicType::Bitmap )
     {
-        if(maVectorGraphicData.get() && maEx.IsEmpty())
+        if(maVectorGraphicData.get() && maBitmapEx.IsEmpty())
         {
-            // use maEx as local buffer for rendered svg
-            const_cast< ImpGraphic* >(this)->maEx = getVectorGraphicReplacement();
+            // use maBitmapEx as local buffer for rendered svg
+            const_cast< ImpGraphic* >(this)->maBitmapEx = getVectorGraphicReplacement();
         }
 
-        aRetBmpEx = ( mpAnimation ? mpAnimation->GetBitmapEx() : maEx );
+        aRetBmpEx = ( mpAnimation ? mpAnimation->GetBitmapEx() : maBitmapEx );
 
         if(rParameters.getSizePixel().Width() || rParameters.getSizePixel().Height())
         {
@@ -645,15 +645,15 @@ BitmapEx ImpGraphic::ImplGetBitmapEx(const GraphicConversionParameters& rParamet
     }
     else if( ( meType != GraphicType::Default ) && ImplIsSupportedGraphic() )
     {
-        if(maEx.IsEmpty())
+        if(maBitmapEx.IsEmpty())
         {
             const ImpGraphic aMonoMask( maMetaFile.GetMonochromeMtf( COL_BLACK ) );
 
-            // use maEx as local buffer for rendered metafile
-            const_cast< ImpGraphic* >(this)->maEx = BitmapEx(ImplGetBitmap(rParameters), aMonoMask.ImplGetBitmap(rParameters));
+            // use maBitmapEx as local buffer for rendered metafile
+            const_cast< ImpGraphic* >(this)->maBitmapEx = BitmapEx(ImplGetBitmap(rParameters), aMonoMask.ImplGetBitmap(rParameters));
         }
 
-        aRetBmpEx = maEx;
+        aRetBmpEx = maBitmapEx;
     }
 
     return aRetBmpEx;
@@ -673,7 +673,7 @@ Animation ImpGraphic::ImplGetAnimation() const
 const BitmapEx& ImpGraphic::ImplGetBitmapExRef() const
 {
     ensureAvailable();
-    return maEx;
+    return maBitmapEx;
 }
 
 const GDIMetaFile& ImpGraphic::ImplGetGDIMetaFile() const
@@ -715,27 +715,27 @@ const GDIMetaFile& ImpGraphic::ImplGetGDIMetaFile() const
         // survive copying (change this if not wanted)
         ImpGraphic* pThat = const_cast< ImpGraphic* >(this);
 
-        if(maVectorGraphicData.get() && !maEx)
+        if(maVectorGraphicData.get() && !maBitmapEx)
         {
-            // use maEx as local buffer for rendered svg
-            pThat->maEx = getVectorGraphicReplacement();
+            // use maBitmapEx as local buffer for rendered svg
+            pThat->maBitmapEx = getVectorGraphicReplacement();
         }
 
         // #123983# directly create a metafile with the same PrefSize and PrefMapMode
         // the bitmap has, this will be an always correct metafile
-        if(maEx.IsTransparent())
+        if(maBitmapEx.IsTransparent())
         {
-            pThat->maMetaFile.AddAction(new MetaBmpExScaleAction(Point(), maEx.GetPrefSize(), maEx));
+            pThat->maMetaFile.AddAction(new MetaBmpExScaleAction(Point(), maBitmapEx.GetPrefSize(), maBitmapEx));
         }
         else
         {
-            pThat->maMetaFile.AddAction(new MetaBmpScaleAction(Point(), maEx.GetPrefSize(), maEx.GetBitmap()));
+            pThat->maMetaFile.AddAction(new MetaBmpScaleAction(Point(), maBitmapEx.GetPrefSize(), maBitmapEx.GetBitmap()));
         }
 
         pThat->maMetaFile.Stop();
         pThat->maMetaFile.WindStart();
-        pThat->maMetaFile.SetPrefSize(maEx.GetPrefSize());
-        pThat->maMetaFile.SetPrefMapMode(maEx.GetPrefMapMode());
+        pThat->maMetaFile.SetPrefSize(maBitmapEx.GetPrefSize());
+        pThat->maMetaFile.SetPrefMapMode(maBitmapEx.GetPrefMapMode());
     }
 
     return maMetaFile;
@@ -771,11 +771,11 @@ Size ImpGraphic::ImplGetPrefSize() const
 
             case GraphicType::Bitmap:
             {
-                if(maVectorGraphicData.get() && maEx.IsEmpty())
+                if(maVectorGraphicData.get() && maBitmapEx.IsEmpty())
                 {
                     if (!maExPrefSize.getWidth() || !maExPrefSize.getHeight())
                     {
-                        // svg not yet buffered in maEx, return size derived from range
+                        // svg not yet buffered in maBitmapEx, return size derived from range
                         const basegfx::B2DRange& rRange = maVectorGraphicData->getRange();
 
                         aSize = Size(basegfx::fround(rRange.getWidth()), basegfx::fround(rRange.getHeight()));
@@ -787,11 +787,11 @@ Size ImpGraphic::ImplGetPrefSize() const
                 }
                 else
                 {
-                    aSize = maEx.GetPrefSize();
+                    aSize = maBitmapEx.GetPrefSize();
 
                     if( !aSize.Width() || !aSize.Height() )
                     {
-                        aSize = maEx.GetSizePixel();
+                        aSize = maBitmapEx.GetSizePixel();
                     }
                 }
             }
@@ -823,7 +823,7 @@ void ImpGraphic::ImplSetPrefSize( const Size& rPrefSize )
         {
             // used when importing a writer FlyFrame with SVG as graphic, added conversion
             // to allow setting the PrefSize at the BitmapEx to hold it
-            if(maVectorGraphicData.get() && maEx.IsEmpty())
+            if(maVectorGraphicData.get() && maBitmapEx.IsEmpty())
             {
                 maExPrefSize = rPrefSize;
             }
@@ -837,7 +837,7 @@ void ImpGraphic::ImplSetPrefSize( const Size& rPrefSize )
 
             if (!maExPrefSize.getWidth() || !maExPrefSize.getHeight())
             {
-                maEx.SetPrefSize( rPrefSize );
+                maBitmapEx.SetPrefSize( rPrefSize );
             }
         }
         break;
@@ -869,17 +869,17 @@ MapMode ImpGraphic::ImplGetPrefMapMode() const
 
             case GraphicType::Bitmap:
             {
-                if(maVectorGraphicData.get() && maEx.IsEmpty())
+                if(maVectorGraphicData.get() && maBitmapEx.IsEmpty())
                 {
-                    // svg not yet buffered in maEx, return default PrefMapMode
+                    // svg not yet buffered in maBitmapEx, return default PrefMapMode
                     aMapMode = MapMode(MapUnit::Map100thMM);
                 }
                 else
                 {
-                    const Size aSize( maEx.GetPrefSize() );
+                    const Size aSize( maBitmapEx.GetPrefSize() );
 
                     if ( aSize.Width() && aSize.Height() )
-                        aMapMode = maEx.GetPrefMapMode();
+                        aMapMode = maBitmapEx.GetPrefMapMode();
                 }
             }
             break;
@@ -911,7 +911,7 @@ void ImpGraphic::ImplSetPrefMapMode( const MapMode& rPrefMapMode )
             if(maVectorGraphicData.get())
             {
                 // ignore for Vector Graphic Data. If this is really used (except the grfcache)
-                // it can be extended by using maEx as buffer for getVectorGraphicReplacement()
+                // it can be extended by using maBitmapEx as buffer for getVectorGraphicReplacement()
             }
             else
             {
@@ -922,7 +922,7 @@ void ImpGraphic::ImplSetPrefMapMode( const MapMode& rPrefMapMode )
                     const_cast< BitmapEx& >(mpAnimation->GetBitmapEx()).SetPrefMapMode( rPrefMapMode );
                 }
 
-                maEx.SetPrefMapMode( rPrefMapMode );
+                maBitmapEx.SetPrefMapMode( rPrefMapMode );
             }
         }
         break;
@@ -956,7 +956,7 @@ sal_uLong ImpGraphic::ImplGetSizeBytes() const
             }
             else
             {
-                mnSizeBytes = mpAnimation ? mpAnimation->GetSizeBytes() : maEx.GetSizeBytes();
+                mnSizeBytes = mpAnimation ? mpAnimation->GetSizeBytes() : maBitmapEx.GetSizeBytes();
             }
         }
         else if( meType == GraphicType::GdiMetafile )
@@ -980,10 +980,10 @@ void ImpGraphic::ImplDraw( OutputDevice* pOutDev, const Point& rDestPt ) const
 
             case GraphicType::Bitmap:
             {
-                if(maVectorGraphicData.get() && !maEx)
+                if(maVectorGraphicData.get() && !maBitmapEx)
                 {
-                    // use maEx as local buffer for rendered svg
-                    const_cast< ImpGraphic* >(this)->maEx = getVectorGraphicReplacement();
+                    // use maBitmapEx as local buffer for rendered svg
+                    const_cast< ImpGraphic* >(this)->maBitmapEx = getVectorGraphicReplacement();
                 }
 
                 if ( mpAnimation )
@@ -992,7 +992,7 @@ void ImpGraphic::ImplDraw( OutputDevice* pOutDev, const Point& rDestPt ) const
                 }
                 else
                 {
-                    maEx.Draw( pOutDev, rDestPt );
+                    maBitmapEx.Draw( pOutDev, rDestPt );
                 }
             }
             break;
@@ -1017,10 +1017,10 @@ void ImpGraphic::ImplDraw( OutputDevice* pOutDev,
 
             case GraphicType::Bitmap:
             {
-                if(maVectorGraphicData.get() && maEx.IsEmpty())
+                if(maVectorGraphicData.get() && maBitmapEx.IsEmpty())
                 {
-                    // use maEx as local buffer for rendered svg
-                    const_cast< ImpGraphic* >(this)->maEx = getVectorGraphicReplacement();
+                    // use maBitmapEx as local buffer for rendered svg
+                    const_cast< ImpGraphic* >(this)->maBitmapEx = getVectorGraphicReplacement();
                 }
 
                 if( mpAnimation )
@@ -1029,7 +1029,7 @@ void ImpGraphic::ImplDraw( OutputDevice* pOutDev,
                 }
                 else
                 {
-                    maEx.Draw( pOutDev, rDestPt, rDestSize );
+                    maBitmapEx.Draw( pOutDev, rDestPt, rDestSize );
                 }
             }
             break;
@@ -1165,18 +1165,18 @@ bool ImpGraphic::ImplReadEmbedded( SvStream& rIStm )
     {
         if( meType == GraphicType::Bitmap )
         {
-            if(maVectorGraphicData.get() && maEx.IsEmpty())
+            if(maVectorGraphicData.get() && maBitmapEx.IsEmpty())
             {
-                // use maEx as local buffer for rendered svg
-                maEx = getVectorGraphicReplacement();
+                // use maBitmapEx as local buffer for rendered svg
+                maBitmapEx = getVectorGraphicReplacement();
             }
 
-            maEx.SetSizePixel(aSize);
+            maBitmapEx.SetSizePixel(aSize);
 
             if( aMapMode != MapMode() )
             {
-                maEx.SetPrefMapMode( aMapMode );
-                maEx.SetPrefSize( aSize );
+                maBitmapEx.SetPrefMapMode( aMapMode );
+                maBitmapEx.SetPrefSize( aSize );
             }
         }
         else
@@ -1554,7 +1554,7 @@ BitmapChecksum ImpGraphic::ImplGetChecksum() const
                 else if( mpAnimation )
                     nRet = mpAnimation->GetChecksum();
                 else
-                    nRet = maEx.GetChecksum();
+                    nRet = maBitmapEx.GetChecksum();
             }
             break;
 
@@ -1844,7 +1844,7 @@ void WriteImpGraphic(SvStream& rOStm, const ImpGraphic& rImpGraphic)
                 }
                 else
                 {
-                    WriteDIBBitmapEx(rImpGraphic.maEx, rOStm);
+                    WriteDIBBitmapEx(rImpGraphic.maBitmapEx, rOStm);
                 }
             }
             break;


More information about the Libreoffice-commits mailing list