28#include <com/sun/star/lang/NoSupportException.hpp>
49 mpSurfaceProxyManager(),
56 const awt::Rectangle& rRect,
60 const sal_Int32
w(
std::max(sal_Int32(1),sal_Int32(rRect.Width)));
61 const sal_Int32
h(
std::max(sal_Int32(1),sal_Int32(rRect.Height)));
63 rSpriteCanvas.setWindow(
64 uno::Reference<awt::XWindow2>(
66 uno::UNO_QUERY_THROW) );
69 const HWND hWnd =
reinterpret_cast<HWND
>(
pData->hWnd);
70 if( !IsWindow( hWnd ) )
71 throw lang::NoSupportException(
"Passed window has invalid system window, or canvas out-of-process!" );
82 throw lang::NoSupportException(
"Could not create DirectX device!",
83 rSpriteCanvas.getXWeak() );
112 const uno::Reference< rendering::XGraphicDevice >& ,
113 const geometry::IntegerSize2D& size )
116 return uno::Reference< rendering::XBitmap >();
119 ::basegfx::unotools::b2ISizeFromIntegerSize2D(size),
129 const uno::Reference< rendering::XGraphicDevice >& ,
130 const geometry::IntegerSize2D& )
132 return uno::Reference< rendering::XVolatileBitmap >();
136 const uno::Reference< rendering::XGraphicDevice >& ,
137 const geometry::IntegerSize2D& size )
140 return uno::Reference< rendering::XBitmap >();
143 ::basegfx::unotools::b2ISizeFromIntegerSize2D(size),
149 return uno::Reference< rendering::XBitmap >(
new CanvasBitmap(pBitmap,
getDevice()));
153 const uno::Reference< rendering::XGraphicDevice >& ,
154 const geometry::IntegerSize2D& )
156 return uno::Reference< rendering::XVolatileBitmap >();
167 SAL_WARN(
"canvas.directx",
"Not supposed to be called, handled by SpriteCanvas");
173 SAL_WARN(
"canvas.directx",
"Not supposed to be called, handled by SpriteCanvas");
179 return css::uno::Any(
true);
185 const sal_Int32
x(rBounds.X);
186 const sal_Int32
y(rBounds.Y);
187 const sal_Int32
w(
std::max(sal_Int32(1),sal_Int32(rBounds.Width)));
188 const sal_Int32
h(
std::max(sal_Int32(1),sal_Int32(rBounds.Height)));
static css::uno::Reference< css::awt::XWindow > GetInterface(vcl::Window *pWindow)
css::rendering::XGraphicDevice * getDevice() const
void disposing()
Dispose all internal references.
void init(HDC hdc, OutputDevice *pOutputDev, css::rendering::XGraphicDevice &rDevice)
Init the device helper.
Product of this component's factory.
bool switchBuffer(bool bIsVisible, bool bUpdateAll)
IDXRenderModuleSharedPtr mpRenderModule
Our encapsulation interface to DirectX.
void notifySizeUpdate(const css::awt::Rectangle &rBounds)
void init(vcl::Window &rWindow, SpriteCanvas &rSpriteCanvas, const css::awt::Rectangle &rRect, bool bFullscreen)
void disposing()
Dispose all internal references.
SpriteCanvas * mpSpriteCanvas
Pointer to sprite canvas (owner of this helper), needed to create bitmaps.
bool showBuffer(bool bIsVisible, bool bUpdateAll)
css::uno::Reference< css::rendering::XVolatileBitmap > createVolatileBitmap(const css::uno::Reference< css::rendering::XGraphicDevice > &rDevice, const css::geometry::IntegerSize2D &size)
css::uno::Reference< css::rendering::XBitmap > createCompatibleAlphaBitmap(const css::uno::Reference< css::rendering::XGraphicDevice > &rDevice, const css::geometry::IntegerSize2D &size)
css::uno::Reference< css::rendering::XVolatileBitmap > createVolatileAlphaBitmap(const css::uno::Reference< css::rendering::XGraphicDevice > &rDevice, const css::geometry::IntegerSize2D &size)
std::shared_ptr< canvas::ISurfaceProxyManager > mpSurfaceProxyManager
Instance passing out HW textures.
css::uno::Any isAccelerated() const
DXSurfaceBitmapSharedPtr mpBackBuffer
void resizeBackBuffer(const ::basegfx::B2ISize &rNewSize)
css::uno::Reference< css::rendering::XBitmap > createCompatibleBitmap(const css::uno::Reference< css::rendering::XGraphicDevice > &rDevice, const css::geometry::IntegerSize2D &size)
void dumpScreenContent() const
called when DumpScreenContent property is enabled on XGraphicDevice, and writes out bitmaps of curren...
::OutputDevice const * GetOutDev() const
virtual const SystemEnvData * GetSystemData() const
#define SAL_WARN(area, stream)
std::unique_ptr< sal_Int32[]> pData
std::shared_ptr< ISurfaceProxyManager > createSurfaceProxyManager(const std::shared_ptr< IRenderModule > &rRenderModule)
Create a surface proxy for the given render module.
std::shared_ptr< DXSurfaceBitmap > DXSurfaceBitmapSharedPtr
IDXRenderModuleSharedPtr createRenderModule(const vcl::Window &rParent)
Factory method, to create an IRenderModule instance for the given VCL window instance.
const cppcanvas::SpriteCanvasSharedPtr mpSpriteCanvas