[Libreoffice-commits] core.git: Branch 'feature/opengl-vcl' - 5 commits - include/vcl vcl/inc vcl/win

Markus Mohrhard markus.mohrhard at googlemail.com
Thu Oct 30 08:30:46 PDT 2014


 include/vcl/opengl/OpenGLContext.hxx |    5 ++-
 vcl/inc/win/svsys.h                  |    3 ++
 vcl/win/source/gdi/gdiimpl.hxx       |    3 +-
 vcl/win/source/gdi/salgdi.cxx        |   46 +++++++++++++++++++----------------
 4 files changed, 33 insertions(+), 24 deletions(-)

New commits:
commit d06876c3a657ca4e08e29b476fbe16c4b970d0fe
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Thu Oct 30 16:29:54 2014 +0100

    no check before delete and move to intializer list
    
    Change-Id: Ib6e50f863db1a64dc42ed4313a009abe4932ce3f

diff --git a/vcl/win/source/gdi/salgdi.cxx b/vcl/win/source/gdi/salgdi.cxx
index b8d465a..8ccc7d0 100644
--- a/vcl/win/source/gdi/salgdi.cxx
+++ b/vcl/win/source/gdi/salgdi.cxx
@@ -555,7 +555,23 @@ void ImplClearHDCCache( SalData* pData )
 }
 
 WinSalGraphics::WinSalGraphics():
-    mpImpl(new WinSalGraphicsImpl(*this))
+    mpImpl(new WinSalGraphicsImpl(*this)),
+    mhLocalDC(0),
+    mfCurrentFontScale(1.0),
+    mhRegion(0),
+    mhDefPen(0),
+    mhDefBrush(0),
+    mhDefFont(0),
+    mhDefPal(0),
+    mpStdClipRgnData(NULL),
+    mpLogFont(NULL),
+    mpFontCharSets(NULL),
+    mpFontAttrCache(NULL),
+    mnFontCharSetCount(0),
+    mpFontKernPairs(NULL),
+    mnFontKernPairCount(0),
+    mbFontKernInit(false),
+    mnPenWidth(GSL_PEN_WIDTH)
 {
     for( int i = 0; i < MAX_FALLBACK; ++i )
     {
@@ -565,23 +581,6 @@ WinSalGraphics::WinSalGraphics():
         mfFontScale[ i ] = 1.0;
     }
 
-    mfCurrentFontScale = 1.0;
-
-    mhLocalDC           = 0;
-    mhRegion            = 0;
-    mhDefPen            = 0;
-    mhDefBrush          = 0;
-    mhDefFont           = 0;
-    mhDefPal            = 0;
-    mpStdClipRgnData    = NULL;
-    mpLogFont           = NULL;
-    mpFontCharSets      = NULL;
-    mpFontAttrCache     = NULL;
-    mnFontCharSetCount  = 0;
-    mpFontKernPairs     = NULL;
-    mnFontKernPairCount = 0;
-    mbFontKernInit      = FALSE;
-    mnPenWidth          = GSL_PEN_WIDTH;
     static const char* pEnv = getenv("USE_OPENGL");
     if (pEnv)
     {
@@ -601,8 +600,7 @@ WinSalGraphics::~WinSalGraphics()
     }
 
     // delete cache data
-    if ( mpStdClipRgnData )
-        delete [] mpStdClipRgnData;
+    delete [] mpStdClipRgnData;
 
     delete mpLogFont;
 
commit 5ba57c87cfeca41e323a2e0936f4d3b829d38826
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Thu Oct 30 16:06:01 2014 +0100

    make it possible to select the OpenGL rendering on windows
    
    Change-Id: Id60b8121a890e6d1f46bd671549ac681f42b7660

diff --git a/include/vcl/opengl/OpenGLContext.hxx b/include/vcl/opengl/OpenGLContext.hxx
index bb7aa3b..91b54e4 100644
--- a/include/vcl/opengl/OpenGLContext.hxx
+++ b/include/vcl/opengl/OpenGLContext.hxx
@@ -22,9 +22,12 @@
 #  include "GL/glxew.h"
 #  include <postx.h>
 #elif defined( _WIN32 )
+#ifndef INCLUDED_PRE_POST_WIN_H
+#define INCLUDED_PRE_POST_WIN_H
 #  include "prewin.h"
 #  include "postwin.h"
 #endif
+#endif
 
 #if defined( _WIN32 )
 #include <GL/glext.h>
diff --git a/vcl/inc/win/svsys.h b/vcl/inc/win/svsys.h
index 5554da9..9753a87 100644
--- a/vcl/inc/win/svsys.h
+++ b/vcl/inc/win/svsys.h
@@ -21,9 +21,12 @@
 #define INCLUDED_VCL_INC_WIN_SVSYS_H
 
 #ifdef WNT
+#ifndef INCLUDED_PRE_POST_WIN_H
+#define INCLUDED_PRE_POST_WIN_H
 #include <prewin.h>
 #include <postwin.h>
 #endif
+#endif
 
 #endif // INCLUDED_VCL_INC_WIN_SVSYS_H
 
diff --git a/vcl/win/source/gdi/salgdi.cxx b/vcl/win/source/gdi/salgdi.cxx
index d7a0716..b8d465a 100644
--- a/vcl/win/source/gdi/salgdi.cxx
+++ b/vcl/win/source/gdi/salgdi.cxx
@@ -34,6 +34,7 @@
 
 #include "salgdiimpl.hxx"
 #include "gdiimpl.hxx"
+#include "openglgdiimpl.hxx"
 
 #define DITHER_PAL_DELTA                51
 #define DITHER_PAL_STEPS                6
@@ -581,6 +582,11 @@ WinSalGraphics::WinSalGraphics():
     mnFontKernPairCount = 0;
     mbFontKernInit      = FALSE;
     mnPenWidth          = GSL_PEN_WIDTH;
+    static const char* pEnv = getenv("USE_OPENGL");
+    if (pEnv)
+    {
+        mpImpl.reset(new OpenGLSalGraphicsImpl());
+    }
 }
 
 WinSalGraphics::~WinSalGraphics()
