LibreOffice Module canvas (master) 1
|
#include <ogl_spritedevicehelper.hxx>
Public Member Functions | |
SpriteDeviceHelper () | |
~SpriteDeviceHelper () | |
SpriteDeviceHelper (const SpriteDeviceHelper &)=delete | |
make noncopyable More... | |
const SpriteDeviceHelper & | operator= (const SpriteDeviceHelper &)=delete |
void | init (vcl::Window &rWindow, SpriteCanvas &rSpriteCanvas, const css::awt::Rectangle &rViewArea) |
void | disposing () |
Dispose all internal references. More... | |
css::geometry::RealSize2D | getPhysicalResolution () |
css::geometry::RealSize2D | getPhysicalSize () |
css::uno::Reference< css::rendering::XLinePolyPolygon2D > | createCompatibleLinePolyPolygon (const css::uno::Reference< css::rendering::XGraphicDevice > &rDevice, const css::uno::Sequence< css::uno::Sequence< css::geometry::RealPoint2D > > &points) |
css::uno::Reference< css::rendering::XBezierPolyPolygon2D > | createCompatibleBezierPolyPolygon (const css::uno::Reference< css::rendering::XGraphicDevice > &rDevice, const css::uno::Sequence< css::uno::Sequence< css::geometry::RealBezierSegment2D > > &points) |
css::uno::Reference< css::rendering::XBitmap > | createCompatibleBitmap (const css::uno::Reference< css::rendering::XGraphicDevice > &rDevice, const css::geometry::IntegerSize2D &size) |
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) |
bool | showBuffer (bool bIsVisible, bool bUpdateAll) |
bool | switchBuffer (bool bIsVisible, bool bUpdateAll) |
css::uno::Any | isAccelerated () const |
css::uno::Any | getDeviceHandle () const |
css::uno::Any | getSurfaceHandle () const |
css::uno::Reference< css::rendering::XColorSpace > | getColorSpace () const |
void | notifySizeUpdate (const css::awt::Rectangle &rBounds) |
void | dumpScreenContent () const |
called when DumpScreenContent property is enabled on XGraphicDevice, and writes out bitmaps of current screen. More... | |
void | show (const ::rtl::Reference< CanvasCustomSprite > &) |
void | hide (const ::rtl::Reference< CanvasCustomSprite > &) |
void | useLinearGradientShader (const css::rendering::ARGBColor *pColors, const css::uno::Sequence< double > &rStops, const ::basegfx::B2DHomMatrix &rTexTransform) |
enable linear gradient shader "texture" with given parameters More... | |
void | useRadialGradientShader (const css::rendering::ARGBColor *pColors, const css::uno::Sequence< double > &rStops, const ::basegfx::B2DHomMatrix &rTexTransform) |
enable radial gradient shader "texture" with given parameters More... | |
void | useRectangularGradientShader (const css::rendering::ARGBColor *pColors, const css::uno::Sequence< double > &rStops, const ::basegfx::B2DHomMatrix &rTexTransform) |
enable rectangular gradient shader "texture" with given parameters More... | |
IBufferContextSharedPtr | createBufferContext (const ::basegfx::B2IVector &rSize) const |
create a pbuffer context (for rendering into background surface) More... | |
TextureCache & | getTextureCache () const |
Get instance of internal texture cache. More... | |
Private Attributes | |
SpriteCanvas * | mpSpriteCanvas |
Pointer to sprite canvas (owner of this helper), needed to create bitmaps. More... | |
std::set< ::rtl::Reference< CanvasCustomSprite > > | maActiveSprites |
::canvas::tools::ElapsedTime | maLastUpdate |
For the frame counter timings. More... | |
std::shared_ptr< TextureCache > | mpTextureCache |
unsigned int | mnLinearTwoColorGradientProgram |
unsigned int | mnLinearMultiColorGradientProgram |
unsigned int | mnRadialTwoColorGradientProgram |
unsigned int | mnRadialMultiColorGradientProgram |
unsigned int | mnRectangularTwoColorGradientProgram |
unsigned int | mnRectangularMultiColorGradientProgram |
rtl::Reference< OpenGLContext > | mxContext |
Definition at line 36 of file ogl_spritedevicehelper.hxx.
oglcanvas::SpriteDeviceHelper::SpriteDeviceHelper | ( | ) |
Definition at line 75 of file ogl_spritedevicehelper.cxx.
References Create(), make_shared(), mpSpriteCanvas, and mxContext.
oglcanvas::SpriteDeviceHelper::~SpriteDeviceHelper | ( | ) |
Definition at line 87 of file ogl_spritedevicehelper.cxx.
References mxContext.
|
delete |
make noncopyable
IBufferContextSharedPtr oglcanvas::SpriteDeviceHelper::createBufferContext | ( | const ::basegfx::B2IVector & | rSize | ) | const |
create a pbuffer context (for rendering into background surface)
Definition at line 538 of file ogl_spritedevicehelper.cxx.
css::uno::Reference< css::rendering::XBitmap > oglcanvas::SpriteDeviceHelper::createCompatibleAlphaBitmap | ( | const css::uno::Reference< css::rendering::XGraphicDevice > & | rDevice, |
const css::geometry::IntegerSize2D & | size | ||
) |
uno::Reference< rendering::XBezierPolyPolygon2D > oglcanvas::SpriteDeviceHelper::createCompatibleBezierPolyPolygon | ( | const css::uno::Reference< css::rendering::XGraphicDevice > & | rDevice, |
const css::uno::Sequence< css::uno::Sequence< css::geometry::RealBezierSegment2D > > & | points | ||
) |
Definition at line 190 of file ogl_spritedevicehelper.cxx.
References mpSpriteCanvas.
css::uno::Reference< css::rendering::XBitmap > oglcanvas::SpriteDeviceHelper::createCompatibleBitmap | ( | const css::uno::Reference< css::rendering::XGraphicDevice > & | rDevice, |
const css::geometry::IntegerSize2D & | size | ||
) |
uno::Reference< rendering::XLinePolyPolygon2D > oglcanvas::SpriteDeviceHelper::createCompatibleLinePolyPolygon | ( | const css::uno::Reference< css::rendering::XGraphicDevice > & | rDevice, |
const css::uno::Sequence< css::uno::Sequence< css::geometry::RealPoint2D > > & | points | ||
) |
Definition at line 177 of file ogl_spritedevicehelper.cxx.
References mpSpriteCanvas.
css::uno::Reference< css::rendering::XVolatileBitmap > oglcanvas::SpriteDeviceHelper::createVolatileAlphaBitmap | ( | const css::uno::Reference< css::rendering::XGraphicDevice > & | rDevice, |
const css::geometry::IntegerSize2D & | size | ||
) |
css::uno::Reference< css::rendering::XVolatileBitmap > oglcanvas::SpriteDeviceHelper::createVolatileBitmap | ( | const css::uno::Reference< css::rendering::XGraphicDevice > & | rDevice, |
const css::geometry::IntegerSize2D & | size | ||
) |
void oglcanvas::SpriteDeviceHelper::disposing | ( | ) |
Dispose all internal references.
Definition at line 130 of file ogl_spritedevicehelper.cxx.
References mnLinearMultiColorGradientProgram, mnLinearTwoColorGradientProgram, mnRadialMultiColorGradientProgram, mnRadialTwoColorGradientProgram, mnRectangularMultiColorGradientProgram, mnRectangularTwoColorGradientProgram, mpSpriteCanvas, mpTextureCache, and mxContext.
void oglcanvas::SpriteDeviceHelper::dumpScreenContent | ( | ) | const |
called when DumpScreenContent property is enabled on XGraphicDevice, and writes out bitmaps of current screen.
Definition at line 368 of file ogl_spritedevicehelper.cxx.
References SAL_INFO.
uno::Reference< rendering::XColorSpace > oglcanvas::SpriteDeviceHelper::getColorSpace | ( | ) | const |
Definition at line 352 of file ogl_spritedevicehelper.cxx.
References canvas::tools::getStdColorSpace().
uno::Any oglcanvas::SpriteDeviceHelper::getDeviceHandle | ( | ) | const |
Definition at line 340 of file ogl_spritedevicehelper.cxx.
References vcl::Window::GetOutDev(), and mxContext.
geometry::RealSize2D oglcanvas::SpriteDeviceHelper::getPhysicalResolution | ( | ) |
Definition at line 147 of file ogl_spritedevicehelper.cxx.
References canvas::tools::createInfiniteSize2D(), vcl::Window::GetMapMode(), vcl::Window::LogicToPixel(), mxContext, vcl::Window::SetMapMode(), and vcl::unotools::size2DFromSize().
geometry::RealSize2D oglcanvas::SpriteDeviceHelper::getPhysicalSize | ( | ) |
Definition at line 162 of file ogl_spritedevicehelper.cxx.
References canvas::tools::createInfiniteSize2D(), vcl::Window::GetMapMode(), vcl::Window::GetOutputSizePixel(), mxContext, vcl::Window::PixelToLogic(), vcl::Window::SetMapMode(), and vcl::unotools::size2DFromSize().
uno::Any oglcanvas::SpriteDeviceHelper::getSurfaceHandle | ( | ) | const |
Definition at line 347 of file ogl_spritedevicehelper.cxx.
TextureCache & oglcanvas::SpriteDeviceHelper::getTextureCache | ( | ) | const |
Get instance of internal texture cache.
Definition at line 543 of file ogl_spritedevicehelper.cxx.
References mpTextureCache.
void oglcanvas::SpriteDeviceHelper::hide | ( | const ::rtl::Reference< CanvasCustomSprite > & | xSprite | ) |
Definition at line 378 of file ogl_spritedevicehelper.cxx.
References maActiveSprites.
void oglcanvas::SpriteDeviceHelper::init | ( | vcl::Window & | rWindow, |
SpriteCanvas & | rSpriteCanvas, | ||
const css::awt::Rectangle & | rViewArea | ||
) |
uno::Any oglcanvas::SpriteDeviceHelper::isAccelerated | ( | ) | const |
Definition at line 335 of file ogl_spritedevicehelper.cxx.
void oglcanvas::SpriteDeviceHelper::notifySizeUpdate | ( | const css::awt::Rectangle & | rBounds | ) |
|
delete |
void oglcanvas::SpriteDeviceHelper::show | ( | const ::rtl::Reference< CanvasCustomSprite > & | xSprite | ) |
Definition at line 373 of file ogl_spritedevicehelper.cxx.
References maActiveSprites.
bool oglcanvas::SpriteDeviceHelper::showBuffer | ( | bool | bIsVisible, |
bool | bUpdateAll | ||
) |
Referenced by switchBuffer().
bool oglcanvas::SpriteDeviceHelper::switchBuffer | ( | bool | bIsVisible, |
bool | bUpdateAll | ||
) |
Definition at line 329 of file ogl_spritedevicehelper.cxx.
References showBuffer().
void oglcanvas::SpriteDeviceHelper::useLinearGradientShader | ( | const css::rendering::ARGBColor * | pColors, |
const css::uno::Sequence< double > & | rStops, | ||
const ::basegfx::B2DHomMatrix & | rTexTransform | ||
) |
enable linear gradient shader "texture" with given parameters
Definition at line 465 of file ogl_spritedevicehelper.cxx.
References mnLinearMultiColorGradientProgram, mnLinearTwoColorGradientProgram, and oglcanvas::setupUniforms().
void oglcanvas::SpriteDeviceHelper::useRadialGradientShader | ( | const css::rendering::ARGBColor * | pColors, |
const css::uno::Sequence< double > & | rStops, | ||
const ::basegfx::B2DHomMatrix & | rTexTransform | ||
) |
enable radial gradient shader "texture" with given parameters
Definition at line 475 of file ogl_spritedevicehelper.cxx.
References mnRadialMultiColorGradientProgram, mnRadialTwoColorGradientProgram, and oglcanvas::setupUniforms().
void oglcanvas::SpriteDeviceHelper::useRectangularGradientShader | ( | const css::rendering::ARGBColor * | pColors, |
const css::uno::Sequence< double > & | rStops, | ||
const ::basegfx::B2DHomMatrix & | rTexTransform | ||
) |
enable rectangular gradient shader "texture" with given parameters
Definition at line 485 of file ogl_spritedevicehelper.cxx.
References mnRectangularMultiColorGradientProgram, mnRectangularTwoColorGradientProgram, and oglcanvas::setupUniforms().
|
private |
Definition at line 117 of file ogl_spritedevicehelper.hxx.
|
private |
For the frame counter timings.
Definition at line 120 of file ogl_spritedevicehelper.hxx.
|
private |
Definition at line 125 of file ogl_spritedevicehelper.hxx.
Referenced by disposing(), and useLinearGradientShader().
|
private |
Definition at line 124 of file ogl_spritedevicehelper.hxx.
Referenced by disposing(), and useLinearGradientShader().
|
private |
Definition at line 127 of file ogl_spritedevicehelper.hxx.
Referenced by disposing(), and useRadialGradientShader().
|
private |
Definition at line 126 of file ogl_spritedevicehelper.hxx.
Referenced by disposing(), and useRadialGradientShader().
|
private |
Definition at line 129 of file ogl_spritedevicehelper.hxx.
Referenced by disposing(), and useRectangularGradientShader().
|
private |
Definition at line 128 of file ogl_spritedevicehelper.hxx.
Referenced by disposing(), and useRectangularGradientShader().
|
private |
Pointer to sprite canvas (owner of this helper), needed to create bitmaps.
Definition at line 115 of file ogl_spritedevicehelper.hxx.
Referenced by createCompatibleBezierPolyPolygon(), createCompatibleLinePolyPolygon(), and disposing().
|
private |
Definition at line 122 of file ogl_spritedevicehelper.hxx.
Referenced by disposing(), and getTextureCache().
|
private |
Definition at line 131 of file ogl_spritedevicehelper.hxx.
Referenced by disposing(), getDeviceHandle(), getPhysicalResolution(), getPhysicalSize(), and ~SpriteDeviceHelper().