LibreOffice Module canvas (master)  1
Public Member Functions | Private Attributes | List of all members
oglcanvas::SpriteDeviceHelper Class Reference

#include <ogl_spritedevicehelper.hxx>

Collaboration diagram for oglcanvas::SpriteDeviceHelper:
[legend]

Public Member Functions

 SpriteDeviceHelper ()
 
 ~SpriteDeviceHelper ()
 
 SpriteDeviceHelper (const SpriteDeviceHelper &)=delete
 make noncopyable More...
 
const SpriteDeviceHelperoperator= (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...
 
TextureCachegetTextureCache () const
 Get instance of internal texture cache. More...
 

Private Attributes

SpriteCanvasmpSpriteCanvas
 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< TextureCachempTextureCache
 
unsigned int mnLinearTwoColorGradientProgram
 
unsigned int mnLinearMultiColorGradientProgram
 
unsigned int mnRadialTwoColorGradientProgram
 
unsigned int mnRadialMultiColorGradientProgram
 
unsigned int mnRectangularTwoColorGradientProgram
 
unsigned int mnRectangularMultiColorGradientProgram
 
rtl::Reference< OpenGLContextmxContext
 

Detailed Description

Definition at line 38 of file ogl_spritedevicehelper.hxx.

Constructor & Destructor Documentation

oglcanvas::SpriteDeviceHelper::SpriteDeviceHelper ( )

Definition at line 80 of file ogl_spritedevicehelper.cxx.

References Create(), and mpSpriteCanvas.

oglcanvas::SpriteDeviceHelper::~SpriteDeviceHelper ( )

Definition at line 94 of file ogl_spritedevicehelper.cxx.

References mxContext.

oglcanvas::SpriteDeviceHelper::SpriteDeviceHelper ( const SpriteDeviceHelper )
delete

make noncopyable

Member Function Documentation

IBufferContextSharedPtr oglcanvas::SpriteDeviceHelper::createBufferContext ( const ::basegfx::B2IVector rSize) const

create a pbuffer context (for rendering into background surface)

Definition at line 547 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 
)
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 
)
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 ( )
void oglcanvas::SpriteDeviceHelper::dumpScreenContent ( ) const

called when DumpScreenContent property is enabled on XGraphicDevice, and writes out bitmaps of current screen.

Definition at line 377 of file ogl_spritedevicehelper.cxx.

References SAL_INFO.

uno::Reference< rendering::XColorSpace > oglcanvas::SpriteDeviceHelper::getColorSpace ( ) const

Definition at line 361 of file ogl_spritedevicehelper.cxx.

References canvas::tools::getStdColorSpace().

uno::Any oglcanvas::SpriteDeviceHelper::getDeviceHandle ( ) const

Definition at line 350 of file ogl_spritedevicehelper.cxx.

References mxContext.

geometry::RealSize2D oglcanvas::SpriteDeviceHelper::getPhysicalResolution ( )
geometry::RealSize2D oglcanvas::SpriteDeviceHelper::getPhysicalSize ( )
uno::Any oglcanvas::SpriteDeviceHelper::getSurfaceHandle ( ) const

Definition at line 356 of file ogl_spritedevicehelper.cxx.

TextureCache & oglcanvas::SpriteDeviceHelper::getTextureCache ( ) const

Get instance of internal texture cache.

Definition at line 552 of file ogl_spritedevicehelper.cxx.

References mpTextureCache.

void oglcanvas::SpriteDeviceHelper::hide ( const ::rtl::Reference< CanvasCustomSprite > &  xSprite)

Definition at line 387 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 345 of file ogl_spritedevicehelper.cxx.

void oglcanvas::SpriteDeviceHelper::notifySizeUpdate ( const css::awt::Rectangle &  rBounds)
const SpriteDeviceHelper& oglcanvas::SpriteDeviceHelper::operator= ( const SpriteDeviceHelper )
delete
void oglcanvas::SpriteDeviceHelper::show ( const ::rtl::Reference< CanvasCustomSprite > &  xSprite)

Definition at line 382 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 339 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 474 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 484 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 494 of file ogl_spritedevicehelper.cxx.

References mnRectangularMultiColorGradientProgram, mnRectangularTwoColorGradientProgram, and oglcanvas::setupUniforms().

Member Data Documentation

std::set< ::rtl::Reference< CanvasCustomSprite > > oglcanvas::SpriteDeviceHelper::maActiveSprites
private

Definition at line 119 of file ogl_spritedevicehelper.hxx.

Referenced by hide(), and show().

::canvas::tools::ElapsedTime oglcanvas::SpriteDeviceHelper::maLastUpdate
private

For the frame counter timings.

Definition at line 122 of file ogl_spritedevicehelper.hxx.

unsigned int oglcanvas::SpriteDeviceHelper::mnLinearMultiColorGradientProgram
private

Definition at line 127 of file ogl_spritedevicehelper.hxx.

Referenced by disposing(), and useLinearGradientShader().

unsigned int oglcanvas::SpriteDeviceHelper::mnLinearTwoColorGradientProgram
private

Definition at line 126 of file ogl_spritedevicehelper.hxx.

Referenced by disposing(), and useLinearGradientShader().

unsigned int oglcanvas::SpriteDeviceHelper::mnRadialMultiColorGradientProgram
private

Definition at line 129 of file ogl_spritedevicehelper.hxx.

Referenced by disposing(), and useRadialGradientShader().

unsigned int oglcanvas::SpriteDeviceHelper::mnRadialTwoColorGradientProgram
private

Definition at line 128 of file ogl_spritedevicehelper.hxx.

Referenced by disposing(), and useRadialGradientShader().

unsigned int oglcanvas::SpriteDeviceHelper::mnRectangularMultiColorGradientProgram
private

Definition at line 131 of file ogl_spritedevicehelper.hxx.

Referenced by disposing(), and useRectangularGradientShader().

unsigned int oglcanvas::SpriteDeviceHelper::mnRectangularTwoColorGradientProgram
private

Definition at line 130 of file ogl_spritedevicehelper.hxx.

Referenced by disposing(), and useRectangularGradientShader().

SpriteCanvas* oglcanvas::SpriteDeviceHelper::mpSpriteCanvas
private

Pointer to sprite canvas (owner of this helper), needed to create bitmaps.

Definition at line 117 of file ogl_spritedevicehelper.hxx.

Referenced by createCompatibleBezierPolyPolygon(), createCompatibleLinePolyPolygon(), and disposing().

std::shared_ptr<TextureCache> oglcanvas::SpriteDeviceHelper::mpTextureCache
private

Definition at line 124 of file ogl_spritedevicehelper.hxx.

Referenced by disposing(), and getTextureCache().

rtl::Reference<OpenGLContext> oglcanvas::SpriteDeviceHelper::mxContext
private

The documentation for this class was generated from the following files: