drawinglayer/source/primitive2d/bitmapprimitive2d.cxx         |   19 ++--------
 drawinglayer/source/primitive2d/controlprimitive2d.cxx        |    2 -
 drawinglayer/source/primitive2d/discretebitmapprimitive2d.cxx |    2 -
 drawinglayer/source/primitive2d/discreteshadowprimitive2d.cxx |   16 ++++----
 drawinglayer/source/primitive2d/glowprimitive2d.cxx           |    9 ++--
 drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx  |    4 +-
 drawinglayer/source/primitive2d/markerarrayprimitive2d.cxx    |    2 -
 drawinglayer/source/primitive2d/patternfillprimitive2d.cxx    |    2 -
 drawinglayer/source/primitive2d/sceneprimitive2d.cxx          |    2 -
 drawinglayer/source/primitive2d/shadowprimitive2d.cxx         |    7 +--
 drawinglayer/source/primitive2d/softedgeprimitive2d.cxx       |    7 +--
 drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx      |    4 +-
 drawinglayer/source/processor2d/hittestprocessor2d.cxx        |    2 -
 drawinglayer/source/processor2d/vclprocessor2d.cxx            |    2 -
 drawinglayer/source/tools/emfphelperdata.cxx                  |    2 -
 drawinglayer/source/tools/primitive2dxmldump.cxx              |    2 -
 drawinglayer/source/tools/wmfemfhelper.cxx                    |    2 -
 filter/source/pdf/pdfdecomposer.cxx                           |    3 -
 include/drawinglayer/primitive2d/bitmapprimitive2d.hxx        |   17 ++------
 svgio/source/svgreader/svgimagenode.cxx                       |    2 -
 svx/source/sdr/contact/viewcontactofgraphic.cxx               |    2 -
 svx/source/sdr/overlay/overlaytools.cxx                       |    2 -
 22 files changed, 45 insertions(+), 67 deletions(-)

