diff options
-rw-r--r-- | canvas/source/cairo/cairo_canvas.hxx | 10 | ||||
-rw-r--r-- | canvas/source/cairo/cairo_canvasbitmap.hxx | 9 | ||||
-rw-r--r-- | canvas/source/directx/dx_canvas.hxx | 10 | ||||
-rw-r--r-- | canvas/source/directx/dx_canvasbitmap.hxx | 10 | ||||
-rw-r--r-- | canvas/source/opengl/ogl_canvasbitmap.hxx | 9 | ||||
-rw-r--r-- | canvas/source/vcl/canvas.hxx | 10 | ||||
-rw-r--r-- | canvas/source/vcl/canvasbitmap.hxx | 10 | ||||
-rw-r--r-- | include/canvas/base/bitmapcanvasbase.hxx | 69 | ||||
-rw-r--r-- | include/canvas/base/canvascustomspritebase.hxx | 4 | ||||
-rw-r--r-- | include/canvas/base/integerbitmapbase.hxx | 80 | ||||
-rw-r--r-- | include/canvas/base/spritecanvasbase.hxx | 4 |
11 files changed, 110 insertions, 115 deletions
diff --git a/canvas/source/cairo/cairo_canvas.hxx b/canvas/source/cairo/cairo_canvas.hxx index 0aa07f383618..945bf5f2b568 100644 --- a/canvas/source/cairo/cairo_canvas.hxx +++ b/canvas/source/cairo/cairo_canvas.hxx @@ -85,10 +85,12 @@ namespace cairocanvas { }; - typedef ::canvas::IntegerBitmapBase< CanvasBaseSurfaceProvider_Base, - CanvasHelper, - ::osl::MutexGuard, - ::cppu::OWeakObject > CanvasBaseT; + typedef ::canvas::IntegerBitmapBase< + canvas::BitmapCanvasBase2< + CanvasBaseSurfaceProvider_Base, + CanvasHelper, + ::osl::MutexGuard, + ::cppu::OWeakObject> > CanvasBaseT; /** Product of this component's factory. diff --git a/canvas/source/cairo/cairo_canvasbitmap.hxx b/canvas/source/cairo/cairo_canvasbitmap.hxx index fa33e20cc801..f67a955daded 100644 --- a/canvas/source/cairo/cairo_canvasbitmap.hxx +++ b/canvas/source/cairo/cairo_canvasbitmap.hxx @@ -55,10 +55,11 @@ namespace cairocanvas }; typedef ::canvas::IntegerBitmapBase< - CanvasBitmapSpriteSurface_Base, - CanvasHelper, - ::osl::MutexGuard, - ::cppu::OWeakObject > CanvasBitmap_Base; + canvas::BitmapCanvasBase2< + CanvasBitmapSpriteSurface_Base, + CanvasHelper, + ::osl::MutexGuard, + ::cppu::OWeakObject> > CanvasBitmap_Base; class CanvasBitmap : public CanvasBitmap_Base, public RepaintTarget diff --git a/canvas/source/directx/dx_canvas.hxx b/canvas/source/directx/dx_canvas.hxx index 78e63ffef1d6..cf4e7ad64377 100644 --- a/canvas/source/directx/dx_canvas.hxx +++ b/canvas/source/directx/dx_canvas.hxx @@ -115,10 +115,12 @@ namespace dxcanvas DeviceHelper, ::osl::MutexGuard, ::cppu::OWeakObject > CanvasBase2_Base; - typedef ::canvas::IntegerBitmapBase< CanvasBase2_Base, - BitmapCanvasHelper, - ::osl::MutexGuard, - ::cppu::OWeakObject > BitmapCanvasBaseT; + typedef ::canvas::IntegerBitmapBase< + canvas::BitmapCanvasBase2< + CanvasBase2_Base, + BitmapCanvasHelper, + ::osl::MutexGuard, + ::cppu::OWeakObject> > BitmapCanvasBaseT; /** Product of this component's factory. diff --git a/canvas/source/directx/dx_canvasbitmap.hxx b/canvas/source/directx/dx_canvasbitmap.hxx index a59228e35a29..bffcf1f433ca 100644 --- a/canvas/source/directx/dx_canvasbitmap.hxx +++ b/canvas/source/directx/dx_canvasbitmap.hxx @@ -51,10 +51,12 @@ namespace dxcanvas ::com::sun::star::rendering::XIntegerBitmap, ::com::sun::star::lang::XServiceInfo, ::com::sun::star::beans::XFastPropertySet > CanvasBitmapBase_Base; - typedef ::canvas::IntegerBitmapBase< ::canvas::DisambiguationHelper< CanvasBitmapBase_Base >, - BitmapCanvasHelper, - ::osl::MutexGuard, - ::cppu::OWeakObject > CanvasBitmap_Base; + typedef ::canvas::IntegerBitmapBase< + canvas::BitmapCanvasBase2< + ::canvas::DisambiguationHelper< CanvasBitmapBase_Base >, + BitmapCanvasHelper, + ::osl::MutexGuard, + ::cppu::OWeakObject> > CanvasBitmap_Base; class CanvasBitmap : public CanvasBitmap_Base, public BitmapProvider { diff --git a/canvas/source/opengl/ogl_canvasbitmap.hxx b/canvas/source/opengl/ogl_canvasbitmap.hxx index 876a7615c35d..bdb624dde38d 100644 --- a/canvas/source/opengl/ogl_canvasbitmap.hxx +++ b/canvas/source/opengl/ogl_canvasbitmap.hxx @@ -32,10 +32,11 @@ namespace oglcanvas typedef ::cppu::WeakComponentImplHelper2< ::com::sun::star::rendering::XBitmapCanvas, ::com::sun::star::rendering::XIntegerBitmap > CanvasBitmapBase_Base; typedef ::canvas::IntegerBitmapBase< - ::canvas::DisambiguationHelper< CanvasBitmapBase_Base >, - BitmapCanvasHelper, - ::osl::MutexGuard, - ::cppu::OWeakObject > CanvasBitmapBaseT; + canvas::BitmapCanvasBase2< + ::canvas::DisambiguationHelper< CanvasBitmapBase_Base >, + BitmapCanvasHelper, + ::osl::MutexGuard, + ::cppu::OWeakObject> > CanvasBitmapBaseT; class CanvasBitmap : public CanvasBitmapBaseT { diff --git a/canvas/source/vcl/canvas.hxx b/canvas/source/vcl/canvas.hxx index 0c9970631adc..95dc3295917b 100644 --- a/canvas/source/vcl/canvas.hxx +++ b/canvas/source/vcl/canvas.hxx @@ -59,10 +59,12 @@ namespace vclcanvas DeviceHelper, tools::LocalGuard, ::cppu::OWeakObject > CanvasBase_Base; - typedef ::canvas::IntegerBitmapBase< CanvasBase_Base, - CanvasHelper, - tools::LocalGuard, - ::cppu::OWeakObject > CanvasBaseT; + typedef ::canvas::IntegerBitmapBase< + canvas::BitmapCanvasBase2< + CanvasBase_Base, + CanvasHelper, + tools::LocalGuard, + ::cppu::OWeakObject> > CanvasBaseT; /** Product of this component's factory. diff --git a/canvas/source/vcl/canvasbitmap.hxx b/canvas/source/vcl/canvasbitmap.hxx index 865996c05ab0..8cf013c9d9a0 100644 --- a/canvas/source/vcl/canvasbitmap.hxx +++ b/canvas/source/vcl/canvasbitmap.hxx @@ -48,10 +48,12 @@ namespace vclcanvas ::com::sun::star::rendering::XIntegerBitmap, ::com::sun::star::lang::XServiceInfo, ::com::sun::star::beans::XFastPropertySet > CanvasBitmapBase_Base; - typedef ::canvas::IntegerBitmapBase< ::canvas::DisambiguationHelper< CanvasBitmapBase_Base >, - CanvasBitmapHelper, - tools::LocalGuard, - ::cppu::OWeakObject > CanvasBitmap_Base; + typedef ::canvas::IntegerBitmapBase< + canvas::BitmapCanvasBase2< + ::canvas::DisambiguationHelper< CanvasBitmapBase_Base >, + CanvasBitmapHelper, + tools::LocalGuard, + ::cppu::OWeakObject> > CanvasBitmap_Base; class CanvasBitmap : public CanvasBitmap_Base, public RepaintTarget diff --git a/include/canvas/base/bitmapcanvasbase.hxx b/include/canvas/base/bitmapcanvasbase.hxx index 307b78cf2078..37c38c2ad1e7 100644 --- a/include/canvas/base/bitmapcanvasbase.hxx +++ b/include/canvas/base/bitmapcanvasbase.hxx @@ -67,6 +67,41 @@ namespace canvas public: typedef CanvasBase< Base, CanvasHelper, Mutex, UnambiguousBase > BaseType; + // XBitmap + virtual ::com::sun::star::geometry::IntegerSize2D SAL_CALL getSize( ) throw (::com::sun::star::uno::RuntimeException) SAL_OVERRIDE + { + typename BaseType::MutexType aGuard( BaseType::m_aMutex ); + + return BaseType::maCanvasHelper.getSize(); + } + + virtual ::sal_Bool SAL_CALL hasAlpha( ) throw (::com::sun::star::uno::RuntimeException) SAL_OVERRIDE + { + typename BaseType::MutexType aGuard( BaseType::m_aMutex ); + + return BaseType::maCanvasHelper.hasAlpha(); + } + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap > SAL_CALL getScaledBitmap( const ::com::sun::star::geometry::RealSize2D& newSize, + sal_Bool beFast ) throw (::com::sun::star::uno::RuntimeException) SAL_OVERRIDE + { + typename BaseType::MutexType aGuard( BaseType::m_aMutex ); + + return BaseType::maCanvasHelper.getScaledBitmap( newSize, beFast ); + } + + }; + + template< class Base, + class CanvasHelper, + class Mutex=::osl::MutexGuard, + class UnambiguousBase=::com::sun::star::uno::XInterface > class BitmapCanvasBase2 : + public BitmapCanvasBase< Base, CanvasHelper, Mutex, UnambiguousBase > + { + typedef BitmapCanvasBase< Base, CanvasHelper, Mutex, UnambiguousBase > + BaseType; + + public: // XBitmapCanvas virtual void SAL_CALL copyRect( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas >& sourceCanvas, const ::com::sun::star::geometry::RealRectangle2D& sourceRect, @@ -75,19 +110,19 @@ namespace canvas const ::com::sun::star::geometry::RealRectangle2D& destRect, const ::com::sun::star::rendering::ViewState& destViewState, const ::com::sun::star::rendering::RenderState& destRenderState ) throw (::com::sun::star::lang::IllegalArgumentException, - ::com::sun::star::uno::RuntimeException) + ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE { tools::verifyArgs(sourceCanvas, sourceRect, sourceViewState, sourceRenderState, destRect, destViewState, destRenderState, BOOST_CURRENT_FUNCTION, static_cast< typename BaseType::UnambiguousBaseType* >(this)); - typename BaseType::MutexType aGuard( BaseType::m_aMutex ); + typename BaseType::BaseType::MutexType aGuard( BaseType::m_aMutex ); - BaseType::mbSurfaceDirty = true; - BaseType::maCanvasHelper.modifying(); + BaseType::BaseType::mbSurfaceDirty = true; + BaseType::BaseType::maCanvasHelper.modifying(); - BaseType::maCanvasHelper.copyRect( this, + BaseType::BaseType::maCanvasHelper.copyRect( this, sourceCanvas, sourceRect, sourceViewState, @@ -96,30 +131,6 @@ namespace canvas destViewState, destRenderState ); } - - // XBitmap - virtual ::com::sun::star::geometry::IntegerSize2D SAL_CALL getSize( ) throw (::com::sun::star::uno::RuntimeException) - { - typename BaseType::MutexType aGuard( BaseType::m_aMutex ); - - return BaseType::maCanvasHelper.getSize(); - } - - virtual ::sal_Bool SAL_CALL hasAlpha( ) throw (::com::sun::star::uno::RuntimeException) - { - typename BaseType::MutexType aGuard( BaseType::m_aMutex ); - - return BaseType::maCanvasHelper.hasAlpha(); - } - - virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap > SAL_CALL getScaledBitmap( const ::com::sun::star::geometry::RealSize2D& newSize, - sal_Bool beFast ) throw (::com::sun::star::uno::RuntimeException) - { - typename BaseType::MutexType aGuard( BaseType::m_aMutex ); - - return BaseType::maCanvasHelper.getScaledBitmap( newSize, beFast ); - } - }; } diff --git a/include/canvas/base/canvascustomspritebase.hxx b/include/canvas/base/canvascustomspritebase.hxx index b6f6ac0c6c62..b244e6424655 100644 --- a/include/canvas/base/canvascustomspritebase.hxx +++ b/include/canvas/base/canvascustomspritebase.hxx @@ -75,10 +75,10 @@ namespace canvas class CanvasHelper, class Mutex=::osl::MutexGuard, class UnambiguousBase=::com::sun::star::uno::XInterface > class CanvasCustomSpriteBase : - public IntegerBitmapBase< Base, CanvasHelper, Mutex, UnambiguousBase > + public IntegerBitmapBase< BitmapCanvasBase2<Base, CanvasHelper, Mutex, UnambiguousBase> > { public: - typedef IntegerBitmapBase< Base, CanvasHelper, Mutex, UnambiguousBase > BaseType; + typedef IntegerBitmapBase< BitmapCanvasBase2<Base, CanvasHelper, Mutex, UnambiguousBase> > BaseType; typedef SpriteHelper SpriteHelperType; CanvasCustomSpriteBase() : diff --git a/include/canvas/base/integerbitmapbase.hxx b/include/canvas/base/integerbitmapbase.hxx index ee396c2429b8..79863d69a7d5 100644 --- a/include/canvas/base/integerbitmapbase.hxx +++ b/include/canvas/base/integerbitmapbase.hxx @@ -33,53 +33,25 @@ namespace canvas implementation. @tpl Base - Base class to use, most probably one of the - WeakComponentImplHelperN templates with the appropriate - interfaces. At least XIntegerBitmap should be among them (why - else would you use this template, then?). Base class must have - an Base( const Mutex& ) constructor (like the - WeakComponentImplHelperN templates have). - - @tpl CanvasHelper - Canvas helper implementation for the backend in question - - @tpl Mutex - Lock strategy to use. Defaults to using the - OBaseMutex-provided lock. Everytime one of the methods is - entered, an object of type Mutex is created with m_aMutex as - the sole parameter, and destroyed again when the method scope - is left. - - @tpl UnambiguousBase - Optional unambiguous base class for XInterface of Base. It's - sometimes necessary to specify this parameter, e.g. if Base - derives from multiple UNO interface (were each provides its - own version of XInterface, making the conversion ambiguous) - - @see CanvasBase for further contractual requirements towards - the CanvasHelper type, and some examples. + Either BitmapCanvasBase (just XBitmap) or BitmapCanvasBase2 (XBitmap and + XBitmapCanvas). */ - template< class Base, - class CanvasHelper, - class Mutex=::osl::MutexGuard, - class UnambiguousBase=::com::sun::star::uno::XInterface > class IntegerBitmapBase : - public BitmapCanvasBase< Base, CanvasHelper, Mutex, UnambiguousBase > + template< class Base > class IntegerBitmapBase : + public Base { public: - typedef BitmapCanvasBase< Base, CanvasHelper, Mutex, UnambiguousBase > BaseType; - // XIntegerBitmap virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getData( ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, const ::com::sun::star::geometry::IntegerRectangle2D& rect ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::rendering::VolatileContentDestroyedException, ::com::sun::star::uno::RuntimeException) { tools::verifyArgs(rect, BOOST_CURRENT_FUNCTION, - static_cast< typename BaseType::UnambiguousBaseType* >(this)); - tools::verifyIndexRange(rect, BaseType::getSize() ); + static_cast< typename Base::UnambiguousBaseType* >(this)); + tools::verifyIndexRange(rect, Base::getSize() ); - typename BaseType::MutexType aGuard( BaseType::m_aMutex ); + typename Base::MutexType aGuard( Base::m_aMutex ); - return BaseType::maCanvasHelper.getData( bitmapLayout, + return Base::maCanvasHelper.getData( bitmapLayout, rect ); } @@ -89,15 +61,15 @@ namespace canvas { tools::verifyArgs(bitmapLayout, rect, BOOST_CURRENT_FUNCTION, - static_cast< typename BaseType::UnambiguousBaseType* >(this)); - tools::verifyIndexRange(rect, BaseType::getSize() ); + static_cast< typename Base::UnambiguousBaseType* >(this)); + tools::verifyIndexRange(rect, Base::getSize() ); - typename BaseType::MutexType aGuard( BaseType::m_aMutex ); + typename Base::MutexType aGuard( Base::m_aMutex ); - BaseType::mbSurfaceDirty = true; - BaseType::maCanvasHelper.modifying(); + Base::mbSurfaceDirty = true; + Base::maCanvasHelper.modifying(); - BaseType::maCanvasHelper.setData( data, bitmapLayout, rect ); + Base::maCanvasHelper.setData( data, bitmapLayout, rect ); } virtual void SAL_CALL setPixel( const ::com::sun::star::uno::Sequence< sal_Int8 >& color, @@ -106,15 +78,15 @@ namespace canvas { tools::verifyArgs(bitmapLayout, pos, BOOST_CURRENT_FUNCTION, - static_cast< typename BaseType::UnambiguousBaseType* >(this)); - tools::verifyIndexRange(pos, BaseType::getSize() ); + static_cast< typename Base::UnambiguousBaseType* >(this)); + tools::verifyIndexRange(pos, Base::getSize() ); - typename BaseType::MutexType aGuard( BaseType::m_aMutex ); + typename Base::MutexType aGuard( Base::m_aMutex ); - BaseType::mbSurfaceDirty = true; - BaseType::maCanvasHelper.modifying(); + Base::mbSurfaceDirty = true; + Base::maCanvasHelper.modifying(); - BaseType::maCanvasHelper.setPixel( color, bitmapLayout, pos ); + Base::maCanvasHelper.setPixel( color, bitmapLayout, pos ); } virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getPixel( ::com::sun::star::rendering::IntegerBitmapLayout& bitmapLayout, @@ -122,20 +94,20 @@ namespace canvas { tools::verifyArgs(pos, BOOST_CURRENT_FUNCTION, - static_cast< typename BaseType::UnambiguousBaseType* >(this)); - tools::verifyIndexRange(pos, BaseType::getSize() ); + static_cast< typename Base::UnambiguousBaseType* >(this)); + tools::verifyIndexRange(pos, Base::getSize() ); - typename BaseType::MutexType aGuard( BaseType::m_aMutex ); + typename Base::MutexType aGuard( Base::m_aMutex ); - return BaseType::maCanvasHelper.getPixel( bitmapLayout, + return Base::maCanvasHelper.getPixel( bitmapLayout, pos ); } virtual ::com::sun::star::rendering::IntegerBitmapLayout SAL_CALL getMemoryLayout( ) throw (::com::sun::star::uno::RuntimeException) { - typename BaseType::MutexType aGuard( BaseType::m_aMutex ); + typename Base::MutexType aGuard( Base::m_aMutex ); - return BaseType::maCanvasHelper.getMemoryLayout(); + return Base::maCanvasHelper.getMemoryLayout(); } }; } diff --git a/include/canvas/base/spritecanvasbase.hxx b/include/canvas/base/spritecanvasbase.hxx index f536a2383fda..60e20391fa7f 100644 --- a/include/canvas/base/spritecanvasbase.hxx +++ b/include/canvas/base/spritecanvasbase.hxx @@ -66,10 +66,10 @@ namespace canvas class CanvasHelper, class Mutex=::osl::MutexGuard, class UnambiguousBase=::com::sun::star::uno::XInterface > class SpriteCanvasBase : - public IntegerBitmapBase< Base, CanvasHelper, Mutex, UnambiguousBase > + public IntegerBitmapBase< BitmapCanvasBase<Base, CanvasHelper, Mutex, UnambiguousBase> > { public: - typedef IntegerBitmapBase< Base, CanvasHelper, Mutex, UnambiguousBase > BaseType; + typedef IntegerBitmapBase< BitmapCanvasBase<Base, CanvasHelper, Mutex, UnambiguousBase> > BaseType; typedef ::rtl::Reference< SpriteCanvasBase > Reference; SpriteCanvasBase() : |