From ae743c6fae4543282f8930dc78175cc510fabbb3 Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Fri, 10 Apr 2020 18:07:41 +0200 Subject: Make BitmapPrimitive2D vcl-independent as preparation to have drawinglayer module independent from vcl in the future Change-Id: Iaa01370f27b51cba5114a54f37d1ec73d0719918 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92048 Tested-by: Jenkins Reviewed-by: Armin Le Grand --- .../drawinglayer/primitive2d/bitmapprimitive2d.hxx | 31 ++++++++++++++++------ 1 file changed, 23 insertions(+), 8 deletions(-) (limited to 'include/drawinglayer') diff --git a/include/drawinglayer/primitive2d/bitmapprimitive2d.hxx b/include/drawinglayer/primitive2d/bitmapprimitive2d.hxx index d35a2699b0af..4d84a02f8e06 100644 --- a/include/drawinglayer/primitive2d/bitmapprimitive2d.hxx +++ b/include/drawinglayer/primitive2d/bitmapprimitive2d.hxx @@ -23,23 +23,37 @@ #include #include -#include #include +namespace com +{ +namespace sun +{ +namespace star +{ +namespace awt +{ +class XBitmap; +} +} +} +} + namespace drawinglayer::primitive2d { /** BitmapPrimitive2D class This class is the central primitive for Bitmap-based primitives. - It provides RGBA-based bitmaps, currently using a BitmapEx from VCL. - This may change in the future to any other, maybe more general base - class providing 24bit RGBA. + 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 RGBA Bitmap-data - BitmapEx maBitmapEx; + /// the Bitmap-data + css::uno::Reference maXBitmap; /** the object transformation from unit coordinates, defining size, shear, rotate and position @@ -48,10 +62,11 @@ private: public: /// constructor - BitmapPrimitive2D(const BitmapEx& rBitmapEx, const basegfx::B2DHomMatrix& rTransform); + BitmapPrimitive2D(const css::uno::Reference& rXBitmap, + const basegfx::B2DHomMatrix& rTransform); /// data read access - const BitmapEx& getBitmapEx() const { return maBitmapEx; } + const css::uno::Reference& getXBitmap() const { return maXBitmap; } const basegfx::B2DHomMatrix& getTransform() const { return maTransform; } /// compare operator -- cgit