diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-11-13 12:00:59 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-12-04 01:53:12 +0000 |
commit | 51d2dd74722c75388883e36dd5e7a30940eacdba (patch) | |
tree | f2e5f4be5503c9c8cba0bf8acbf656c4a4b34691 /vcl/inc | |
parent | Add build toolchain to upload LibreOffice API to Maven Central (diff) | |
download | core-51d2dd74722c75388883e36dd5e7a30940eacdba.tar.gz core-51d2dd74722c75388883e36dd5e7a30940eacdba.zip |
Step #1 - de-virtualize UseContext
Change-Id: If343746b6544d77fec76ee89351cd7262d1bf350
Diffstat (limited to 'vcl/inc')
-rw-r--r-- | vcl/inc/opengl/win/gdiimpl.hxx | 1 | ||||
-rw-r--r-- | vcl/inc/opengl/x11/gdiimpl.hxx | 1 | ||||
-rw-r--r-- | vcl/inc/openglgdiimpl.hxx | 13 |
3 files changed, 9 insertions, 6 deletions
diff --git a/vcl/inc/opengl/win/gdiimpl.hxx b/vcl/inc/opengl/win/gdiimpl.hxx index ecefede6e7ea..8102d2ef5c07 100644 --- a/vcl/inc/opengl/win/gdiimpl.hxx +++ b/vcl/inc/opengl/win/gdiimpl.hxx @@ -31,7 +31,6 @@ public: protected: virtual rtl::Reference<OpenGLContext> CreateWinContext() override; - virtual bool UseContext( const rtl::Reference<OpenGLContext> &pContext ) override; bool RenderTextureCombo(TextureCombo& rCombo, int nX, int nY); diff --git a/vcl/inc/opengl/x11/gdiimpl.hxx b/vcl/inc/opengl/x11/gdiimpl.hxx index f07468d6a135..eccd0ef06ae9 100644 --- a/vcl/inc/opengl/x11/gdiimpl.hxx +++ b/vcl/inc/opengl/x11/gdiimpl.hxx @@ -29,7 +29,6 @@ public: protected: virtual rtl::Reference<OpenGLContext> CreateWinContext() override; - virtual bool UseContext( const rtl::Reference<OpenGLContext> &pContext ) override; bool RenderPixmap(X11Pixmap* pPixmap, X11Pixmap* pMask, int nX, int nY, TextureCombo& rCombo); 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); |