[Libreoffice-commits] core.git: Branch 'feature/opengl-vcl' - 2 commits - vcl/source vcl/workben
Michael Meeks
michael.meeks at collabora.com
Fri Nov 7 03:51:15 PST 2014
vcl/source/opengl/OpenGLHelper.cxx | 3 ++-
vcl/workben/vcldemo.cxx | 29 ++++++++++++++++++++++++-----
2 files changed, 26 insertions(+), 6 deletions(-)
New commits:
commit 28d9d7dcfa62eeef9894c558ff97111d21a300e8
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Fri Nov 7 11:51:43 2014 +0000
vcldemo: cover more features.
Change-Id: I12341c28a5d8d8b1d9d5343eaff4a1a08700fadb
diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx
index 1fdd751..65f143d 100644
--- a/vcl/workben/vcldemo.cxx
+++ b/vcl/workben/vcldemo.cxx
@@ -24,6 +24,11 @@
#include <vcl/wrkwin.hxx>
#include <vcl/graphicfilter.hxx>
+#if 0
+# define FIXME_ALPHA_WORKING
+# define FIXME_ROUNDED_RECT_WORKING
+#endif
+
using namespace css;
class DemoWin : public WorkWindow
@@ -96,9 +101,9 @@ public:
SetLineColor(Color(COL_RED));
// DrawPolyLine(aPoly);
}
- void drawPolyPoly(Rectangle r)
+ void drawEllipse(Rectangle r)
{
- (void)r;
+ DrawEllipse(r);
}
void drawCheckered(Rectangle r)
{
@@ -122,12 +127,22 @@ public:
}
void drawBitmapEx(Rectangle r)
{
+ drawCheckered(r);
+
BitmapEx aBitmap(maIntro);
aBitmap.Scale(r.GetSize(), BMP_SCALE_BESTQUALITY);
+#ifdef FIXME_ALPHA_WORKING
+ AlphaMask aSemiTransp(aBitmap.GetSizePixel());
+ aSemiTransp.Erase(64);
+ DrawBitmapEx(r.TopLeft(), BitmapEx(aBitmap.GetBitmap(),
+ aSemiTransp));
+#else
DrawBitmapEx(r.TopLeft(), aBitmap);
+#endif
}
void fetchDrawBitmap(Rectangle r)
{
+ // FIXME: should work ...
Bitmap aBitmap(GetBitmap(Point(0,0),GetSizePixel()));
aBitmap.Scale(r.GetSize(), BMP_SCALE_BESTQUALITY);
DrawBitmap(r.TopLeft(), aBitmap);
@@ -158,9 +173,13 @@ std::vector<Rectangle> DemoWin::partitionAndClear(int nX, int nY)
if ((x + y) % 2)
DrawRect(r);
else
+ {
+#ifdef FIXME_ROUNDED_RECT_WORKING
+ DrawRect(r, nBorderSize, nBorderSize);
+#else
DrawRect(r);
-// FIXME: rendering these guys doesn't work at all
-// DrawRect(r, nBorderSize, nBorderSize);
+#endif
+ }
aRegions.push_back(r);
}
@@ -181,7 +200,7 @@ void DemoWin::Paint( const Rectangle& rRect )
drawRadialLines(aRegions[i++]);
drawText(aRegions[i++]);
drawPoly(aRegions[i++]);
- drawPolyPoly(aRegions[i++]);
+ drawEllipse(aRegions[i++]);
drawCheckered(aRegions[i++]);
drawBitmapEx(aRegions[i++]);
drawBitmap(aRegions[i++]);
commit e2ed91f2e0f7c3e530ac4ad0ea231198dc20979c
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Fri Nov 7 11:34:31 2014 +0000
Make it easy to disable OpenGL in the environment.
Change-Id: I9ea0c9f7345e0cbad9ebb51ab724dada7ce77106
diff --git a/vcl/source/opengl/OpenGLHelper.cxx b/vcl/source/opengl/OpenGLHelper.cxx
index e30d607..4705e3f 100644
--- a/vcl/source/opengl/OpenGLHelper.cxx
+++ b/vcl/source/opengl/OpenGLHelper.cxx
@@ -360,7 +360,8 @@ void OpenGLHelper::checkGLError(const char* pFile, size_t nLine)
bool OpenGLHelper::supportsVCLOpenGL()
{
- return true;
+ static bool bDisableGL = !getenv("SAL_DISABLEGL");
+ return bDisableGL;
}
#if defined UNX && !defined MACOSX && !defined IOS && !defined ANDROID
More information about the Libreoffice-commits
mailing list