commit e95f8017fa91088e47fabde067b18d6340e5d5de
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Thu Oct 30 02:55:57 2014 +0100

    don't include the win version of svsys directly
    
    Change-Id: I21f9443ad847ab07c3e25e6004d2133148db7f03

diff --git a/vcl/win/source/gdi/gdiimpl.hxx b/vcl/win/source/gdi/gdiimpl.hxx
index 42765aa..c10a143 100644
--- a/vcl/win/source/gdi/gdiimpl.hxx
+++ b/vcl/win/source/gdi/gdiimpl.hxx
@@ -19,9 +19,10 @@
 
 #include "salgdiimpl.hxx"
 
-#include "win/svsys.h"
 #include <vcl/gradient.hxx>
 
+#include "svsys.h"
+
 class WinSalGraphics;
 
 class WinSalGraphicsImpl : public SalGraphicsImpl
commit 22ec06afbf141f7d2a91a9fffdd16535e6e895b5
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Thu Oct 30 02:55:28 2014 +0100

    fix indentation
    
    Change-Id: Ia61988f94a2cce9aefe1b48159a1bf1884be70f2

diff --git a/vcl/win/source/gdi/salgdi.cxx b/vcl/win/source/gdi/salgdi.cxx
index 7768ab1..d7a0716 100644
--- a/vcl/win/source/gdi/salgdi.cxx
+++ b/vcl/win/source/gdi/salgdi.cxx
@@ -586,7 +586,7 @@ WinSalGraphics::WinSalGraphics():
 WinSalGraphics::~WinSalGraphics()
 {
     // free obsolete GDI objects
-        ReleaseFonts();
+    ReleaseFonts();
 
     if ( mhRegion )
     {
commit d04b6340bb62299ccf16b80a3553c2314a1a420c
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Thu Oct 30 02:24:28 2014 +0100

    remove unused function
    
    Change-Id: I990e53f55093affa0da1878d1cdd46f6b1c6a99c

diff --git a/include/vcl/opengl/OpenGLContext.hxx b/include/vcl/opengl/OpenGLContext.hxx
index a99e6c3..bb7aa3b 100644
--- a/include/vcl/opengl/OpenGLContext.hxx
+++ b/include/vcl/opengl/OpenGLContext.hxx
@@ -117,8 +117,6 @@ struct GLWindow
     const GLubyte*          GLExtensions;
     bool bMultiSampleSupported;
 
-    bool HasGLExtension( const char* name ) { return checkExtension( (const GLubyte*) name, GLExtensions ); }
-
     GLWindow()
         :
 #if defined( _WIN32 )


More information about the Libreoffice-commits mailing list