diff options
author | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2018-11-28 00:38:40 +0100 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2018-11-28 00:43:07 +0100 |
commit | 6c024b7c7ca511f670be72224a220e34230a3329 (patch) | |
tree | b5319d0f7ede85747de7182bd2b196a8faed809c | |
parent | Check isEmptyStringQuery() early to avoid call ..., tdf#121052 follow-up (diff) | |
download | core-private/thb/libo-6-1+backports.tar.gz core-private/thb/libo-6-1+backports.zip |
Disable the GL based 3D charts
private/thb/libo-6-1+backports
KDE5 currently does not support GL windows properly, so lets disable
that - this is the gist of 026e2623f7f498432e6dc970fb06145dfc77dc45
but with minimal footprint for easier branch maintenance.
Change-Id: I88113596e460c6300a826f821d918a761632047e
-rw-r--r-- | chart2/inc/ChartModel.hxx | 7 | ||||
-rw-r--r-- | chart2/source/controller/main/ChartWindow.cxx | 4 | ||||
-rw-r--r-- | chart2/source/model/main/ChartModel.cxx | 14 | ||||
-rw-r--r-- | chart2/source/model/template/ChartTypeManager.cxx | 12 | ||||
-rw-r--r-- | chart2/source/view/main/ChartView.cxx | 178 |
5 files changed, 0 insertions, 215 deletions
diff --git a/chart2/inc/ChartModel.hxx b/chart2/inc/ChartModel.hxx index 83dca2872772..44e873b02912 100644 --- a/chart2/inc/ChartModel.hxx +++ b/chart2/inc/ChartModel.hxx @@ -476,16 +476,9 @@ public: void removeDataProviders(); -#if HAVE_FEATURE_OPENGL - OpenGLWindow* getOpenGLWindow() { return mpOpenGLWindow;} -#endif - private: sal_Int32 mnStart; sal_Int32 mnEnd; -#if HAVE_FEATURE_OPENGL - VclPtr<OpenGLWindow> mpOpenGLWindow; -#endif }; } // namespace chart diff --git a/chart2/source/controller/main/ChartWindow.cxx b/chart2/source/controller/main/ChartWindow.cxx index a0f7c31de47d..a5080383d9c9 100644 --- a/chart2/source/controller/main/ChartWindow.cxx +++ b/chart2/source/controller/main/ChartWindow.cxx @@ -58,11 +58,7 @@ ChartWindow::ChartWindow( ChartController* pController, vcl::Window* pParent, Wi , m_pWindowController( pController ) , m_bInPaint(false) , m_pViewShellWindow( nullptr ) -#if HAVE_FEATURE_OPENGL - , m_pOpenGLWindow(VclPtr<OpenGLWindow>::Create(this, false)) -#else , m_pOpenGLWindow(nullptr) -#endif { set_id("chart_window"); SetHelpId( HID_SCH_WIN_DOCUMENT ); diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx index d0ceb73b88e7..c917f4d64a65 100644 --- a/chart2/source/model/main/ChartModel.cxx +++ b/chart2/source/model/main/ChartModel.cxx @@ -112,9 +112,6 @@ ChartModel::ChartModel(uno::Reference<uno::XComponentContext > const & xContext) "com.sun.star.xml.NamespaceMap", "com.sun.star.comp.chart.XMLNameSpaceMap" ), uno::UNO_QUERY) , mnStart(0) , mnEnd(0) -#if HAVE_FEATURE_OPENGL - , mpOpenGLWindow(nullptr) -#endif { osl_atomic_increment(&m_refCount); { @@ -156,9 +153,6 @@ ChartModel::ChartModel( const ChartModel & rOther ) , m_xInternalDataProvider( rOther.m_xInternalDataProvider ) , mnStart(rOther.mnStart) , mnEnd(rOther.mnEnd) -#if HAVE_FEATURE_OPENGL - , mpOpenGLWindow(nullptr) -#endif { osl_atomic_increment(&m_refCount); { @@ -1309,12 +1303,7 @@ void ChartModel::setTimeBasedRange(sal_Int32 nStart, sal_Int32 nEnd) void ChartModel::setWindow( const sal_uInt64 nWindowPtr ) { -#if HAVE_FEATURE_OPENGL - OpenGLWindow* pWindow = reinterpret_cast<OpenGLWindow*>(nWindowPtr); - mpOpenGLWindow = pWindow; -#else (void)nWindowPtr; -#endif } void ChartModel::update() @@ -1325,9 +1314,6 @@ void ChartModel::update() } mxChartView->setViewDirty(); mxChartView->update(); -#if HAVE_FEATURE_OPENGL - mxChartView->updateOpenGLWindow(); -#endif } bool ChartModel::isDataFromSpreadsheet() diff --git a/chart2/source/model/template/ChartTypeManager.cxx b/chart2/source/model/template/ChartTypeManager.cxx index bb9656f76692..1b81327efd1b 100644 --- a/chart2/source/model/template/ChartTypeManager.cxx +++ b/chart2/source/model/template/ChartTypeManager.cxx @@ -32,9 +32,6 @@ #include "NetChartTypeTemplate.hxx" #include "BubbleChartTypeTemplate.hxx" #include <config_features.h> -#if HAVE_FEATURE_OPENGL -#include "GL3DBarChartTypeTemplate.hxx" -#endif #include <cppuhelper/component_context.hxx> #include <cppuhelper/supportsservice.hxx> #include <com/sun/star/container/XContentEnumerationAccess.hpp> @@ -529,16 +526,7 @@ uno::Reference< uno::XInterface > SAL_CALL ChartTypeManager::createInstance( case TEMPLATE_BUBBLE: xTemplate.set( new BubbleChartTypeTemplate( m_xContext, aServiceSpecifier )); break; -#if HAVE_FEATURE_OPENGL - case TEMPLATE_GL3DBAR: - xTemplate.set(new GL3DBarChartTypeTemplate(m_xContext, aServiceSpecifier)); - break; - case TEMPLATE_GL3DBAR_ROUNDED_RECTANGLE: - xTemplate.set(new GL3DBarChartTypeTemplate(m_xContext, aServiceSpecifier)); - break; -#else default: break; -#endif // case TEMPLATE_SURFACE: // case TEMPLATE_ADDIN: // break; diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx index 22f268b19a4a..9b8e157afc28 100644 --- a/chart2/source/view/main/ChartView.cxx +++ b/chart2/source/view/main/ChartView.cxx @@ -50,9 +50,6 @@ #include <DateHelper.hxx> #include <defines.hxx> #include <unonames.hxx> -#if HAVE_FEATURE_OPENGL -#include <GL3DBarChart.hxx> -#endif #include <editeng/frmdiritem.hxx> #include <rtl/uuid.h> #include <tools/globname.hxx> @@ -70,9 +67,6 @@ #include <osl/mutex.hxx> #include <svx/unofill.hxx> #include <vcl/openglwin.hxx> -#if HAVE_FEATURE_OPENGL -#include <vcl/opengl/OpenGLContext.hxx> -#endif #include <drawinglayer/XShapeDumper.hxx> #include <time.h> @@ -1066,35 +1060,19 @@ public: virtual void scroll(long nDelta) override; virtual void contextDestroyed() override; -#if HAVE_FEATURE_OPENGL - const OpenGLWindow* getOpenGLWindow() const; - void updateOpenGLWindow(); -#endif private: ChartView* mpView; bool mbContextDestroyed; -#if HAVE_FEATURE_OPENGL - VclPtr<OpenGLWindow> mpWindow; -#endif }; GL2DRenderer::GL2DRenderer(ChartView* pView) : mpView(pView) , mbContextDestroyed(false) -#if HAVE_FEATURE_OPENGL - , mpWindow(mpView->mrChartModel.getOpenGLWindow()) -#endif { } GL2DRenderer::~GL2DRenderer() { -#if HAVE_FEATURE_OPENGL - SolarMutexGuard g; - if(!mbContextDestroyed && mpWindow) - mpWindow->setRenderer(nullptr); - mpWindow.reset(); -#endif } void GL2DRenderer::update() @@ -1120,36 +1098,6 @@ void GL2DRenderer::contextDestroyed() mbContextDestroyed = true; } -#if HAVE_FEATURE_OPENGL - -const OpenGLWindow* GL2DRenderer::getOpenGLWindow() const -{ - return mpWindow; -} - -void GL2DRenderer::updateOpenGLWindow() -{ - if(mbContextDestroyed) - return; - - OpenGLWindow* pWindow = mpView->mrChartModel.getOpenGLWindow(); - if(pWindow != mpWindow) - { - if(mpWindow) - { - mpWindow->setRenderer(nullptr); - } - - if(pWindow) - { - pWindow->setRenderer(this); - } - } - mpWindow = pWindow; -} - -#endif - const uno::Sequence<sal_Int8>& ExplicitValueProvider::getUnoTunnelId() { return theExplicitValueProviderUnoTunnelId::get().getSeq(); @@ -2582,11 +2530,7 @@ void ChartView::impl_refreshAddIn() bool ChartView::isReal3DChart() { uno::Reference< XDiagram > xDiagram( mrChartModel.getFirstDiagram() ); -#if HAVE_FEATURE_OPENGL - return ChartHelper::isGL3DDiagram(xDiagram); -#else return false; -#endif } static const char* envChartDummyFactory = getenv("CHART_DUMMY_FACTORY"); @@ -2629,24 +2573,6 @@ void ChartView::createShapes() } pShapeFactory->setPageSize(mxRootShape, aPageSize); pShapeFactory->clearPage(mxRootShape); -#if HAVE_FEATURE_OPENGL -#if HAVE_FEATURE_DESKTOP - if(isReal3DChart()) - { - createShapes3D(); - return; - } - else - { - m_pGL3DPlotter.reset(); - - // hide OpenGL window for now in normal charts - OpenGLWindow* pWindow = mrChartModel.getOpenGLWindow(); - if(pWindow && !envChartDummyFactory) - pWindow->Show(false); - } -#endif -#endif createShapes2D(aPageSize); @@ -2665,23 +2591,7 @@ void ChartView::createShapes() void ChartView::render() { -#if HAVE_FEATURE_OPENGL - if(!isReal3DChart()) - { - AbstractShapeFactory* pShapeFactory = AbstractShapeFactory::getOrCreateShapeFactory(m_xShapeFactory); - OpenGLWindow* pWindow = mrChartModel.getOpenGLWindow(); - if(pWindow) - pWindow->setRenderer(mp2DRenderer.get()); - bool bRender = pShapeFactory->preRender(mxRootShape, pWindow); - if(bRender) - { - pShapeFactory->render(mxRootShape, pWindow != mp2DRenderer->getOpenGLWindow()); - pShapeFactory->postRender(pWindow); - } - } -#else (void) this; -#endif } // util::XEventListener (base of XCloseListener) @@ -2720,11 +2630,6 @@ void ChartView::impl_updateView( bool bCheckLockedCtrler ) //create chart view { -#if HAVE_FEATURE_OPENGL - OpenGLWindow* pWindow = mrChartModel.getOpenGLWindow(); - if (pWindow && ChartHelper::isGL3DDiagram(mrChartModel.getFirstDiagram())) - pWindow->Initialize(); -#endif m_bViewDirty = false; m_bViewUpdatePending = false; createShapes(); @@ -3310,91 +3215,8 @@ bool ChartView::createAxisTitleShapes2D( CreateShapeParam2D& rParam, const css:: void ChartView::createShapes3D() { -#if HAVE_FEATURE_OPENGL - OpenGLWindow* pWindow = mrChartModel.getOpenGLWindow(); - if(!pWindow) - return; - - if( pWindow->GetSizePixel().Width() == 0 || pWindow->GetSizePixel().Height() == 0 ) - { - awt::Size aPageSize = mrChartModel.getVisualAreaSize( embed::Aspects::MSOLE_CONTENT ); - Size aSize = pWindow->LogicToPixel(Size(aPageSize.Width, aPageSize.Height), MapMode(MapUnit::Map100thMM)); - pWindow->SetSizePixel(aSize); - } - pWindow->Show(); - uno::Reference< XDiagram > xDiagram( mrChartModel.getFirstDiagram() ); - uno::Reference< XCoordinateSystemContainer > xCooSysContainer( xDiagram, uno::UNO_QUERY ); - if( !xCooSysContainer.is()) - return; - - uno::Sequence< uno::Reference< XCoordinateSystem > > aCooSysList( xCooSysContainer->getCoordinateSystems() ); - - if (aCooSysList.getLength() != 1) - // Supporting multiple coordinates in a truly 3D chart (which implies - // it's a Cartesian coordinate system) is a bit of a challenge, if not - // impossible. - return; - - uno::Reference<XCoordinateSystem> xCooSys( aCooSysList[0] ); - - //iterate through all chart types in the current coordinate system - uno::Reference< XChartTypeContainer > xChartTypeContainer( xCooSys, uno::UNO_QUERY ); - OSL_ASSERT( xChartTypeContainer.is()); - if( !xChartTypeContainer.is() ) - return; - - uno::Sequence< uno::Reference< XChartType > > aChartTypeList( xChartTypeContainer->getChartTypes() ); - if (aChartTypeList.getLength() != 1) - // Likewise, we can't really support multiple chart types here. - return; - - uno::Reference< XChartType > xChartType( aChartTypeList[0] ); - - if (!m_pGL3DPlotter) - { - m_pGL3DPlotter.reset(new GL3DBarChart(xChartType, pWindow)); - } - else - { - GL3DBarChart* pChart = dynamic_cast<GL3DBarChart*>(m_pGL3DPlotter.get()); - if (pChart) - pChart->setOpenGLWindow(pWindow); - } - - uno::Reference< XDataSeriesContainer > xDataSeriesContainer( xChartType, uno::UNO_QUERY ); - OSL_ASSERT( xDataSeriesContainer.is()); - if( !xDataSeriesContainer.is() ) - return; - - std::vector<std::unique_ptr<VDataSeries> > aDataSeries; - uno::Sequence< uno::Reference< XDataSeries > > aSeriesList( xDataSeriesContainer->getDataSeries() ); - for( sal_Int32 nS = 0; nS < aSeriesList.getLength(); ++nS ) - { - uno::Reference< XDataSeries > xDataSeries( aSeriesList[nS], uno::UNO_QUERY ); - if(!xDataSeries.is()) - continue; - - aDataSeries.push_back(o3tl::make_unique<VDataSeries>(xDataSeries)); - } - - std::unique_ptr<ExplicitCategoriesProvider> pCatProvider(new ExplicitCategoriesProvider(xCooSys, mrChartModel)); - - m_pGL3DPlotter->create3DShapes(aDataSeries, *pCatProvider); - - m_pGL3DPlotter->render(); -#endif -} - -#if HAVE_FEATURE_OPENGL - -void ChartView::updateOpenGLWindow() -{ - if(!isReal3DChart()) - mp2DRenderer->updateOpenGLWindow(); } -#endif - } //namespace chart extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * |