[Libreoffice-commits] core.git: Branch 'feature/opengl-vcl' - vcl/unx
vcl/unx/generic/window/salframe.cxx |5 - 1 file changed, 4 insertions(+), 1 deletion(-) New commits: commit 56eacc96ab9045b3d09bc2d9ec21b771e3139f5e Author: Michael Meeks Date: Sat Nov 15 16:09:03 2014 +0100 vcl: avoid crash with 'gen' backend around window icons. Change-Id: I4b2bedb9ac641fcb96d09afb2e60fa2c6186fd6b diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx index 6c98968..95d4ed8 100644 --- a/vcl/unx/generic/window/salframe.cxx +++ b/vcl/unx/generic/window/salframe.cxx @@ -276,9 +276,12 @@ static bool lcl_SelectAppIconPixmap( SalDisplay *pDisplay, SalX11Screen nXScreen aRect.mnDestX = 0; aRect.mnDestY = 0; aRect.mnDestWidth = iconSize; aRect.mnDestHeight = iconSize; -X11SalBitmap *pBitmap = static_cast < X11SalBitmap * > +X11SalBitmap *pBitmap = dynamic_cast < X11SalBitmap * > (aIcon.ImplGetBitmapImpBitmap()->ImplGetSalBitmap()); +if (!pBitmap) // FIXME: opengl +return false; + icon_pixmap = XCreatePixmap( pDisplay->GetDisplay(), pDisplay->GetRootWindow( nXScreen ), iconSize, iconSize, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/opengl-vcl' - vcl/unx
vcl/unx/generic/app/saldisp.cxx | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) New commits: commit 780616de98c0cee74e1ca4a0da6fb513c1c94ed9 Author: Jan Holesovsky Date: Fri Nov 14 17:04:25 2014 +0100 vcl: Stop-gap solution to start the gen / kde / kde4 plugins again. Change-Id: Ie538049aa8c4c0812d28b5c1bf91425822c55617 diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx index 159263a..c381dd9 100644 --- a/vcl/unx/generic/app/saldisp.cxx +++ b/vcl/unx/generic/app/saldisp.cxx @@ -73,6 +73,7 @@ #include #include +#include #include using namespace vcl_sal; @@ -191,9 +192,15 @@ bool SalDisplay::BestVisual( Display *pDisplay, if( nVID && sal_GetVisualInfo( pDisplay, nVID, rVI ) ) return rVI.visualid == nDefVID; -bool bUseOpenGL = officecfg::Office::Common::VCL::UseOpenGL::get(); -if( bUseOpenGL && OpenGLHelper::GetVisualInfo( pDisplay, nScreen, rVI ) ) -return rVI.visualid == nDefVID; +try { +bool bUseOpenGL = officecfg::Office::Common::VCL::UseOpenGL::get(); +if( bUseOpenGL && OpenGLHelper::GetVisualInfo( pDisplay, nScreen, rVI ) ) +return rVI.visualid == nDefVID; +} +catch (const css::uno::DeploymentException&) +{ +// too early to try to access configmgr +} XVisualInfo aVI; aVI.screen = nScreen; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/opengl-vcl' - vcl/unx
vcl/unx/kde/salnativewidgets-kde.cxx |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) New commits: commit ef76fbe1f53eb7f30c0837cfae8552143831dd50 Author: Markus Mohrhard Date: Fri Nov 14 15:02:16 2014 +0100 fix building the KDE backend Change-Id: I03c8629bf27a43d6f4cc08bb8f64ed71b9055fdc diff --git a/vcl/unx/kde/salnativewidgets-kde.cxx b/vcl/unx/kde/salnativewidgets-kde.cxx index aa86e31..a06fe1d 100644 --- a/vcl/unx/kde/salnativewidgets-kde.cxx +++ b/vcl/unx/kde/salnativewidgets-kde.cxx @@ -26,6 +26,7 @@ #include #include #include +#include "unx/pixmap.hxx" #include #include "fontmanager.hxx" @@ -314,7 +315,7 @@ class WidgetPainter */ bool drawStyledWidget( QWidget *pWidget, ControlState nState, const ImplControlValue& aValue, -KDESalGraphics* pGraphics, +X11SalGraphics* pGraphics, ControlPart nPart = PART_ENTIRE_CONTROL ); /** 'Get' method for push button. @@ -506,7 +507,7 @@ WidgetPainter::~WidgetPainter( void ) bool WidgetPainter::drawStyledWidget( QWidget *pWidget, ControlState nState, const ImplControlValue& aValue, -KDESalGraphics* pGraphics, ControlPart nPart ) +X11SalGraphics* pGraphics, ControlPart nPart ) { if ( !pWidget ) return false; @@ -853,7 +854,7 @@ bool WidgetPainter::drawStyledWidget( QWidget *pWidget, return false; // Bitblt it to the screen -pGraphics->RenderPixmapToScreen( xPixmap, qWidgetPos.x(), qWidgetPos.y() ); +pGraphics->RenderPixmapToScreen( &xPixmap, qWidgetPos.x(), qWidgetPos.y() ); // Restore widget's position pWidget->move( qWidgetPos ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/opengl-vcl' - vcl/unx
vcl/unx/generic/gdi/openglx11cairotextrender.cxx | 50 +++ vcl/unx/generic/gdi/openglx11cairotextrender.hxx | 26 +++ 2 files changed, 76 insertions(+) New commits: commit 70d1c7289ad9c2b36cfca9f931755e1c4f78a449 Author: Markus Mohrhard Date: Mon Nov 10 07:09:59 2014 +0100 forgot to add the files Change-Id: I44a7e9bec213514708e4c971479660574508ad1b diff --git a/vcl/unx/generic/gdi/openglx11cairotextrender.cxx b/vcl/unx/generic/gdi/openglx11cairotextrender.cxx new file mode 100644 index 000..9b7c49e --- /dev/null +++ b/vcl/unx/generic/gdi/openglx11cairotextrender.cxx @@ -0,0 +1,50 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include "openglx11cairotextrender.hxx" + +#include "salbmp.hxx" +#include + +#include + +OpenGLX11CairoTextRender::OpenGLX11CairoTextRender(bool bPrinter, X11SalGraphics& rParent): +X11CairoTextRender(bPrinter, rParent) +{ +} + +cairo_surface_t* OpenGLX11CairoTextRender::getCairoSurface() +{ +// static size_t id = 0; +// OString aFileName = OString("/tmp/libo_logs/text_rendering") + OString::number(id++) + OString(".svg"); +// cairo_surface_t* surface = cairo_svg_surface_create(aFileName.getStr(), GetWidth(), GetHeight()); +cairo_surface_t* surface = cairo_image_surface_create(CAIRO_FORMAT_RGB24, GetWidth(), GetHeight()); +return surface; +} + +void OpenGLX11CairoTextRender::drawSurface(cairo_t* cr) +{ +cairo_surface_t* surface = cairo_get_target(cr); +int width = cairo_image_surface_get_width(surface); +int height = cairo_image_surface_get_height(surface); +SalBitmap* pBitmap = ImplGetSVData()->mpDefInst->CreateSalBitmap(); +pBitmap->Create(Size(width, height), 24, BitmapPalette()); +BitmapBuffer* pBuffer = pBitmap->AcquireBuffer(false); +std::memcpy(pBuffer->mpBits, cairo_image_surface_get_data(surface), width*height*3); +pBitmap->ReleaseBuffer(pBuffer, false); +SalTwoRect aRect; +aRect.mnSrcX = 0; +aRect.mnSrcY = 0; +aRect.mnSrcWidth = width; +aRect.mnSrcHeight = height; +mrParent.drawBitmap(aRect, *pBitmap); +delete pBitmap; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/generic/gdi/openglx11cairotextrender.hxx b/vcl/unx/generic/gdi/openglx11cairotextrender.hxx new file mode 100644 index 000..87ef948 --- /dev/null +++ b/vcl/unx/generic/gdi/openglx11cairotextrender.hxx @@ -0,0 +1,26 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_VCL_UNX_GENERIC_GDI_OPENGLX11CAIROTEXTRENDER_HXX +#define INCLUDED_VCL_UNX_GENERIC_GDI_OPENGLX11CAIROTEXTRENDER_HXX value + +#include "x11cairotextrender.hxx" + +class OpenGLX11CairoTextRender : public X11CairoTextRender +{ +public: +OpenGLX11CairoTextRender(bool bPrinter, X11SalGraphics& rParent); + +virtual cairo_surface_t* getCairoSurface() SAL_OVERRIDE; +virtual void drawSurface(cairo_t* cr) SAL_OVERRIDE; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/opengl-vcl' - vcl/unx
vcl/unx/generic/gdi/x11windowprovider.cxx | 16 1 file changed, 16 insertions(+) New commits: commit 4c40b2887b2af4f2a604e51c5cb47274e87af12d Author: Markus Mohrhard Date: Tue Oct 28 12:33:22 2014 +0100 add missing file Change-Id: I2dcbc2f299c8994cd11e24f0beffe491d8f4f278 diff --git a/vcl/unx/generic/gdi/x11windowprovider.cxx b/vcl/unx/generic/gdi/x11windowprovider.cxx new file mode 100644 index 000..5eaa3f6 --- /dev/null +++ b/vcl/unx/generic/gdi/x11windowprovider.cxx @@ -0,0 +1,16 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include "unx/x11windowprovider.hxx" + +X11WindowProvider::~X11WindowProvider() +{ +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/opengl-vcl' - vcl/unx
vcl/unx/generic/gdi/gdiimpl.cxx | 368 vcl/unx/generic/gdi/gdiimpl.hxx | 58 +++--- vcl/unx/generic/gdi/salgdi.cxx |4 3 files changed, 216 insertions(+), 214 deletions(-) New commits: commit 4eaef1717266419880d9b3814215291adf6b931f Author: Markus Mohrhard Date: Fri Oct 24 01:47:02 2014 +0200 use m prefix instead of _ for member variables Change-Id: I9f73d653f3b5a4ec3eea91398977d4dfc2d478e7 diff --git a/vcl/unx/generic/gdi/gdiimpl.cxx b/vcl/unx/generic/gdi/gdiimpl.cxx index e95bee5..e5e98d0 100644 --- a/vcl/unx/generic/gdi/gdiimpl.cxx +++ b/vcl/unx/generic/gdi/gdiimpl.cxx @@ -122,29 +122,29 @@ namespace X11SalGraphicsImpl::X11SalGraphicsImpl(X11SalGraphics& rParent): mrParent(rParent), -nBrushColor_( MAKE_SALCOLOR( 0xFF, 0xFF, 0XFF ) ), -pBrushGC_(NULL), -nBrushPixel_(0), -bPenGC_(false), -bBrushGC_(false), -bMonoGC_(false), -bCopyGC_(false), -bInvertGC_(false), -bInvert50GC_(false), -bStippleGC_(false), -bTrackingGC_(false), -bDitherBrush_(false), -bXORMode_(false), -pPenGC_(NULL), -nPenColor_( MAKE_SALCOLOR( 0x00, 0x00, 0x00 ) ), -nPenPixel_(0), -pMonoGC_(NULL), -pCopyGC_(NULL), -pMaskGC_(NULL), -pInvertGC_(NULL), -pInvert50GC_(NULL), -pStippleGC_(NULL), -pTrackingGC_(NULL) +mnBrushColor( MAKE_SALCOLOR( 0xFF, 0xFF, 0XFF ) ), +mpBrushGC(NULL), +mnBrushPixel(0), +mbPenGC(false), +mbBrushGC(false), +mbMonoGC(false), +mbCopyGC(false), +mbInvertGC(false), +mbInvert50GC(false), +mbStippleGC(false), +mbTrackingGC(false), +mbDitherBrush(false), +mbXORMode(false), +mpPenGC(NULL), +mnPenColor( MAKE_SALCOLOR( 0x00, 0x00, 0x00 ) ), +mnPenPixel(0), +mpMonoGC(NULL), +mpCopyGC(NULL), +mpMaskGC(NULL), +mpInvertGC(NULL), +mpInvert50GC(NULL), +mpStippleGC(NULL), +mpTrackingGC(NULL) { } @@ -181,16 +181,16 @@ void X11SalGraphicsImpl::freeResources() { Display *pDisplay = mrParent.GetXDisplay(); -if( pPenGC_ ) XFreeGC( pDisplay, pPenGC_ ), pPenGC_ = None; -if( pBrushGC_ ) XFreeGC( pDisplay, pBrushGC_ ), pBrushGC_ = None; -if( pMonoGC_ ) XFreeGC( pDisplay, pMonoGC_ ), pMonoGC_ = None; -if( pTrackingGC_ ) XFreeGC( pDisplay, pTrackingGC_ ), pTrackingGC_ = None; -if( pCopyGC_ ) XFreeGC( pDisplay, pCopyGC_ ), pCopyGC_ = None; -if( pMaskGC_ ) XFreeGC( pDisplay, pMaskGC_ ), pMaskGC_ = None; -if( pInvertGC_ ) XFreeGC( pDisplay, pInvertGC_ ), pInvertGC_ = None; -if( pInvert50GC_ ) XFreeGC( pDisplay, pInvert50GC_ ), pInvert50GC_ = None; -if( pStippleGC_ ) XFreeGC( pDisplay, pStippleGC_ ), pStippleGC_ = None; -bTrackingGC_ = bPenGC_ = bBrushGC_ = bMonoGC_ = bCopyGC_ = bInvertGC_ = bInvert50GC_ = bStippleGC_ = false; +if( mpPenGC ) XFreeGC( pDisplay, mpPenGC ), mpPenGC = None; +if( mpBrushGC ) XFreeGC( pDisplay, mpBrushGC ), mpBrushGC = None; +if( mpMonoGC ) XFreeGC( pDisplay, mpMonoGC ), mpMonoGC = None; +if( mpTrackingGC ) XFreeGC( pDisplay, mpTrackingGC ), mpTrackingGC = None; +if( mpCopyGC ) XFreeGC( pDisplay, mpCopyGC ), mpCopyGC = None; +if( mpMaskGC ) XFreeGC( pDisplay, mpMaskGC ), mpMaskGC = None; +if( mpInvertGC ) XFreeGC( pDisplay, mpInvertGC ), mpInvertGC = None; +if( mpInvert50GC ) XFreeGC( pDisplay, mpInvert50GC ), mpInvert50GC = None; +if( mpStippleGC ) XFreeGC( pDisplay, mpStippleGC ), mpStippleGC = None; +mbTrackingGC = mbPenGC = mbBrushGC = mbMonoGC = mbCopyGC = mbInvertGC = mbInvert50GC = mbStippleGC = false; } GC X11SalGraphicsImpl::CreateGC( Drawable hDrawable, unsigned long nMask ) @@ -211,24 +211,24 @@ GC X11SalGraphicsImpl::CreateGC( Drawable hDrawable, unsigned long nMask ) inline GC X11SalGraphicsImpl::GetCopyGC() { -if( bXORMode_ ) return GetInvertGC(); +if( mbXORMode ) return GetInvertGC(); -if( !pCopyGC_ ) -pCopyGC_ = CreateGC( mrParent.GetDrawable() ); +if( !mpCopyGC ) +mpCopyGC = CreateGC( mrParent.GetDrawable() ); -if( !bCopyGC_ ) +if( !mbCopyGC ) { -mrParent.SetClipRegion( pCopyGC_ ); -bCopyGC_ = true; +mrParent.SetClipRegion( mpCopyGC ); +mbCopyGC = true; } -return pCopyGC_; +return mpCopyGC; } GC X11SalGraphicsImpl::GetTrackingGC() { const chardash_list[2] = {2, 2}; -if( !pTrackingGC_ ) +if( !mpTrackingGC ) { XGCValues values; @@ -239,56 +239,56 @@ GC X11SalGraphicsImpl::GetTrackingGC() values.line_width = 1; values.line_style = LineOnOffDash; -pTrackingGC_ = XCreateGC( mrParent.GetXDisplay(), mrParent.GetDrawable(), +mpTrackingGC = XCreateGC( mrParent.GetXDisplay(), mrParent.GetDrawable(), GCGraphicsExposures | GCForeground | GCFunction | GCLineWidth | GCLineStyle,