LibreOffice Module vcl (master)  1
Public Member Functions | Static Public Member Functions | List of all members
OpenGLHelper Struct Reference

#include <OpenGLHelper.hxx>

Public Member Functions

 OpenGLHelper ()=delete
 

Static Public Member Functions

static OString GetDigest (const OUString &rVertexShaderName, const OUString &rFragmentShaderName, const OString &preamble)
 
static GLint LoadShaders (const OUString &rVertexShaderName, const OUString &rFragmentShaderName, const OUString &rGeometryShaderName, const OString &preamble, const OString &rDigest)
 
static GLint LoadShaders (const OUString &rVertexShaderName, const OUString &rFragmentShaderName, const OString &preamble, const OString &rDigest)
 
static GLint LoadShaders (const OUString &rVertexShaderName, const OUString &rFragmentShaderName, const OUString &rGeometryShaderName)
 
static GLint LoadShaders (const OUString &rVertexShaderName, const OUString &rFragmentShaderName)
 
static BitmapEx ConvertBufferToBitmapEx (const sal_uInt8 *const pBuffer, long nWidth, long nHeight)
 The caller is responsible for allocating the memory for the buffer before calling this method. More...
 
static GLenum OptimalBufferFormat ()
 Returns the optimal buffer format for OpenGL (GL_BGRA or GL_RGBA). More...
 
static void renderToFile (long nWidth, long nHeight, const OUString &rFileName)
 
static const char * GLErrorString (GLenum errorCode)
 
static void createFramebuffer (long nWidth, long nHeight, GLuint &nFramebufferId, GLuint &nRenderbufferDepthId, GLuint &nRenderbufferColorId)
 The caller is responsible for deleting the buffer objects identified by nFramebufferId, nRenderbufferDepthId and nRenderbufferColorId. More...
 
static float getGLVersion ()
 Get OpenGL version (needs a context) More...
 
static void checkGLError (const char *aFile, size_t nLine)
 
static void debugMsgPrint (const int nType, const char *pFormat,...)
 Insert a glDebugMessage into the queue - helpful for debugging with apitrace to annotate the output and correlate it with code. More...
 
static void debugMsgStream (std::ostringstream const &pStream)
 
static void debugMsgStreamWarn (std::ostringstream const &pStream)
 
static bool isDeviceBlacklisted ()
 checks if the device/driver pair is on our OpenGL blacklist More...
 
static bool supportsVCLOpenGL ()
 checks if the system supports all features that are necessary for the OpenGL VCL support More...
 
static bool isVCLOpenGLEnabled ()
 Returns true if VCL has OpenGL rendering enabled. More...
 

Detailed Description

Definition at line 44 of file OpenGLHelper.hxx.

Constructor & Destructor Documentation

OpenGLHelper::OpenGLHelper ( )
delete

Member Function Documentation

void OpenGLHelper::checkGLError ( const char *  aFile,
size_t  nLine 
)
static

Definition at line 737 of file OpenGLHelper.cxx.

References GLErrorString(), and SAL_WARN.

BitmapEx OpenGLHelper::ConvertBufferToBitmapEx ( const sal_uInt8 *const  pBuffer,
long  nWidth,
long  nHeight 
)
static

The caller is responsible for allocating the memory for the buffer before calling this method.

The buffer size is assumed to be 4*width*height and the format to be OptimalBufferFormat().

Definition at line 570 of file OpenGLHelper.cxx.

References BitmapReadAccess::GetScanline(), BitmapInfoAccess::GetScanlineFormat(), BitmapInfoAccess::IsTopDown(), N24BitTcBgr, N24BitTcRgb, N8BitPal, x, and y.

void OpenGLHelper::createFramebuffer ( long  nWidth,
long  nHeight,
GLuint &  nFramebufferId,
GLuint &  nRenderbufferDepthId,
GLuint &  nRenderbufferColorId 
)
static

The caller is responsible for deleting the buffer objects identified by nFramebufferId, nRenderbufferDepthId and nRenderbufferColorId.

This create a buffer for rendering to texture and should be freed with glDeleteTextures.

Parameters
nWidthWidth of frame
nHeightHeight of frame
nFramebufferIdFrameBuffer ID
nRenderbufferDepthIdRenderBuffer's depth ID
nRenderbufferColorIdRenderBuffer's color ID

