diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-04-14 02:02:39 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-04-15 01:51:26 +0200 |
commit | 7f6b1560e970ea7b2a7397cc427ea9d996c65d9a (patch) | |
tree | 3261d1a66e705dbe430fd286b5443a2a52838e6d /include/svx | |
parent | 64dada726815b22eb943dc6fa68d86dd896ba32a (diff) |
tie lifetime of some objects together
It is just too complicated to follow the different OpenGL contexts in
our current desing. This will at least simplify our handling a bit.
IOpenGLRenderer is an abstract interface that should be implemented by
the code using SdrOpenGLObj to paint with OpenGL.
Change-Id: Ib4bfc0350b4345bc27af8bed037c48c11bb67300
Diffstat (limited to 'include/svx')
-rw-r--r-- | include/svx/svdoopengl.hxx | 12 | ||||
-rw-r--r-- | include/svx/unoshape.hxx | 4 |
2 files changed, 16 insertions, 0 deletions
diff --git a/include/svx/svdoopengl.hxx b/include/svx/svdoopengl.hxx index 68428da279c1..7760b823717d 100644 --- a/include/svx/svdoopengl.hxx +++ b/include/svx/svdoopengl.hxx @@ -13,22 +13,34 @@ #include <svx/svdobj.hxx> #include <vcl/OpenGLContext.hxx> +#include <vcl/IOpenGLRenderer.hxx> + +#include <boost/scoped_ptr.hpp> + namespace sdr { namespace contact { class ViewContact; } } +class IOpenGLRenderer; + class SVX_DLLPUBLIC SdrOpenGLObj : public SdrObject { public: + virtual ~SdrOpenGLObj(); virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() SAL_OVERRIDE; OpenGLContext& getOpenGLContext(); virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE; + void setRenderer(IOpenGLRenderer* pRenderer); + IOpenGLRenderer* getRenderer(); + private: OpenGLContext maContext; + + boost::scoped_ptr<IOpenGLRenderer> mpRenderer; }; #endif diff --git a/include/svx/unoshape.hxx b/include/svx/unoshape.hxx index 54a784ceb6a4..60775f662a45 100644 --- a/include/svx/unoshape.hxx +++ b/include/svx/unoshape.hxx @@ -66,6 +66,7 @@ class SdrModel; class SvxDrawPage; class SvGlobalName; class Pair; +class IOpenGLRenderer; // Dimension arrows change size/position on save/reload (#i59051#) namespace basegfx @@ -881,6 +882,9 @@ class SvxOpenGLObject : public SvxShape public: SvxOpenGLObject( SdrObject* pObj ) throw() : SvxShape(pObj){} virtual ~SvxOpenGLObject() throw() {} + + void setRenderer(IOpenGLRenderer* pRenderer); + IOpenGLRenderer* getRenderer(); }; /* |