New commits:
commit 8011b16e05c97a92efee2debb23f5eae60f1236b
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Tue Nov 15 19:12:43 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Wed Nov 16 07:57:00 2022 +0100

    Use BitmapEx in BitmapPrimitive2D
    
    we no longer need to wrap it in the framework XBitmap
    implemenation
    
    Change-Id: I0dc56ad63364e2c5a4cedd5e70d4ae7ea7eae563
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142746
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/drawinglayer/source/primitive2d/bitmapprimitive2d.cxx 
b/drawinglayer/source/primitive2d/bitmapprimitive2d.cxx
index 519ad153696b..7dc58c3fe00a 100644
--- a/drawinglayer/source/primitive2d/bitmapprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/bitmapprimitive2d.cxx
@@ -26,9 +26,8 @@ using namespace com::sun::star;
 
 namespace drawinglayer::primitive2d
 {
-BitmapPrimitive2D::BitmapPrimitive2D(css::uno::Reference<css::awt::XBitmap> 
xXBitmap,
-                                     basegfx::B2DHomMatrix aTransform)
-    : maXBitmap(std::move(xXBitmap))
+BitmapPrimitive2D::BitmapPrimitive2D(BitmapEx xXBitmap, basegfx::B2DHomMatrix 
aTransform)
+    : maBitmap(std::move(xXBitmap))
     , maTransform(std::move(aTransform))
 {
 }
@@ -39,7 +38,7 @@ bool BitmapPrimitive2D::operator==(const BasePrimitive2D& 
rPrimitive) const
     {
         const BitmapPrimitive2D& rCompare = static_cast<const 
BitmapPrimitive2D&>(rPrimitive);
 
-        return (getXBitmap() == rCompare.getXBitmap() && getTransform() == 
rCompare.getTransform());
+        return (getBitmap() == rCompare.getBitmap() && getTransform() == 
rCompare.getTransform());
     }
 
     return false;
@@ -55,19 +54,11 @@ BitmapPrimitive2D::getB2DRange(const 
geometry::ViewInformation2D& /*rViewInforma
 
 sal_Int64 BitmapPrimitive2D::estimateUsage()
 {
-    if (!getXBitmap().is())
+    if (getBitmap().IsEmpty())
     {
         return 0;
     }
-
-    uno::Reference<util::XAccounting> const xAcc(getXBitmap(), uno::UNO_QUERY);
-
-    if (!xAcc.is())
-    {
-        return 0;
-    }
-
-    return xAcc->estimateUsage();
+    return getBitmap().GetSizeBytes();
 }
 
 // provide unique ID
diff --git a/drawinglayer/source/primitive2d/controlprimitive2d.cxx 
b/drawinglayer/source/primitive2d/controlprimitive2d.cxx
index 14d4f7b69446..c776319e86f5 100644
--- a/drawinglayer/source/primitive2d/controlprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/controlprimitive2d.cxx
@@ -198,7 +198,7 @@ namespace drawinglayer::primitive2d
 
                                 // create primitive
                                 xRetval = new BitmapPrimitive2D(
-                                    VCLUnoHelper::CreateVCLXBitmap(aContent),
+                                    aContent,
                                     aBitmapTransform);
                             }
                             catch( const uno::Exception& )
diff --git a/drawinglayer/source/primitive2d/discretebitmapprimitive2d.cxx 
b/drawinglayer/source/primitive2d/discretebitmapprimitive2d.cxx
index 8a86f83204bd..7ec7040ff2a1 100644
--- a/drawinglayer/source/primitive2d/discretebitmapprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/discretebitmapprimitive2d.cxx
@@ -66,7 +66,7 @@ namespace drawinglayer::primitive2d
             // create BitmapPrimitive2D with now object-local coordinate data
             rContainer.push_back(
                 new BitmapPrimitive2D(
-                    VCLUnoHelper::CreateVCLXBitmap(getBitmapEx()),
+                    getBitmapEx(),
                     aObjectTransform));
         }
 
diff --git a/drawinglayer/source/primitive2d/discreteshadowprimitive2d.cxx 
b/drawinglayer/source/primitive2d/discreteshadowprimitive2d.cxx
index 290d9d2d7ffd..4a64da368a2f 100644
--- a/drawinglayer/source/primitive2d/discreteshadowprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/discreteshadowprimitive2d.cxx
@@ -171,7 +171,7 @@ namespace drawinglayer::primitive2d
             // TopLeft
             xRetval[0] = Primitive2DReference(
                 new BitmapPrimitive2D(
-                    
VCLUnoHelper::CreateVCLXBitmap(getDiscreteShadow().getTopLeft()),
+                    getDiscreteShadow().getTopLeft(),
                     basegfx::utils::createScaleTranslateB2DHomMatrix(
                         fBigLenX,
                         fBigLenY,
@@ -181,7 +181,7 @@ namespace drawinglayer::primitive2d
             // Top
             xRetval[1] = Primitive2DReference(
                 new BitmapPrimitive2D(
-                    
VCLUnoHelper::CreateVCLXBitmap(getDiscreteShadow().getTop()),
+                    getDiscreteShadow().getTop(),
                     basegfx::utils::createScaleTranslateB2DHomMatrix(
                         1.0 - (2.0 * (fBorderX + fSingleX)) + fSingleX,
                         fBorderY,
@@ -191,7 +191,7 @@ namespace drawinglayer::primitive2d
             // TopRight
             xRetval[2] = Primitive2DReference(
                 new BitmapPrimitive2D(
-                    
VCLUnoHelper::CreateVCLXBitmap(getDiscreteShadow().getTopRight()),
+                    getDiscreteShadow().getTopRight(),
                     basegfx::utils::createScaleTranslateB2DHomMatrix(
                         fBigLenX,
                         fBigLenY,
@@ -201,7 +201,7 @@ namespace drawinglayer::primitive2d
             // Right
             xRetval[3] = Primitive2DReference(
                 new BitmapPrimitive2D(
-                    
VCLUnoHelper::CreateVCLXBitmap(getDiscreteShadow().getRight()),
+                    getDiscreteShadow().getRight(),
                     basegfx::utils::createScaleTranslateB2DHomMatrix(
                         fBorderX,
                         1.0 - (2.0 * (fBorderY + fSingleY)) + fSingleY,
@@ -211,7 +211,7 @@ namespace drawinglayer::primitive2d
             // BottomRight
             xRetval[4] = Primitive2DReference(
                 new BitmapPrimitive2D(
-                    
VCLUnoHelper::CreateVCLXBitmap(getDiscreteShadow().getBottomRight()),
+                    getDiscreteShadow().getBottomRight(),
                     basegfx::utils::createScaleTranslateB2DHomMatrix(
                         fBigLenX,
                         fBigLenY,
@@ -221,7 +221,7 @@ namespace drawinglayer::primitive2d
             // Bottom
             xRetval[5] = Primitive2DReference(
                 new BitmapPrimitive2D(
-                    
VCLUnoHelper::CreateVCLXBitmap(getDiscreteShadow().getBottom()),
+                    getDiscreteShadow().getBottom(),
                     basegfx::utils::createScaleTranslateB2DHomMatrix(
                         1.0 - (2.0 * (fBorderX + fSingleX)) + fSingleX,
                         fBorderY,
@@ -231,7 +231,7 @@ namespace drawinglayer::primitive2d
             // BottomLeft
             xRetval[6] = Primitive2DReference(
                 new BitmapPrimitive2D(
-                    
VCLUnoHelper::CreateVCLXBitmap(getDiscreteShadow().getBottomLeft()),
+                    getDiscreteShadow().getBottomLeft(),
                     basegfx::utils::createScaleTranslateB2DHomMatrix(
                         fBigLenX,
                         fBigLenY,
@@ -241,7 +241,7 @@ namespace drawinglayer::primitive2d
             // Left
             xRetval[7] = Primitive2DReference(
                 new BitmapPrimitive2D(
-                    
VCLUnoHelper::CreateVCLXBitmap(getDiscreteShadow().getLeft()),
+                    getDiscreteShadow().getLeft(),
                     basegfx::utils::createScaleTranslateB2DHomMatrix(
                         fBorderX,
                         1.0 - (2.0 * (fBorderY + fSingleY)) + fSingleY,
diff --git a/drawinglayer/source/primitive2d/glowprimitive2d.cxx 
b/drawinglayer/source/primitive2d/glowprimitive2d.cxx
index 956a6f94eb82..47103ac9a011 100644
--- a/drawinglayer/source/primitive2d/glowprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/glowprimitive2d.cxx
@@ -225,11 +225,10 @@ void GlowPrimitive2D::create2DDecomposition(
             // Independent from discrete sizes of glow alpha creation, always
             // map and project glow result to geometry range extended by glow
             // radius, but to the eventually clipped instance (ClippedRange)
-            const primitive2d::Primitive2DReference xEmbedRefBitmap(
-                new BitmapPrimitive2D(VCLUnoHelper::CreateVCLXBitmap(result),
-                                      
basegfx::utils::createScaleTranslateB2DHomMatrix(
-                                          aClippedRange.getWidth(), 
aClippedRange.getHeight(),
-                                          aClippedRange.getMinX(), 
aClippedRange.getMinY())));
+            const primitive2d::Primitive2DReference xEmbedRefBitmap(new 
BitmapPrimitive2D(
+                result, basegfx::utils::createScaleTranslateB2DHomMatrix(
+                            aClippedRange.getWidth(), 
aClippedRange.getHeight(),
+                            aClippedRange.getMinX(), 
aClippedRange.getMinY())));
 
             rContainer = primitive2d::Primitive2DContainer{ xEmbedRefBitmap };
         }
diff --git a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx 
b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
index 223390c81e3e..344e7328a84f 100644
--- a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
+++ b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
@@ -187,7 +187,7 @@ namespace drawinglayer::primitive2d
 
                 return Primitive2DReference(
                     new BitmapPrimitive2D(
-                        VCLUnoHelper::CreateVCLXBitmap(bitmap),
+                        bitmap,
                         getTransform()));
             }
 
@@ -526,7 +526,7 @@ namespace drawinglayer::primitive2d
                     {
                         aRetval.resize(1);
                         aRetval[0] = new BitmapPrimitive2D(
-                            
VCLUnoHelper::CreateVCLXBitmap(rGraphic.GetBitmapEx()),
+                            rGraphic.GetBitmapEx(),
                             rTransform);
                     }
 
diff --git a/drawinglayer/source/primitive2d/markerarrayprimitive2d.cxx 
b/drawinglayer/source/primitive2d/markerarrayprimitive2d.cxx
index cdaa15e53322..62d1cd5c26ca 100644
--- a/drawinglayer/source/primitive2d/markerarrayprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/markerarrayprimitive2d.cxx
@@ -63,7 +63,7 @@ namespace drawinglayer::primitive2d
 
                 rContainer.push_back(
                     new BitmapPrimitive2D(
-                        VCLUnoHelper::CreateVCLXBitmap(getMarker()),
+                        getMarker(),
                         aTransform));
             }
         }
diff --git a/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx 
b/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx
index ed1789be0924..2021fc28360d 100644
--- a/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx
@@ -148,7 +148,7 @@ namespace drawinglayer::primitive2d
                     {
                         const primitive2d::Primitive2DReference 
xEmbedRefBitmap(
                             new primitive2d::BitmapPrimitive2D(
-                                VCLUnoHelper::CreateVCLXBitmap(aBitmapEx),
+                                aBitmapEx,
                                 basegfx::B2DHomMatrix()));
                         aContent = primitive2d::Primitive2DContainer { 
xEmbedRefBitmap };
                     }
diff --git a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx 
b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
index 95c43ddbb8bc..76504eb8e8fe 100644
--- a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
@@ -472,7 +472,7 @@ namespace drawinglayer::primitive2d
             // create bitmap primitive and add
             rContainer.push_back(
                 new BitmapPrimitive2D(
-                    VCLUnoHelper::CreateVCLXBitmap(maOldRenderedBitmap),
+                    maOldRenderedBitmap,
                     aNew2DTransform));
 
             // test: Allow to add an outline in the debugger when tests are 
needed
diff --git a/drawinglayer/source/primitive2d/shadowprimitive2d.cxx 
b/drawinglayer/source/primitive2d/shadowprimitive2d.cxx
index 67188d8358af..8fb2a312266b 100644
--- a/drawinglayer/source/primitive2d/shadowprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/shadowprimitive2d.cxx
@@ -273,10 +273,9 @@ void ShadowPrimitive2D::create2DDecomposition(
     // map and project blur result to geometry range extended by blur
     // radius, but to the eventually clipped instance (ClippedRange)
     const primitive2d::Primitive2DReference xEmbedRefBitmap(
-        new BitmapPrimitive2D(VCLUnoHelper::CreateVCLXBitmap(result),
-                              basegfx::utils::createScaleTranslateB2DHomMatrix(
-                                  aClippedRange.getWidth(), 
aClippedRange.getHeight(),
-                                  aClippedRange.getMinX(), 
aClippedRange.getMinY())));
+        new BitmapPrimitive2D(result, 
basegfx::utils::createScaleTranslateB2DHomMatrix(
+                                          aClippedRange.getWidth(), 
aClippedRange.getHeight(),
+                                          aClippedRange.getMinX(), 
aClippedRange.getMinY())));
 
     rContainer = primitive2d::Primitive2DContainer{ xEmbedRefBitmap };
 }
diff --git a/drawinglayer/source/primitive2d/softedgeprimitive2d.cxx 
b/drawinglayer/source/primitive2d/softedgeprimitive2d.cxx
index f01b6759c7f2..e4cbb0d58a4f 100644
--- a/drawinglayer/source/primitive2d/softedgeprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/softedgeprimitive2d.cxx
@@ -216,10 +216,9 @@ void SoftEdgePrimitive2D::create2DDecomposition(
         // map and project soft result to geometry range extended by soft
         // radius, but to the eventually clipped instance (ClippedRange)
         const primitive2d::Primitive2DReference xEmbedRefBitmap(
-            new BitmapPrimitive2D(VCLUnoHelper::CreateVCLXBitmap(result),
-                                  
basegfx::utils::createScaleTranslateB2DHomMatrix(
-                                      aClippedRange.getWidth(), 
aClippedRange.getHeight(),
-                                      aClippedRange.getMinX(), 
aClippedRange.getMinY())));
+            new BitmapPrimitive2D(result, 
basegfx::utils::createScaleTranslateB2DHomMatrix(
+                                              aClippedRange.getWidth(), 
aClippedRange.getHeight(),
+                                              aClippedRange.getMinX(), 
aClippedRange.getMinY())));
 
         rContainer = primitive2d::Primitive2DContainer{ xEmbedRefBitmap };
 
diff --git a/drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx 
b/drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx
index 4bc7211ae45c..1211e21c718f 100644
--- a/drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx
@@ -54,7 +54,7 @@ namespace drawinglayer::primitive2d
 
                         Primitive2DReference xReference(
                             new BitmapPrimitive2D(
-                                VCLUnoHelper::CreateVCLXBitmap(getBitmapEx()),
+                                getBitmapEx(),
                                 aObjectTransform));
 
                         aRetval = xReference;
@@ -153,7 +153,7 @@ namespace drawinglayer::primitive2d
 
                             Primitive2DReference xReference(
                                 new BitmapPrimitive2D(
-                                    
VCLUnoHelper::CreateVCLXBitmap(getBitmapEx()),
+                                    getBitmapEx(),
                                     aObjectTransform));
                             aRetval = xReference;
 
diff --git a/drawinglayer/source/processor2d/hittestprocessor2d.cxx 
b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
index 1ebc8d541619..9af3504a5113 100644
--- a/drawinglayer/source/processor2d/hittestprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
@@ -428,7 +428,7 @@ namespace drawinglayer::processor2d
                         if(!aRange.isEmpty())
                         {
                             const primitive2d::BitmapPrimitive2D& 
rBitmapCandidate(static_cast< const primitive2d::BitmapPrimitive2D& 
>(rCandidate));
-                            const BitmapEx 
aBitmapEx(VCLUnoHelper::GetBitmap(rBitmapCandidate.getXBitmap()));
+                            const BitmapEx 
aBitmapEx(rBitmapCandidate.getBitmap());
                             const Size& rSizePixel(aBitmapEx.GetSizePixel());
 
                             // When tiled rendering, don't bother with the 
pixel size of the candidate.
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx 
b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index 77c35caa1e27..07f9868a798c 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -423,7 +423,7 @@ void VclProcessor2D::RenderPolygonHairlinePrimitive2D(
 // direct draw of transformed BitmapEx primitive
 void VclProcessor2D::RenderBitmapPrimitive2D(const 
primitive2d::BitmapPrimitive2D& rBitmapCandidate)
 {
-    BitmapEx aBitmapEx(VCLUnoHelper::GetBitmap(rBitmapCandidate.getXBitmap()));
+    BitmapEx aBitmapEx(rBitmapCandidate.getBitmap());
     const basegfx::B2DHomMatrix aLocalTransform(maCurrentTransformation
                                                 * 
rBitmapCandidate.getTransform());
 
diff --git a/drawinglayer/source/tools/emfphelperdata.cxx 
b/drawinglayer/source/tools/emfphelperdata.cxx
index 91f07d88d765..b8a3abb2bac1 100644
--- a/drawinglayer/source/tools/emfphelperdata.cxx
+++ b/drawinglayer/source/tools/emfphelperdata.cxx
@@ -1539,7 +1539,7 @@ namespace emfplushelper
                                 {
                                     mrTargetHolders.Current().append(
                                         new 
drawinglayer::primitive2d::BitmapPrimitive2D(
-                                            
VCLUnoHelper::CreateVCLXBitmap(aBmp), aTransformMatrix));
+                                            aBmp, aTransformMatrix));
                                 }
                                 else
                                     SAL_WARN("drawinglayer.emf", "EMF+\t 
warning: empty bitmap");
diff --git a/drawinglayer/source/tools/primitive2dxmldump.cxx 
b/drawinglayer/source/tools/primitive2dxmldump.cxx
index 63562973d6ca..176b1384dd86 100644
--- a/drawinglayer/source/tools/primitive2dxmldump.cxx
+++ b/drawinglayer/source/tools/primitive2dxmldump.cxx
@@ -664,7 +664,7 @@ void Primitive2dXmlDump::decomposeAndWrite(
                 rWriter.startElement("bitmap");
                 writeMatrix(rWriter, rBitmapPrimitive2D.getTransform());
 
-                const BitmapEx 
aBitmapEx(VCLUnoHelper::GetBitmap(rBitmapPrimitive2D.getXBitmap()));
+                const BitmapEx aBitmapEx(rBitmapPrimitive2D.getBitmap());
                 const Size& rSizePixel(aBitmapEx.GetSizePixel());
 
                 rWriter.attribute("height", rSizePixel.getHeight());
diff --git a/drawinglayer/source/tools/wmfemfhelper.cxx 
b/drawinglayer/source/tools/wmfemfhelper.cxx
index 4ec6863eecea..7b1f83b43195 100644
--- a/drawinglayer/source/tools/wmfemfhelper.cxx
+++ b/drawinglayer/source/tools/wmfemfhelper.cxx
@@ -626,7 +626,7 @@ namespace wmfemfhelper
 
         rTarget.append(
             new drawinglayer::primitive2d::BitmapPrimitive2D(
-                VCLUnoHelper::CreateVCLXBitmap(rBitmapEx),
+                rBitmapEx,
                 aObjectTransform));
     }
 
diff --git a/filter/source/pdf/pdfdecomposer.cxx 
b/filter/source/pdf/pdfdecomposer.cxx
index 7a032bf3688a..c1a02c776262 100644
--- a/filter/source/pdf/pdfdecomposer.cxx
+++ b/filter/source/pdf/pdfdecomposer.cxx
@@ -91,8 +91,7 @@ XPdfDecomposer::getDecomposition(const 
uno::Reference<util::XBinaryDataContainer
 
     // create primitive
     return drawinglayer::primitive2d::Primitive2DContainer{
-        new drawinglayer::primitive2d::BitmapPrimitive2D(
-            VCLUnoHelper::CreateVCLXBitmap(aReplacement), aBitmapTransform)
+        new drawinglayer::primitive2d::BitmapPrimitive2D(aReplacement, 
aBitmapTransform)
     }
         .toSequence();
 }
diff --git a/include/drawinglayer/primitive2d/bitmapprimitive2d.hxx 
b/include/drawinglayer/primitive2d/bitmapprimitive2d.hxx
index 40d4d5e541bc..79ddb8b60979 100644
--- a/include/drawinglayer/primitive2d/bitmapprimitive2d.hxx
+++ b/include/drawinglayer/primitive2d/bitmapprimitive2d.hxx
@@ -23,27 +23,19 @@
 
 #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
 #include <basegfx/matrix/b2dhommatrix.hxx>
-
-namespace com::sun::star::awt
-{
-class XBitmap;
-}
+#include <vcl/bitmapex.hxx>
 
 namespace drawinglayer::primitive2d
 {
 /** BitmapPrimitive2D class
 
     This class is the central primitive for Bitmap-based primitives.
-    To keep it independent of Bitmap implementations, use UNO API
-    XBitmap object as wrapper due to formally used class Bitmap being
-    vcl-dependent and requiring linking against it. Use VCLUnoHelper
-    to convert awt::XBitmap <-> Bitmap
  */
 class DRAWINGLAYER_DLLPUBLIC BitmapPrimitive2D final : public BasePrimitive2D
 {
 private:
     /// the Bitmap-data
-    css::uno::Reference<css::awt::XBitmap> maXBitmap;
+    BitmapEx maBitmap;
 
     /** the object transformation from unit coordinates, defining
         size, shear, rotate and position
@@ -52,11 +44,10 @@ private:
 
 public:
     /// constructor
-    BitmapPrimitive2D(css::uno::Reference<css::awt::XBitmap> xXBitmap,
-                      basegfx::B2DHomMatrix aTransform);
+    BitmapPrimitive2D(BitmapEx xBitmap, basegfx::B2DHomMatrix aTransform);
 
     /// data read access
-    const css::uno::Reference<css::awt::XBitmap>& getXBitmap() const { return 
maXBitmap; }
+    const BitmapEx& getBitmap() const { return maBitmap; }
     const basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
 
     /// compare operator
diff --git a/svgio/source/svgreader/svgimagenode.cxx 
b/svgio/source/svgreader/svgimagenode.cxx
index d439c45ede9b..ed7b81cef61a 100644
--- a/svgio/source/svgreader/svgimagenode.cxx
+++ b/svgio/source/svgreader/svgimagenode.cxx
@@ -301,7 +301,7 @@ namespace svgio::svgreader
                 // as transformation to map the picture data correctly
                 aNewTarget.resize(1);
                 aNewTarget[0] = new 
drawinglayer::primitive2d::BitmapPrimitive2D(
-                    VCLUnoHelper::CreateVCLXBitmap(aBitmapEx),
+                    aBitmapEx,
                     basegfx::utils::createScaleTranslateB2DHomMatrix(
                         aViewBox.getRange(),
                         aViewBox.getMinimum()));
diff --git a/svx/source/sdr/contact/viewcontactofgraphic.cxx 
b/svx/source/sdr/contact/viewcontactofgraphic.cxx
index 5c458be3b2ec..0889f6c7f0ce 100644
--- a/svx/source/sdr/contact/viewcontactofgraphic.cxx
+++ b/svx/source/sdr/contact/viewcontactofgraphic.cxx
@@ -212,7 +212,7 @@ namespace sdr::contact
                     xRetval.push_back(
                         drawinglayer::primitive2d::Primitive2DReference(
                             new drawinglayer::primitive2d::BitmapPrimitive2D(
-                                VCLUnoHelper::CreateVCLXBitmap(aDraftBitmap),
+                                aDraftBitmap,
                                 aBitmapMatrix)));
 
                     // consume bitmap size in X
diff --git a/svx/source/sdr/overlay/overlaytools.cxx 
b/svx/source/sdr/overlay/overlaytools.cxx
index 1ffaff464ce3..709a3d5e0085 100644
--- a/svx/source/sdr/overlay/overlaytools.cxx
+++ b/svx/source/sdr/overlay/overlaytools.cxx
@@ -184,7 +184,7 @@ sal_uInt32 
OverlayStaticRectanglePrimitive::getPrimitive2DID() const
 
             rContainer.push_back(
                 new BitmapPrimitive2D(
-                    VCLUnoHelper::CreateVCLXBitmap(getBitmapEx()),
+                    getBitmapEx(),
                     aTransform));
         }
 

Reply via email to