Definition at line 674 of file OpenGLHelper.cxx.

References CHECK_GL_ERROR, and SAL_WARN.

void OpenGLHelper::debugMsgPrint ( const int  nType,
const char *  pFormat,
  ... 
)
static

Insert a glDebugMessage into the queue - helpful for debugging with apitrace to annotate the output and correlate it with code.

Definition at line 1056 of file OpenGLHelper.cxx.

References OpenGLContext::hasCurrent(), SAL_INFO, and SAL_WARN.

Referenced by debugMsgStream(), and debugMsgStreamWarn().

void OpenGLHelper::debugMsgStream ( std::ostringstream const &  pStream)
static

Definition at line 1046 of file OpenGLHelper.cxx.

References debugMsgPrint().

void OpenGLHelper::debugMsgStreamWarn ( std::ostringstream const &  pStream)
static

Definition at line 1051 of file OpenGLHelper.cxx.

References debugMsgPrint().

OString OpenGLHelper::GetDigest ( const OUString &  rVertexShaderName,
const OUString &  rFragmentShaderName,
const OString &  preamble 
)
static

Definition at line 381 of file OpenGLHelper.cxx.

Referenced by OpenGLContext::GetProgram().

float OpenGLHelper::getGLVersion ( )
static

Get OpenGL version (needs a context)

Definition at line 720 of file OpenGLHelper.cxx.

References CHECK_GL_ERROR.

Referenced by OpenGLContext::InitGL().

const char * OpenGLHelper::GLErrorString ( GLenum  errorCode)
static

Definition at line 614 of file OpenGLHelper.cxx.

References i.

Referenced by checkGLError().

bool OpenGLHelper::isDeviceBlacklisted ( )
static
bool OpenGLHelper::isVCLOpenGLEnabled ( )
static

Returns true if VCL has OpenGL rendering enabled.

The !bSet part should only be called once! Changing the results in the same run will mix OpenGL and normal rendering.

Definition at line 975 of file OpenGLHelper.cxx.

References CrashReporter::AddKeyValue(), Application::IsBitmapRendering(), Application::IsSafeModeEnabled(), OpenGLWatchdogThread::start(), and supportsVCLOpenGL().

Referenced by OutputDevice::DrawDeviceAlphaBitmap(), Bitmap::HasFastScale(), and OpenGLWrapper::isVCLOpenGLEnabled().

GLint OpenGLHelper::LoadShaders ( const OUString &  rVertexShaderName,
const OUString &  rFragmentShaderName,
const OUString &  rGeometryShaderName,
const OString &  preamble,
const OString &  rDigest 
)
static

Definition at line 388 of file OpenGLHelper.cxx.

References addPreamble(), CHECK_GL_ERROR, gbInShaderCompile, SAL_WARN, and VCL_GL_INFO.

GLint OpenGLHelper::LoadShaders ( const OUString &  rVertexShaderName,
const OUString &  rFragmentShaderName,
const OString &  preamble,
const OString &  rDigest 
)
static

Definition at line 521 of file OpenGLHelper.cxx.

GLint OpenGLHelper::LoadShaders ( const OUString &  rVertexShaderName,
const OUString &  rFragmentShaderName,
const OUString &  rGeometryShaderName 
)
static

Definition at line 529 of file OpenGLHelper.cxx.

GLint OpenGLHelper::LoadShaders ( const OUString &  rVertexShaderName,
const OUString &  rFragmentShaderName 
)
static

Definition at line 536 of file OpenGLHelper.cxx.

GLenum OpenGLHelper::OptimalBufferFormat ( )
static

Returns the optimal buffer format for OpenGL (GL_BGRA or GL_RGBA).

Definition at line 561 of file OpenGLHelper.cxx.

void OpenGLHelper::renderToFile ( long  nWidth,
long  nHeight,
const OUString &  rFileName 
)
static
bool OpenGLHelper::supportsVCLOpenGL ( )
static

checks if the system supports all features that are necessary for the OpenGL VCL support

Definition at line 795 of file OpenGLHelper.cxx.

Referenced by isVCLOpenGLEnabled().


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