summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2014-04-14 02:02:39 +0200
committerMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2014-04-15 01:51:26 +0200
commit7f6b1560e970ea7b2a7397cc427ea9d996c65d9a (patch)
tree3261d1a66e705dbe430fd286b5443a2a52838e6d /svx
parent64dada726815b22eb943dc6fa68d86dd896ba32a (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 'svx')
-rw-r--r--svx/source/svdraw/svdoopengl.cxx15
-rw-r--r--svx/source/unodraw/unoshap4.cxx12
2 files changed, 27 insertions, 0 deletions
diff --git a/svx/source/svdraw/svdoopengl.cxx b/svx/source/svdraw/svdoopengl.cxx
index 45d23ae4734e..df2f07b7d04b 100644
--- a/svx/source/svdraw/svdoopengl.cxx
+++ b/svx/source/svdraw/svdoopengl.cxx
@@ -10,6 +10,12 @@
#include <svx/svdoopengl.hxx>
#include <svx/sdr/contact/viewcontactofopenglobj.hxx>
+#include <vcl/IOpenGLRenderer.hxx>
+
+SdrOpenGLObj::~SdrOpenGLObj()
+{
+}
+
sdr::contact::ViewContact* SdrOpenGLObj::CreateObjectSpecificViewContact()
{
return new sdr::contact::ViewContactOfOpenGLObj(*this);
@@ -29,5 +35,14 @@ void SdrOpenGLObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fra
SAL_WARN("svx.opengl", "resized opengl drawinglayer object");
}
+void SdrOpenGLObj::setRenderer(IOpenGLRenderer* pRenderer)
+{
+ mpRenderer.reset(pRenderer);
+}
+
+IOpenGLRenderer* SdrOpenGLObj::getRenderer()
+{
+ return mpRenderer.get();
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/unodraw/unoshap4.cxx b/svx/source/unodraw/unoshap4.cxx
index 239328d6ccab..40a206760e3e 100644
--- a/svx/source/unodraw/unoshap4.cxx
+++ b/svx/source/unodraw/unoshap4.cxx
@@ -50,6 +50,7 @@
#include "svx/svdview.hxx"
#include "svx/svdglob.hxx"
#include "svx/svdstr.hrc"
+#include <svx/svdoopengl.hxx>
#include <vcl/wmf.hxx>
@@ -968,4 +969,15 @@ SvxDummyShapeContainer::SvxDummyShapeContainer(uno::Reference< drawing::XShapes
SvxDummyShapeContainer::~SvxDummyShapeContainer() throw()
{
}
+
+void SvxOpenGLObject::setRenderer(IOpenGLRenderer* pRenderer)
+{
+ static_cast<SdrOpenGLObj*>(GetSdrObject())->setRenderer(pRenderer);
+}
+
+IOpenGLRenderer* SvxOpenGLObject::getRenderer()
+{
+ return static_cast<SdrOpenGLObj*>(GetSdrObject())->getRenderer();
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */