diff options
author | Jan Holesovsky <kendy@collabora.com> | 2014-04-16 15:21:30 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2014-04-16 15:23:10 +0200 |
commit | 7a8146e080ef13e066d29e4bff354b732980c2a8 (patch) | |
tree | 1ed76cfd25304f52d70ed584032940a015386805 /svx/source | |
parent | c553a2fd3d5a33c41fcc0b14b7a89619f50e893f (diff) |
non-desktop: Attempt to get rid of glew.
Change-Id: I883ff114ebd98234fcc9f41d69de96aadedadf4b
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/sdr/contact/viewobjectcontactofopenglobj.cxx | 5 | ||||
-rw-r--r-- | svx/source/svdraw/svdoopengl.cxx | 25 |
2 files changed, 23 insertions, 7 deletions
diff --git a/svx/source/sdr/contact/viewobjectcontactofopenglobj.cxx b/svx/source/sdr/contact/viewobjectcontactofopenglobj.cxx index a4a8d902c1f0..6062ab96803b 100644 --- a/svx/source/sdr/contact/viewobjectcontactofopenglobj.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofopenglobj.cxx @@ -21,8 +21,9 @@ ViewObjectContactOfOpenGLObj::ViewObjectContactOfOpenGLObj( ObjectContact& rObjectContact, ViewContact& rViewContact ) : ViewObjectContactOfSdrObj( rObjectContact, rViewContact ) { - OpenGLContext& rContext = static_cast<SdrOpenGLObj&>(static_cast<ViewContactOfSdrObj&>(rViewContact).GetSdrObject()).getOpenGLContext(); - rContext.init(getWindow()); + OpenGLContext* pContext = static_cast<SdrOpenGLObj&>(static_cast<ViewContactOfSdrObj&>(rViewContact).GetSdrObject()).getOpenGLContext(); + if (pContext) + pContext->init(getWindow()); } ViewObjectContactOfOpenGLObj::~ViewObjectContactOfOpenGLObj() diff --git a/svx/source/svdraw/svdoopengl.cxx b/svx/source/svdraw/svdoopengl.cxx index 178afcc7b382..59922acf3996 100644 --- a/svx/source/svdraw/svdoopengl.cxx +++ b/svx/source/svdraw/svdoopengl.cxx @@ -7,13 +7,26 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include <config_features.h> + #include <svx/svdoopengl.hxx> #include <svx/sdr/contact/viewcontactofopenglobj.hxx> #include <vcl/opengl/IOpenGLRenderer.hxx> +SdrOpenGLObj::SdrOpenGLObj() + : SdrObject(), + IOpenGLInfoProvider(), + mpContext(NULL) +{ +#if HAVE_FEATURE_DESKTOP + mpContext = new OpenGLContext; +#endif +} + SdrOpenGLObj::~SdrOpenGLObj() { + delete mpContext; } sdr::contact::ViewContact* SdrOpenGLObj::CreateObjectSpecificViewContact() @@ -21,17 +34,19 @@ sdr::contact::ViewContact* SdrOpenGLObj::CreateObjectSpecificViewContact() return new sdr::contact::ViewContactOfOpenGLObj(*this); } -OpenGLContext& SdrOpenGLObj::getOpenGLContext() +OpenGLContext* SdrOpenGLObj::getOpenGLContext() { - return maContext; + return mpContext; } void SdrOpenGLObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) { SdrObject::NbcResize(rRef, xFact, yFact); - //now pass the information to the OpenGL context - maContext.setWinSize(aOutRect.GetSize()); + // now pass the information to the OpenGL context + if (mpContext) + mpContext->setWinSize(aOutRect.GetSize()); + SAL_WARN("svx.opengl", "resized opengl drawinglayer object"); } @@ -48,7 +63,7 @@ IOpenGLRenderer* SdrOpenGLObj::getRenderer() bool SdrOpenGLObj::isOpenGLInitialized() { - return maContext.isInitialized(); + return mpContext && mpContext->isInitialized(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |