Kaydet (Commit) 7a8146e0 authored tarafından Jan Holesovsky's avatar Jan Holesovsky

non-desktop: Attempt to get rid of glew.

Change-Id: I883ff114ebd98234fcc9f41d69de96aadedadf4b
üst c553a2fd
...@@ -26,10 +26,11 @@ class IOpenGLRenderer; ...@@ -26,10 +26,11 @@ class IOpenGLRenderer;
class SVX_DLLPUBLIC SdrOpenGLObj : public SdrObject, public IOpenGLInfoProvider class SVX_DLLPUBLIC SdrOpenGLObj : public SdrObject, public IOpenGLInfoProvider
{ {
public: public:
SdrOpenGLObj();
virtual ~SdrOpenGLObj(); virtual ~SdrOpenGLObj();
virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() SAL_OVERRIDE; virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() SAL_OVERRIDE;
OpenGLContext& getOpenGLContext(); OpenGLContext* getOpenGLContext();
virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE; virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE;
...@@ -40,7 +41,7 @@ public: ...@@ -40,7 +41,7 @@ public:
private: private:
OpenGLContext maContext; OpenGLContext* mpContext;
boost::scoped_ptr<IOpenGLRenderer> mpRenderer; boost::scoped_ptr<IOpenGLRenderer> mpRenderer;
}; };
......
...@@ -21,8 +21,9 @@ ViewObjectContactOfOpenGLObj::ViewObjectContactOfOpenGLObj( ...@@ -21,8 +21,9 @@ ViewObjectContactOfOpenGLObj::ViewObjectContactOfOpenGLObj(
ObjectContact& rObjectContact, ViewContact& rViewContact ) ObjectContact& rObjectContact, ViewContact& rViewContact )
: ViewObjectContactOfSdrObj( rObjectContact, rViewContact ) : ViewObjectContactOfSdrObj( rObjectContact, rViewContact )
{ {
OpenGLContext& rContext = static_cast<SdrOpenGLObj&>(static_cast<ViewContactOfSdrObj&>(rViewContact).GetSdrObject()).getOpenGLContext(); OpenGLContext* pContext = static_cast<SdrOpenGLObj&>(static_cast<ViewContactOfSdrObj&>(rViewContact).GetSdrObject()).getOpenGLContext();
rContext.init(getWindow()); if (pContext)
pContext->init(getWindow());
} }
ViewObjectContactOfOpenGLObj::~ViewObjectContactOfOpenGLObj() ViewObjectContactOfOpenGLObj::~ViewObjectContactOfOpenGLObj()
......
...@@ -7,13 +7,26 @@ ...@@ -7,13 +7,26 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/ */
#include <config_features.h>
#include <svx/svdoopengl.hxx> #include <svx/svdoopengl.hxx>
#include <svx/sdr/contact/viewcontactofopenglobj.hxx> #include <svx/sdr/contact/viewcontactofopenglobj.hxx>
#include <vcl/opengl/IOpenGLRenderer.hxx> #include <vcl/opengl/IOpenGLRenderer.hxx>
SdrOpenGLObj::SdrOpenGLObj()
: SdrObject(),
IOpenGLInfoProvider(),
mpContext(NULL)
{
#if HAVE_FEATURE_DESKTOP
mpContext = new OpenGLContext;
#endif
}
SdrOpenGLObj::~SdrOpenGLObj() SdrOpenGLObj::~SdrOpenGLObj()
{ {
delete mpContext;
} }
sdr::contact::ViewContact* SdrOpenGLObj::CreateObjectSpecificViewContact() sdr::contact::ViewContact* SdrOpenGLObj::CreateObjectSpecificViewContact()
...@@ -21,17 +34,19 @@ sdr::contact::ViewContact* SdrOpenGLObj::CreateObjectSpecificViewContact() ...@@ -21,17 +34,19 @@ sdr::contact::ViewContact* SdrOpenGLObj::CreateObjectSpecificViewContact()
return new sdr::contact::ViewContactOfOpenGLObj(*this); 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) void SdrOpenGLObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
{ {
SdrObject::NbcResize(rRef, xFact, yFact); SdrObject::NbcResize(rRef, xFact, yFact);
//now pass the information to the OpenGL context // now pass the information to the OpenGL context
maContext.setWinSize(aOutRect.GetSize()); if (mpContext)
mpContext->setWinSize(aOutRect.GetSize());
SAL_WARN("svx.opengl", "resized opengl drawinglayer object"); SAL_WARN("svx.opengl", "resized opengl drawinglayer object");
} }
...@@ -48,7 +63,7 @@ IOpenGLRenderer* SdrOpenGLObj::getRenderer() ...@@ -48,7 +63,7 @@ IOpenGLRenderer* SdrOpenGLObj::getRenderer()
bool SdrOpenGLObj::isOpenGLInitialized() bool SdrOpenGLObj::isOpenGLInitialized()
{ {
return maContext.isInitialized(); return mpContext && mpContext->isInitialized();
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment