13#include <com/sun/star/lang/NoSupportException.hpp>
14#include <osl/mutex.hxx>
28 const uno::Reference< uno::XComponentContext >& ) :
33 void SpriteCanvas::initialize()
36 if( !maArguments.hasElements() )
39 SAL_INFO(
"canvas.ogl",
"SpriteCanvas::initialize called" );
49 maArguments[3].getValueTypeClass() == uno::TypeClass_INTERFACE,
50 "OpenGL SpriteCanvas::initialize: wrong number of arguments, or wrong types" );
52 uno::Reference< awt::XWindow > xParentWindow;
53 maArguments[3] >>= xParentWindow;
56 throw lang::NoSupportException(
57 "Parent window not VCL window, or canvas out-of-process!",
nullptr);
60 maArguments[1] >>= aRect;
63 maDeviceHelper.init( *pParentWindow,
66 maCanvasHelper.init( *
this, maDeviceHelper );
67 maArguments.realloc(0);
70 void SpriteCanvas::disposeThis()
72 ::osl::MutexGuard aGuard(
m_aMutex );
75 SpriteCanvasBaseT::disposeThis();
80 ::osl::MutexGuard aGuard(
m_aMutex );
85 return mbIsVisible && SpriteCanvasBaseT::showBuffer( bUpdateAll );
90 ::osl::MutexGuard aGuard(
m_aMutex );
95 return mbIsVisible && SpriteCanvasBaseT::switchBuffer( bUpdateAll );
98 uno::Reference< rendering::XAnimatedSprite > SAL_CALL SpriteCanvas::createSpriteFromAnimation(
99 const uno::Reference< rendering::XAnimation >& )
101 return uno::Reference< rendering::XAnimatedSprite >();
104 uno::Reference< rendering::XAnimatedSprite > SAL_CALL SpriteCanvas::createSpriteFromBitmaps(
105 const uno::Sequence< uno::Reference< rendering::XBitmap > >& ,
108 return uno::Reference< rendering::XAnimatedSprite >();
111 uno::Reference< rendering::XCustomSprite > SAL_CALL SpriteCanvas::createCustomSprite(
112 const geometry::RealSize2D& spriteSize )
114 return uno::Reference< rendering::XCustomSprite >(
118 uno::Reference< rendering::XSprite > SAL_CALL SpriteCanvas::createClonedSprite(
119 const uno::Reference< rendering::XSprite >& )
121 return uno::Reference< rendering::XSprite >();
126 ::osl::MutexGuard aGuard(
m_aMutex );
127 return maDeviceHelper.showBuffer(mbIsVisible, bUpdateAll);
130 OUString SAL_CALL SpriteCanvas::getServiceName( )
132 return "com.sun.star.rendering.SpriteCanvas.OGL";
135 void SpriteCanvas::show( const ::rtl::Reference< CanvasCustomSprite >& xSprite )
137 ::osl::MutexGuard aGuard(
m_aMutex );
138 maDeviceHelper.show(xSprite);
141 void SpriteCanvas::hide( const ::rtl::Reference< CanvasCustomSprite >& xSprite )
143 ::osl::MutexGuard aGuard(
m_aMutex );
144 maDeviceHelper.hide(xSprite);
147 void SpriteCanvas::renderRecordedActions()
const
149 maCanvasHelper.renderRecordedActions();
155extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
157 css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any>
const& args)
163 return cppu::acquire(
p.get());
static vcl::Window * GetWindow(const css::uno::Reference< css::awt::XWindow > &rxWindow)
Product of this component's factory.
SpriteCanvas(const css::uno::Sequence< css::uno::Any > &aArguments, const css::uno::Reference< css::uno::XComponentContext > &rxContext)
#define ENSURE_ARG_OR_THROW(c, m)
Sequence< PropertyValue > aArguments
#define SAL_INFO(area, stream)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_rendering_SpriteCanvas_OGL_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &args)
static bool supportsOpenGL()