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 36 of file ogl_spritedevicehelper.hxx.

Constructor & Destructor Documentation

◆ SpriteDeviceHelper() [1/2]

oglcanvas::SpriteDeviceHelper::SpriteDeviceHelper ( )

Definition at line 75 of file ogl_spritedevicehelper.cxx.

References Create(), make_shared(), mpSpriteCanvas, and mxContext.

◆ ~SpriteDeviceHelper()

oglcanvas::SpriteDeviceHelper::~SpriteDeviceHelper ( )

Definition at line 87 of file ogl_spritedevicehelper.cxx.

References mxContext.

◆ SpriteDeviceHelper() [2/2]

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

make noncopyable

Member Function Documentation

◆ createBufferContext()

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.

◆ createCompatibleAlphaBitmap()

css::uno::Reference< css::rendering::XBitmap > oglcanvas::SpriteDeviceHelper::createCompatibleAlphaBitmap ( const css::uno::Reference< css::rendering::XGraphicDevice > &  rDevice,
const css::geometry::IntegerSize2D &  size 
)

◆ createCompatibleBezierPolyPolygon()

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.

◆ createCompatibleBitmap()

css::uno::Reference< css::rendering::XBitmap > oglcanvas::SpriteDeviceHelper::createCompatibleBitmap ( const css::uno::Reference< css::rendering::XGraphicDevice > &  rDevice,
const css::geometry::IntegerSize2D &  size 
)

◆ createCompatibleLinePolyPolygon()

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.

◆ createVolatileAlphaBitmap()

css::uno::Reference< css::rendering::XVolatileBitmap > oglcanvas::SpriteDeviceHelper::createVolatileAlphaBitmap ( const css::uno::Reference< css::rendering::XGraphicDevice > &  rDevice,
const css::geometry::IntegerSize2D &  size 
)

◆ createVolatileBitmap()

css::uno::Reference< css::rendering::XVolatileBitmap > oglcanvas::SpriteDeviceHelper::createVolatileBitmap ( const css::uno::Reference< css::rendering::XGraphicDevice > &  rDevice,
const css::geometry::IntegerSize2D &  size 
)

◆ disposing()

void oglcanvas::SpriteDeviceHelper::disposing ( )

◆ dumpScreenContent()

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.

◆ getColorSpace()

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

Definition at line 352 of file ogl_spritedevicehelper.cxx.

References canvas::tools::getStdColorSpace().

◆ getDeviceHandle()

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

Definition at line 340 of file ogl_spritedevicehelper.cxx.

References vcl::Window::GetOutDev(), and mxContext.

◆ getPhysicalResolution()

geometry::RealSize2D oglcanvas::SpriteDeviceHelper::getPhysicalResolution ( )

◆ getPhysicalSize()

geometry::RealSize2D oglcanvas::SpriteDeviceHelper::getPhysicalSize ( )

◆ getSurfaceHandle()

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

Definition at line 347 of file ogl_spritedevicehelper.cxx.

◆ getTextureCache()

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

Get instance of internal texture cache.

Definition at line 543 of file ogl_spritedevicehelper.cxx.

References mpTextureCache.

◆ hide()

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

Definition at line 378 of file ogl_spritedevicehelper.cxx.

References maActiveSprites.

◆ init()

void oglcanvas::SpriteDeviceHelper::init ( vcl::Window rWindow,
SpriteCanvas rSpriteCanvas,
const css::awt::Rectangle &  rViewArea 
)

◆ isAccelerated()

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

Definition at line 335 of file ogl_spritedevicehelper.cxx.

◆ notifySizeUpdate()

void oglcanvas::SpriteDeviceHelper::notifySizeUpdate ( const css::awt::Rectangle &  rBounds)

◆ operator=()

const SpriteDeviceHelper & oglcanvas::SpriteDeviceHelper::operator= ( const SpriteDeviceHelper )
delete

◆ show()

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

Definition at line 373 of file ogl_spritedevicehelper.cxx.

References maActiveSprites.

◆ showBuffer()

bool oglcanvas::SpriteDeviceHelper::showBuffer ( bool  bIsVisible,
bool  bUpdateAll 
)

Referenced by switchBuffer().

◆ switchBuffer()

bool oglcanvas::SpriteDeviceHelper::switchBuffer ( bool  bIsVisible,
bool  bUpdateAll 
)

Definition at line 329 of file ogl_spritedevicehelper.cxx.

References showBuffer().

◆ useLinearGradientShader()

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().

◆ useRadialGradientShader()

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().

◆ useRectangularGradientShader()

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().

Member Data Documentation

◆ maActiveSprites

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

Definition at line 117 of file ogl_spritedevicehelper.hxx.

Referenced by hide(), and show().

◆ maLastUpdate

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

For the frame counter timings.

Definition at line 120 of file ogl_spritedevicehelper.hxx.

◆ mnLinearMultiColorGradientProgram

unsigned int oglcanvas::SpriteDeviceHelper::mnLinearMultiColorGradientProgram
private

Definition at line 125 of file ogl_spritedevicehelper.hxx.

Referenced by disposing(), and useLinearGradientShader().

◆ mnLinearTwoColorGradientProgram

unsigned int oglcanvas::SpriteDeviceHelper::mnLinearTwoColorGradientProgram
private

Definition at line 124 of file ogl_spritedevicehelper.hxx.

Referenced by disposing(), and useLinearGradientShader().

◆ mnRadialMultiColorGradientProgram

unsigned int oglcanvas::SpriteDeviceHelper::mnRadialMultiColorGradientProgram
private

Definition at line 127 of file ogl_spritedevicehelper.hxx.

Referenced by disposing(), and useRadialGradientShader().

◆ mnRadialTwoColorGradientProgram

unsigned int oglcanvas::SpriteDeviceHelper::mnRadialTwoColorGradientProgram
private

Definition at line 126 of file ogl_spritedevicehelper.hxx.

Referenced by disposing(), and useRadialGradientShader().

◆ mnRectangularMultiColorGradientProgram

unsigned int oglcanvas::SpriteDeviceHelper::mnRectangularMultiColorGradientProgram
private

Definition at line 129 of file ogl_spritedevicehelper.hxx.

Referenced by disposing(), and useRectangularGradientShader().

◆ mnRectangularTwoColorGradientProgram

unsigned int oglcanvas::SpriteDeviceHelper::mnRectangularTwoColorGradientProgram
private

Definition at line 128 of file ogl_spritedevicehelper.hxx.

Referenced by disposing(), and useRectangularGradientShader().

◆ mpSpriteCanvas

SpriteCanvas* oglcanvas::SpriteDeviceHelper::mpSpriteCanvas
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().

◆ mpTextureCache

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

Definition at line 122 of file ogl_spritedevicehelper.hxx.

Referenced by disposing(), and getTextureCache().

◆ mxContext

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

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