summaryrefslogtreecommitdiff
path: root/vcl/inc
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2016-01-05 16:17:41 +0000
committerMichael Meeks <michael.meeks@collabora.com>2016-01-06 09:17:16 +0000
commit1479ad1c632a7511468fc5133e4fd747062c376f (patch)
treec0d919f8d43b480cfd9131a6b385643838078303 /vcl/inc
parent3576a87d72dd138d3bb2ce6bbba8df05ca983289 (diff)
vcl: opengl - Kill the last glErrors on common paths.
Re-work the makeSomeOpenGLContextCurrent logic into a shared function with the existing AcquireContext logic in the SalOpenGLGraphics impl. Use an OpenGLVCLContextZone placeholder to do both context and zone management - to include destructors into the zone. Fix a number of error cases around SalBitmaps where we did not have a GL context associated when allocating, and/or freeing textures.. Don't drag a (potentially) slower context around in the OpenGLSalBitmap when we're going to check / fetch a better VCL context anyway. Change-Id: Ibbb2358c47156cd078ad28b6aad4f03af36aaf23 Reviewed-on: https://gerrit.libreoffice.org/21127 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'vcl/inc')
-rw-r--r--vcl/inc/opengl/salbmp.hxx9
-rw-r--r--vcl/inc/opengl/zone.hxx7
-rw-r--r--vcl/inc/openglgdiimpl.hxx3
3 files changed, 11 insertions, 8 deletions
diff --git a/vcl/inc/opengl/salbmp.hxx b/vcl/inc/opengl/salbmp.hxx
index e9fd6f776719..19dfa3cf4339 100644
--- a/vcl/inc/opengl/salbmp.hxx
+++ b/vcl/inc/opengl/salbmp.hxx
@@ -37,7 +37,6 @@ class BitmapPalette;
class VCL_PLUGIN_PUBLIC OpenGLSalBitmap : public SalBitmap
{
private:
- rtl::Reference<OpenGLContext> mpContext;
OpenGLTexture maTexture;
bool mbDirtyTexture;
BitmapPalette maPalette;
@@ -50,7 +49,6 @@ private:
int mnBufHeight;
std::deque< OpenGLSalBitmapOp* > maPendingOps;
- void makeSomeOpenGLContextCurrent();
virtual void updateChecksum() const override;
bool calcChecksumGL(OpenGLTexture& rInputTexture, ChecksumType& rChecksum) const;
@@ -98,10 +96,11 @@ private:
private:
- bool ImplScaleFilter( const double& rScaleX, const double& rScaleY, GLenum nFilter );
+ bool ImplScaleFilter( const rtl::Reference< OpenGLContext > &xContext, const double& rScaleX, const double& rScaleY, GLenum nFilter );
static void ImplCreateKernel( const double& fScale, const vcl::Kernel& rKernel, GLfloat*& pWeights, sal_uInt32& aKernelSize );
- bool ImplScaleConvolution(const double& rScaleX, const double& rScaleY, const vcl::Kernel& rKernel);
- bool ImplScaleArea( double rScaleX, double rScaleY );
+ bool ImplScaleConvolution(const rtl::Reference< OpenGLContext > &xContext, const double& rScaleX, const double& rScaleY, const vcl::Kernel& rKernel);
+ bool ImplScaleArea( const rtl::Reference< OpenGLContext > &xContext,
+ double rScaleX, double rScaleY );
public:
diff --git a/vcl/inc/opengl/zone.hxx b/vcl/inc/opengl/zone.hxx
index 44265c526693..c6ba0ccc7487 100644
--- a/vcl/inc/opengl/zone.hxx
+++ b/vcl/inc/opengl/zone.hxx
@@ -40,6 +40,13 @@ public:
static void hardDisable();
};
+/// Create this to not only enter the zone, but set VCL context.
+class OpenGLVCLContextZone {
+ OpenGLZone aZone;
+public:
+ OpenGLVCLContextZone();
+};
+
#endif // INCLUDED_VCL_INC_OPENGL_ZONE_H
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/openglgdiimpl.hxx b/vcl/inc/openglgdiimpl.hxx
index 63bebdcc991d..0220758e1fbd 100644
--- a/vcl/inc/openglgdiimpl.hxx
+++ b/vcl/inc/openglgdiimpl.hxx
@@ -162,9 +162,6 @@ protected:
bool AcquireContext(bool bForceCreate = false);
bool ReleaseContext();
- /// retrieve the default context for offscreen rendering
- static rtl::Reference<OpenGLContext> GetDefaultContext();
-
/// create a new context for rendering to the underlying window
virtual rtl::Reference<OpenGLContext> CreateWinContext() = 0;