diff options
-rw-r--r-- | vcl/Library_vclplug_gen.mk | 1 | ||||
-rw-r--r-- | vcl/inc/unx/saldisp.hxx | 3 | ||||
-rw-r--r-- | vcl/inc/unx/salgdi.h | 2 | ||||
-rw-r--r-- | vcl/inc/unx/x11/xrender_peer.hxx | 165 | ||||
-rw-r--r-- | vcl/unx/generic/app/saldisp.cxx | 4 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx | 4 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx | 5 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/gdiimpl.cxx | 162 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/gdiimpl.hxx | 26 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/salgdi.cxx | 19 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/salgdi2.cxx | 1 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/xrender_peer.cxx | 48 |
12 files changed, 10 insertions, 430 deletions
diff --git a/vcl/Library_vclplug_gen.mk b/vcl/Library_vclplug_gen.mk index ca29dca1bc9d..03b0158a8736 100644 --- a/vcl/Library_vclplug_gen.mk +++ b/vcl/Library_vclplug_gen.mk @@ -106,7 +106,6 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_gen,\ vcl/unx/generic/gdi/font \ vcl/unx/generic/gdi/salgdi \ vcl/unx/generic/gdi/salvd \ - vcl/unx/generic/gdi/xrender_peer \ vcl/unx/generic/window/salframe \ vcl/unx/generic/window/salobj \ vcl/unx/x11/x11sys \ diff --git a/vcl/inc/unx/saldisp.hxx b/vcl/inc/unx/saldisp.hxx index 83f847d4d78c..eed51ef8b41f 100644 --- a/vcl/inc/unx/saldisp.hxx +++ b/vcl/inc/unx/saldisp.hxx @@ -230,9 +230,8 @@ public: struct RenderEntry { Pixmap m_aPixmap; - Picture m_aPicture; - RenderEntry() : m_aPixmap( 0 ), m_aPicture( 0 ) {} + RenderEntry() : m_aPixmap( 0 ) {} }; typedef std::unordered_map<int,RenderEntry> RenderEntryMap; diff --git a/vcl/inc/unx/salgdi.h b/vcl/inc/unx/salgdi.h index c146e4c40e85..ed0a9d10ad9e 100644 --- a/vcl/inc/unx/salgdi.h +++ b/vcl/inc/unx/salgdi.h @@ -101,7 +101,6 @@ public: virtual SalGraphicsImpl* GetImpl() const override; SalGeometryProvider* GetGeometryProvider() const; void SetDrawable(Drawable d, cairo_surface_t* surface, SalX11Screen nXScreen); - XRenderPictFormat* GetXRenderFormat() const; void SetXRenderFormat( XRenderPictFormat* pXRenderFormat ) { m_pXRenderFormat = pXRenderFormat; } const SalX11Screen& GetScreenNumber() const { return m_nXScreen; } @@ -168,7 +167,6 @@ private: SalX11Screen m_nXScreen; mutable XRenderPictFormat* m_pXRenderFormat; - XID m_aXRenderPicture; Region mpClipRegion; Pixmap hBrush_; // Dither diff --git a/vcl/inc/unx/x11/xrender_peer.hxx b/vcl/inc/unx/x11/xrender_peer.hxx deleted file mode 100644 index e1006f88ed44..000000000000 --- a/vcl/inc/unx/x11/xrender_peer.hxx +++ /dev/null @@ -1,165 +0,0 @@ -/* -*- 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/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_VCL_UNX_X11_XRENDER_PEER_HXX -#define INCLUDED_VCL_UNX_X11_XRENDER_PEER_HXX - -#include <X11/Xlib.h> -#include <X11/Xutil.h> -struct _XTrap; // on some older systems this is not declared within Xrender.h -#include <X11/extensions/Xrender.h> - -#include <tools/color.hxx> - - -class XRenderPeer -{ -public: - static XRenderPeer& GetInstance(); - -private: - XRenderPeer(); - void InitRenderLib(); - - Display* mpDisplay; - XRenderPictFormat* mpStandardFormatA8; - -public: - XRenderPictFormat* GetStandardFormatA8() const; - XRenderPictFormat* FindStandardFormat(int nFormat) const; - - // the methods below are thin wrappers for the XRENDER API - XRenderPictFormat* FindVisualFormat( Visual const * ) const; - Picture CreatePicture( Drawable, const XRenderPictFormat*, - unsigned long nDrawable, const XRenderPictureAttributes* ) const; - void ChangePicture( Picture, unsigned long nValueMask, - const XRenderPictureAttributes* ) const; - void SetPictureClipRegion( Picture, Region ) const; - void CompositePicture( int nOp, Picture aSrc, Picture aMask, Picture aDst, - int nXSrc, int nYSrc, - int nXDst, int nYDst, unsigned nWidth, unsigned nHeight ) const; - void FreePicture( Picture ) const; - - void FillRectangle( int nOp, Picture aDst, const XRenderColor*, - int nX, int nY, unsigned nW, unsigned nH ) const; - void CompositeTrapezoids( int nOp, Picture aSrc, Picture aDst, - const XRenderPictFormat*, int nXSrc, int nYSrc, - const XTrapezoid*, int nCount ) const; - void CompositeTriangles( int nOp, Picture aSrc, Picture aDst, - const XRenderPictFormat*, int nXSrc, int nYSrc, - const XTriangle*, int nCount ) const; -}; - -inline XRenderPictFormat* XRenderPeer::GetStandardFormatA8() const -{ - return mpStandardFormatA8; -} - -inline XRenderPictFormat* XRenderPeer::FindStandardFormat(int nFormat) const -{ - return XRenderFindStandardFormat(mpDisplay, nFormat); -} - -inline XRenderPictFormat* XRenderPeer::FindVisualFormat( Visual const * pVisual ) const -{ - return XRenderFindVisualFormat ( mpDisplay, pVisual ); -} - -inline Picture XRenderPeer::CreatePicture( Drawable aDrawable, - const XRenderPictFormat* pVisFormat, unsigned long nValueMask, - const XRenderPictureAttributes* pRenderAttr ) const -{ - return XRenderCreatePicture( mpDisplay, aDrawable, pVisFormat, - nValueMask, pRenderAttr ); -} - -inline void XRenderPeer::ChangePicture( Picture aPicture, - unsigned long nValueMask, const XRenderPictureAttributes* pRenderAttr ) const -{ - XRenderChangePicture( mpDisplay, aPicture, nValueMask, pRenderAttr ); -} - -inline void XRenderPeer::SetPictureClipRegion( Picture aPicture, - Region aXlibRegion ) const -{ - XRenderSetPictureClipRegion( mpDisplay, aPicture, aXlibRegion ); -} - -inline void XRenderPeer::CompositePicture( int nXRenderOp, - Picture aSrcPic, Picture aMaskPic, Picture aDstPic, - int nSrcX, int nSrcY, int nDstX, int nDstY, - unsigned nWidth, unsigned nHeight ) const -{ - XRenderComposite( mpDisplay, nXRenderOp, aSrcPic, aMaskPic, aDstPic, - nSrcX, nSrcY, 0/*nMaskX*/, 0/*nMaskY*/, nDstX, nDstY, nWidth, nHeight ); -} - -inline void XRenderPeer::FreePicture( Picture aPicture ) const -{ - XRenderFreePicture( mpDisplay, aPicture ); -} - -inline void XRenderPeer::FillRectangle( int a, Picture b, const XRenderColor* c, - int d, int e, unsigned int f, unsigned int g) const -{ - XRenderFillRectangle( mpDisplay, a, b, c, d, e, f, g ); -} - -inline void XRenderPeer::CompositeTrapezoids( int nOp, - Picture aSrc, Picture aDst, const XRenderPictFormat* pXRPF, - int nXSrc, int nYSrc, const XTrapezoid* pXT, int nCount ) const -{ - XRenderCompositeTrapezoids( mpDisplay, nOp, aSrc, aDst, pXRPF, - nXSrc, nYSrc, pXT, nCount ); -} - -inline void XRenderPeer::CompositeTriangles( int nOp, - Picture aSrc, Picture aDst, const XRenderPictFormat* pXRPF, - int nXSrc, int nYSrc, const XTriangle* pXT, int nCount ) const -{ - XRenderCompositeTriangles( mpDisplay, nOp, aSrc, aDst, pXRPF, - nXSrc, nYSrc, pXT, nCount ); -} - -inline XRenderColor GetXRenderColor( Color rColor, double fTransparency ) -{ - XRenderColor aRetVal; - // convert the Color - aRetVal.red = rColor.GetRed(); aRetVal.red |= (aRetVal.red << 8); - aRetVal.green = rColor.GetGreen(); aRetVal.green |= (aRetVal.green << 8); - aRetVal.blue = rColor.GetBlue(); aRetVal.blue |= (aRetVal.blue << 8); - - // handle transparency - aRetVal.alpha = 0xFFFF; // default to opaque - if( fTransparency != 0 ) - { - const double fAlpha = 1.0 - fTransparency; - aRetVal.alpha = static_cast<sal_uInt16>(fAlpha * 0xFFFF + 0.5); - // xrender wants pre-multiplied colors - aRetVal.red = static_cast<sal_uInt16>(fAlpha * aRetVal.red + 0.5); - aRetVal.green = static_cast<sal_uInt16>(fAlpha * aRetVal.green + 0.5); - aRetVal.blue = static_cast<sal_uInt16>(fAlpha * aRetVal.blue + 0.5); - } - - return aRetVal; -} - -#endif // INCLUDED_VCL_UNX_X11_XRENDER_PEER_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx index edb14824c246..4a5536b8f24b 100644 --- a/vcl/unx/generic/app/saldisp.cxx +++ b/vcl/unx/generic/app/saldisp.cxx @@ -63,7 +63,6 @@ #include <unx/salobj.h> #include <unx/sm.hxx> #include <unx/wmadaptor.hxx> -#include <unx/x11/xrender_peer.hxx> #include <unx/glyphcache.hxx> #include <poll.h> @@ -289,7 +288,6 @@ void SalDisplay::doDestruct() SalDisplay* pSalDisp = vcl_sal::getSalDisplay(pData); Display* const pX11Disp = pSalDisp->GetDisplay(); int nMaxScreens = pSalDisp->GetXScreenCount(); - XRenderPeer& rRenderPeer = XRenderPeer::GetInstance(); for (int i = 0; i < nMaxScreens; i++) { @@ -298,8 +296,6 @@ void SalDisplay::doDestruct() { if (elem.second.m_aPixmap) ::XFreePixmap(pX11Disp, elem.second.m_aPixmap); - if (elem.second.m_aPicture) - rRenderPeer.FreePicture(elem.second.m_aPicture); } rMap.clear(); } diff --git a/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx b/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx index 5a2e5c99ca20..7d572ee997f6 100644 --- a/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx +++ b/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx @@ -189,6 +189,10 @@ std::shared_ptr<SalBitmap> X11CairoSalGraphicsImpl::getBitmap(tools::Long nX, to return mrCairoCommon.getBitmap(nX, nY, nWidth, nHeight); } +void X11CairoSalGraphicsImpl::Init() {} + +void X11CairoSalGraphicsImpl::freeResources() {} + bool X11CairoSalGraphicsImpl::drawPolyLineBezier(sal_uInt32, const Point*, const PolyFlags*) { return false; diff --git a/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx b/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx index 3dcc628cf333..ce6b01a97fe0 100644 --- a/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx +++ b/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx @@ -32,6 +32,8 @@ private: public: X11CairoSalGraphicsImpl(X11SalGraphics& rParent, CairoCommon& rCairoCommon); + void Init() override; + virtual OUString getRenderBackendName() const override { return "gen"; } void ResetClipRegion() override @@ -57,7 +59,6 @@ public: void SetXORMode(bool bSet, bool bInvertOnly) override { mrCairoCommon.SetXORMode(bSet, bInvertOnly); - X11SalGraphicsImpl::SetXORMode(bSet, bInvertOnly); } void SetROPLineColor(SalROPColor nROPColor) override @@ -178,6 +179,8 @@ public: const SalBitmap& rMaskBitmap, const SalBitmap& rAlphaBitmap) override; bool supportsOperation(OutDevSupportType eType) const override; + + void freeResources() override; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/generic/gdi/gdiimpl.cxx b/vcl/unx/generic/gdi/gdiimpl.cxx index 31327437852b..8fc34a59e6c1 100644 --- a/vcl/unx/generic/gdi/gdiimpl.cxx +++ b/vcl/unx/generic/gdi/gdiimpl.cxx @@ -36,7 +36,6 @@ #include <unx/salvd.h> #include <unx/x11/xlimits.hxx> #include <salframe.hxx> -#include <unx/x11/xrender_peer.hxx> #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolypolygon.hxx> @@ -53,14 +52,7 @@ typedef unsigned long Pixel; X11SalGraphicsImpl::X11SalGraphicsImpl(X11SalGraphics& rParent): - mrParent(rParent), - mbCopyGC(false), - mbInvertGC(false), - mbStippleGC(false), - mbXORMode(false), - mpCopyGC(nullptr), - mpInvertGC(nullptr), - mpStippleGC(nullptr) + mrParent(rParent) { } @@ -68,129 +60,11 @@ X11SalGraphicsImpl::~X11SalGraphicsImpl() { } -void X11SalGraphicsImpl::Init() -{ -} - -XID X11SalGraphicsImpl::GetXRenderPicture() -{ - XRenderPeer& rRenderPeer = XRenderPeer::GetInstance(); - - if( !mrParent.m_aXRenderPicture ) - { - // check xrender support for matching visual - XRenderPictFormat* pXRenderFormat = mrParent.GetXRenderFormat(); - if( !pXRenderFormat ) - return 0; - // get the matching xrender target for drawable - mrParent.m_aXRenderPicture = rRenderPeer.CreatePicture( mrParent.GetDrawable(), pXRenderFormat, 0, nullptr ); - } - - { - // reset clip region - // TODO: avoid clip reset if already done - XRenderPictureAttributes aAttr; - aAttr.clip_mask = None; - rRenderPeer.ChangePicture( mrParent.m_aXRenderPicture, CPClipMask, &aAttr ); - } - - return mrParent.m_aXRenderPicture; -} - -static void freeGC(Display *pDisplay, GC& rGC) -{ - if( rGC ) - { - XFreeGC( pDisplay, rGC ); - rGC = None; - } -} - -void X11SalGraphicsImpl::freeResources() -{ - Display *pDisplay = mrParent.GetXDisplay(); - - freeGC( pDisplay, mpCopyGC ); - freeGC( pDisplay, mpInvertGC ); - freeGC( pDisplay, mpStippleGC ); - mbCopyGC = mbInvertGC = mbStippleGC = false; -} - -GC X11SalGraphicsImpl::CreateGC( Drawable hDrawable, unsigned long nMask ) -{ - XGCValues values; - - values.graphics_exposures = False; - values.foreground = mrParent.GetColormap().GetBlackPixel() - ^ mrParent.GetColormap().GetWhitePixel(); - values.function = GXxor; - values.line_width = 1; - values.fill_style = FillStippled; - values.stipple = mrParent.GetDisplay()->GetInvert50( mrParent.m_nXScreen ); - values.subwindow_mode = ClipByChildren; - - return XCreateGC( mrParent.GetXDisplay(), hDrawable, nMask | GCSubwindowMode, &values ); -} - -inline GC X11SalGraphicsImpl::GetCopyGC() -{ - if( mbXORMode ) return GetInvertGC(); - - if( !mpCopyGC ) - mpCopyGC = CreateGC( mrParent.GetDrawable() ); - - if( !mbCopyGC ) - { - mrParent.SetClipRegion( mpCopyGC ); - mbCopyGC = true; - } - return mpCopyGC; -} - -GC X11SalGraphicsImpl::GetInvertGC() -{ - if( !mpInvertGC ) - mpInvertGC = CreateGC( mrParent.GetDrawable(), - GCGraphicsExposures - | GCForeground - | GCFunction - | GCLineWidth ); - - if( !mbInvertGC ) - { - mrParent.SetClipRegion( mpInvertGC ); - mbInvertGC = true; - } - return mpInvertGC; -} - -inline GC X11SalGraphicsImpl::GetStippleGC() -{ - if( !mpStippleGC ) - mpStippleGC = CreateGC( mrParent.GetDrawable(), - GCGraphicsExposures - | GCFillStyle - | GCLineWidth ); - - if( !mbStippleGC ) - { - XSetFunction( mrParent.GetXDisplay(), mpStippleGC, mbXORMode ? GXxor : GXcopy ); - mrParent.SetClipRegion( mpStippleGC ); - mbStippleGC = true; - } - - return mpStippleGC; -} - void X11SalGraphicsImpl::ResetClipRegion() { if( !mrParent.mpClipRegion ) return; - mbCopyGC = false; - mbInvertGC = false; - mbStippleGC = false; - XDestroyRegion( mrParent.mpClipRegion ); mrParent.mpClipRegion = nullptr; } @@ -225,29 +99,6 @@ void X11SalGraphicsImpl::setClipRegion( const vcl::Region& i_rClip ) } } - //ImplRegionInfo aInfo; - //long nX, nY, nW, nH; - //bool bRegionRect = i_rClip.ImplGetFirstRect(aInfo, nX, nY, nW, nH ); - //while( bRegionRect ) - //{ - // if ( nW && nH ) - // { - // XRectangle aRect; - // aRect.x = (short)nX; - // aRect.y = (short)nY; - // aRect.width = (unsigned short)nW; - // aRect.height = (unsigned short)nH; - - // XUnionRectWithRegion( &aRect, mrParent.mpClipRegion, mrParent.mpClipRegion ); - // } - // bRegionRect = i_rClip.ImplGetNextRect( aInfo, nX, nY, nW, nH ); - //} - - // done, invalidate GCs - mbCopyGC = false; - mbInvertGC = false; - mbStippleGC = false; - if( XEmptyRegion( mrParent.mpClipRegion ) ) { XDestroyRegion( mrParent.mpClipRegion ); @@ -255,17 +106,6 @@ void X11SalGraphicsImpl::setClipRegion( const vcl::Region& i_rClip ) } } -void X11SalGraphicsImpl::SetXORMode( bool bSet, bool ) -{ - if (mbXORMode != bSet) - { - mbXORMode = bSet; - mbCopyGC = false; - mbInvertGC = false; - mbStippleGC = false; - } -} - tools::Long X11SalGraphicsImpl::GetGraphicsHeight() const { if( mrParent.m_pFrame ) diff --git a/vcl/unx/generic/gdi/gdiimpl.hxx b/vcl/unx/generic/gdi/gdiimpl.hxx index cecd2a480626..5af5491c3bc0 100644 --- a/vcl/unx/generic/gdi/gdiimpl.hxx +++ b/vcl/unx/generic/gdi/gdiimpl.hxx @@ -44,33 +44,12 @@ class X11SalGraphicsImpl : public SalGraphicsImpl, public X11GraphicsImpl private: X11SalGraphics& mrParent; - bool mbCopyGC : 1; // is Copy GC valid - bool mbInvertGC : 1; // is Invert GC valid - bool mbStippleGC : 1; // is Stipple GC valid - - bool mbXORMode : 1; // is ROP XOR Mode set - - GC mpCopyGC; - GC mpInvertGC; - GC mpStippleGC; - - GC CreateGC( Drawable hDrawable, - unsigned long nMask = GCGraphicsExposures ); - - inline GC GetCopyGC(); - inline GC GetStippleGC(); - GC GetInvertGC(); - - XID GetXRenderPicture(); - tools::Long GetGraphicsHeight() const; public: explicit X11SalGraphicsImpl(X11SalGraphics& rParent); - virtual void freeResources() override; - virtual ~X11SalGraphicsImpl() override; virtual void setClipRegion( const vcl::Region& ) override; @@ -83,11 +62,6 @@ public: // set the clip region to empty virtual void ResetClipRegion() override; - - // enable/disable XOR drawing - virtual void SetXORMode( bool bSet, bool bInvertOnly ) override; -public: - void Init() override; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/generic/gdi/salgdi.cxx b/vcl/unx/generic/gdi/salgdi.cxx index e17f73050732..6a534ac4e236 100644 --- a/vcl/unx/generic/gdi/salgdi.cxx +++ b/vcl/unx/generic/gdi/salgdi.cxx @@ -54,7 +54,6 @@ #include <unx/salframe.h> #include <unx/x11/x11cairotextrender.hxx> -#include <unx/x11/xrender_peer.hxx> #include "cairo_xlib_cairo.hxx" #include <cairo-xlib.h> @@ -85,7 +84,6 @@ X11SalGraphics::X11SalGraphics(): m_pVDev(nullptr), m_nXScreen( 0 ), m_pXRenderFormat(nullptr), - m_aXRenderPicture(0), mpClipRegion(nullptr), hBrush_(None), bWindow_(false), @@ -134,11 +132,6 @@ void X11SalGraphics::freeResources() m_pDeleteColormap.reset(); maX11Common.m_pColormap = nullptr; } - if( m_aXRenderPicture ) - { - XRenderPeer::GetInstance().FreePicture( m_aXRenderPicture ); - m_aXRenderPicture = 0; - } } SalGraphicsImpl* X11SalGraphics::GetImpl() const @@ -170,11 +163,6 @@ void X11SalGraphics::SetDrawable(Drawable aDrawable, cairo_surface_t* pSurface, maX11Common.m_hDrawable = aDrawable; SetXRenderFormat( nullptr ); - if( m_aXRenderPicture ) - { - XRenderPeer::GetInstance().FreePicture( m_aXRenderPicture ); - m_aXRenderPicture = 0; - } } void X11SalGraphics::Init( X11SalFrame& rFrame, Drawable aTarget, @@ -344,13 +332,6 @@ void X11SalGraphics::GetResolution( sal_Int32 &rDPIX, sal_Int32 &rDPIY ) // cons rDPIX = rDPIY; // y-resolution is more trustworthy } -XRenderPictFormat* X11SalGraphics::GetXRenderFormat() const -{ - if( m_pXRenderFormat == nullptr ) - m_pXRenderFormat = XRenderPeer::GetInstance().FindVisualFormat( GetVisual().visual ); - return m_pXRenderFormat; -} - SystemGraphicsData X11SalGraphics::GetGraphicsData() const { SystemGraphicsData aRes; diff --git a/vcl/unx/generic/gdi/salgdi2.cxx b/vcl/unx/generic/gdi/salgdi2.cxx index f26048ae1649..ee96a757acb0 100644 --- a/vcl/unx/generic/gdi/salgdi2.cxx +++ b/vcl/unx/generic/gdi/salgdi2.cxx @@ -23,7 +23,6 @@ #include <unx/saldisp.hxx> #include <unx/salgdi.h> -#include <unx/x11/xrender_peer.hxx> #include <salframe.hxx> extern "C" diff --git a/vcl/unx/generic/gdi/xrender_peer.cxx b/vcl/unx/generic/gdi/xrender_peer.cxx deleted file mode 100644 index 961f4cd3aefc..000000000000 --- a/vcl/unx/generic/gdi/xrender_peer.cxx +++ /dev/null @@ -1,48 +0,0 @@ -/* -*- 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/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include <unx/saldisp.hxx> - -#include <unx/x11/xrender_peer.hxx> - -XRenderPeer::XRenderPeer() - : mpDisplay( vcl_sal::getSalDisplay(GetGenericUnixSalData())->GetDisplay() ) - , mpStandardFormatA8( nullptr ) -{ - InitRenderLib(); -} - -XRenderPeer& XRenderPeer::GetInstance() -{ - static XRenderPeer aPeer; - return aPeer; -} - -void XRenderPeer::InitRenderLib() -{ - int nDummy; - // needed to initialize libXrender internals - XRenderQueryExtension( mpDisplay, &nDummy, &nDummy ); - - // the 8bit alpha mask format must be there - XRenderPictFormat aPictFormat={0,0,8,{0,0,0,0,0,0,0,0xFF},0}; - mpStandardFormatA8 = XRenderFindFormat( mpDisplay, PictFormatAlphaMask|PictFormatDepth, &aPictFormat, 0 ); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |