[Libreoffice-commits] core.git: Branch 'feature/chart-opengl' - chart2/source

Markus Mohrhard markus.mohrhard at googlemail.com
Sun Dec 8 21:59:27 PST 2013


 chart2/source/view/inc/DummyXShape.hxx        |   42 +++++++-------------------
 chart2/source/view/inc/OpenglShapeFactory.hxx |    9 +++++
 chart2/source/view/main/DummyXShape.cxx       |    2 -
 chart2/source/view/main/OpenGLRender.cxx      |    4 +-
 4 files changed, 24 insertions(+), 33 deletions(-)

New commits:
commit 2d649a0cc0d647d273241bb1621ea1c7726f92b2
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Mon Dec 9 06:58:39 2013 +0100

    adding all files would prevent compile errors
    
    Change-Id: I351e0ac179445e45a5cbc767b20159f647ec30cc

diff --git a/chart2/source/view/inc/DummyXShape.hxx b/chart2/source/view/inc/DummyXShape.hxx
index aed200c..b41f925 100644
--- a/chart2/source/view/inc/DummyXShape.hxx
+++ b/chart2/source/view/inc/DummyXShape.hxx
@@ -92,12 +92,19 @@
         #include <GL/glxext.h>
     }
 #endif
+//[mod] by gaowei
+
+#include "OpenGLRender.hxx"
+
+//[mod] by gaowei end
+
 
 class SystemWindow;
 class SystemChildWindow;
 
 using namespace com::sun::star;
 
+
 namespace chart {
 
 namespace dummy {
@@ -394,7 +401,8 @@ private:
 class DummyChart : public DummyXShapes
 {
 public:
-    DummyChart();
+    DummyChart(com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage > xDrawPage);
+    ~DummyChart();
     virtual DummyChart* getRootShape();
 
     virtual void SAL_CALL setPosition( const ::com::sun::star::awt::Point& aPosition ) throw(::com::sun::star::uno::RuntimeException);
@@ -402,42 +410,16 @@ public:
 
 private:
 
-    /// Holds the information of our new child window
-    struct GLWindow
-    {
-#if defined( _WIN32 )
-        HWND                    hWnd;
-        HDC                     hDC;
-        HGLRC                   hRC;
-#elif defined( MACOSX )
-#elif defined( UNX )
-        unx::Display*           dpy;
-        int                     screen;
-        unx::Window             win;
-#if defined( GLX_VERSION_1_3 ) && defined( GLX_EXT_texture_from_pixmap )
-        unx::GLXFBConfig        fbc;
-#endif
-        unx::XVisualInfo*       vi;
-        unx::GLXContext         ctx;
-
-        bool HasGLXExtension( const char* name ) { return gluCheckExtension( (const GLubyte*) name, (const GLubyte*) GLXExtensions ); }
-        const char*             GLXExtensions;
-#endif
-        unsigned int            bpp;
-        unsigned int            Width;
-        unsigned int            Height;
-        const GLubyte*          GLExtensions;
-
-        bool HasGLExtension( const char* name ) { return gluCheckExtension( (const GLubyte*) name, GLExtensions ); }
-    } GLWin;    /// Holds the information of our new child window
+    GLWindow GLWin;    /// Holds the information of our new child window
 
     void createGLContext();
 
     bool initWindow();
     bool initOpengl();
-
     boost::scoped_ptr<Window> mpWindow;
     boost::scoped_ptr<SystemChildWindow> pWindow;
+public:
+    OpenGLRender m_GLRender;
 };
 
 class DummyGroup2D : public DummyXShapes
diff --git a/chart2/source/view/inc/OpenglShapeFactory.hxx b/chart2/source/view/inc/OpenglShapeFactory.hxx
index 7d8ebdc..8952eea 100644
--- a/chart2/source/view/inc/OpenglShapeFactory.hxx
+++ b/chart2/source/view/inc/OpenglShapeFactory.hxx
@@ -19,6 +19,10 @@ namespace opengl {
 class OpenglShapeFactory : public chart::AbstractShapeFactory
 {
 public:
+    OpenglShapeFactory();
+    OpenglShapeFactory(::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory> xFactory)
+        {m_xShapeFactory = xFactory;}
+
     virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >
         createGroup2D(
             const ::com::sun::star::uno::Reference<
@@ -189,6 +193,11 @@ public:
             ::com::sun::star::drawing::XDrawPage>& xPage );
 
     virtual void setPageSize( com::sun::star::uno::Reference < com::sun::star::drawing::XShapes > xChartShapes, const com::sun::star::awt::Size& rSize );
+private:
+    void *m_pChart;
+    //member:
+    ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>
+        m_xShapeFactory;
 
 };
 
diff --git a/chart2/source/view/main/DummyXShape.cxx b/chart2/source/view/main/DummyXShape.cxx
index cc2f871..ecf3c59 100644
--- a/chart2/source/view/main/DummyXShape.cxx
+++ b/chart2/source/view/main/DummyXShape.cxx
@@ -765,7 +765,7 @@ bool DummyChart::initOpengl()
     GLWin.hRC  = wglCreateContext(GLWin.hDC);
     wglMakeCurrent(GLWin.hDC,GLWin.hRC);
 //[Mod] GaoWei
-    m_GLRender.InitOpenGL(GLWin.hWnd, GLWin.hDC, GLWin.hRC);
+    m_GLRender.InitOpenGL(GLWin);
 //[Mod] GaoWei end
 
 #elif defined( UNX )
diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx
index 0ce94d5..82c6ac6 100644
--- a/chart2/source/view/main/OpenGLRender.cxx
+++ b/chart2/source/view/main/OpenGLRender.cxx
@@ -825,9 +825,9 @@ void OpenGLRender::Release()
 #if defined( WNT )
     wglMakeCurrent(NULL, NULL);
     if (!m_iExternRC)
-        wglDeleteContext(m_hRC);
+        wglDeleteContext(glWin.m_hRC);
     if (!m_iExternDC)
-        ReleaseDC(m_hWnd, m_hDC);
+        ReleaseDC(mglWin._hWnd, mglWin._hDC);
 #elif defined( UNX )
 
     glXMakeCurrent(glWin.dpy, None, NULL);


More information about the Libreoffice-commits mailing list