summaryrefslogtreecommitdiffstats
path: root/vcl/inc/openglgdiimpl.hxx
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2015-11-13 12:00:59 +0000
committerMichael Meeks <michael.meeks@collabora.com>2015-12-04 01:53:12 +0000
commit51d2dd74722c75388883e36dd5e7a30940eacdba (patch)
treef2e5f4be5503c9c8cba0bf8acbf656c4a4b34691 /vcl/inc/openglgdiimpl.hxx
parentAdd build toolchain to upload LibreOffice API to Maven Central (diff)
downloadcore-51d2dd74722c75388883e36dd5e7a30940eacdba.tar.gz
core-51d2dd74722c75388883e36dd5e7a30940eacdba.zip
Step #1 - de-virtualize UseContext
Change-Id: If343746b6544d77fec76ee89351cd7262d1bf350
Diffstat (limited to 'vcl/inc/openglgdiimpl.hxx')
-rw-r--r--vcl/inc/openglgdiimpl.hxx13
1 files changed, 9 insertions, 4 deletions
diff --git a/vcl/inc/openglgdiimpl.hxx b/vcl/inc/openglgdiimpl.hxx
index 667b2ec095f0..9eb435324394 100644
--- a/vcl/inc/openglgdiimpl.hxx
+++ b/vcl/inc/openglgdiimpl.hxx
@@ -131,7 +131,8 @@ public:
// get the height of the device
GLfloat GetHeight() const { return mpProvider ? mpProvider->GetHeight() : 1; }
- // check whether this instance is used for offscreen rendering
+ // check whether this instance is used for offscreen (Virtual Device)
+ // rendering ie. does it need its own context.
bool IsOffscreen() const { return mpProvider == nullptr || mpProvider->IsOffScreen(); }
// operations to do before painting
@@ -147,11 +148,15 @@ protected:
// retrieve the default context for offscreen rendering
static rtl::Reference<OpenGLContext> GetDefaultContext();
- // create a new context for window rendering
+ /// create a new context for window rendering
virtual rtl::Reference<OpenGLContext> CreateWinContext() = 0;
- // check whether the given context can be used by this instance
- virtual bool UseContext( const rtl::Reference<OpenGLContext> &pContext ) = 0;
+ /// check whether the given context can be used for off-screen rendering
+ bool UseContext( const rtl::Reference<OpenGLContext> &pContext )
+ {
+ return pContext->isInitialized() && // not released by the OS etc.
+ IsForeignContext( pContext ); // a genuine VCL context.
+ }
public:
OpenGLSalGraphicsImpl(SalGraphics& pParent, SalGeometryProvider *pProvider);