diff options
author | Michael Meeks <michael.meeks@suse.com> | 2013-06-10 12:24:10 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2013-06-11 14:41:50 +0100 |
commit | 056c7b46d42c9cb891cb269a2561f1cf34cafe10 (patch) | |
tree | 38796501a62da442db6f771f87075311a60ced65 /vcl | |
parent | 85165a18e9f8123d80246bedfad0acd8a314f715 (diff) |
Revert "pass argb32 pixmaps from vcl to canvas, avoiding costly x11 ...
This reverts commit 22f63477a3300d474c3d6832232b888f75c7290c.
Conflicts:
canvas/source/cairo/cairo_canvasbitmap.cxx
Change-Id: Ib266050ebc6eaca4fbd36ed013ac95a1b4b9d316
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/unx/salbmp.h | 4 | ||||
-rw-r--r-- | vcl/source/gdi/bitmap.cxx | 13 | ||||
-rw-r--r-- | vcl/source/helper/canvastools.cxx | 25 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/salbmp.cxx | 16 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/salgdi2.cxx | 4 |
5 files changed, 7 insertions, 55 deletions
diff --git a/vcl/inc/unx/salbmp.h b/vcl/inc/unx/salbmp.h index 0fc98843bc7f..ea69da44d611 100644 --- a/vcl/inc/unx/salbmp.h +++ b/vcl/inc/unx/salbmp.h @@ -81,7 +81,6 @@ public: SAL_DLLPRIVATE bool ImplCreateFromDrawable( Drawable aDrawable, - void* pVisual, SalX11Screen nXScreen, long nDrawableDepth, long nX, @@ -164,7 +163,6 @@ class ImplSalDDB private: Pixmap maPixmap; - void* mpVisual; SalTwoRect maTwoRect; long mnDepth; SalX11Screen mnXScreen; @@ -196,7 +194,6 @@ public: ImplSalDDB( Drawable aDrawable, - void *pVisual, SalX11Screen nXScreen, long nDrawableDepth, long nX, @@ -208,7 +205,6 @@ public: ~ImplSalDDB(); Pixmap ImplGetPixmap() const { return maPixmap; } - void* ImplGetVisual() const { return mpVisual; } long ImplGetWidth() const { return maTwoRect.mnDestWidth; } long ImplGetHeight() const { return maTwoRect.mnDestHeight; } long ImplGetDepth() const { return mnDepth; } diff --git a/vcl/source/gdi/bitmap.cxx b/vcl/source/gdi/bitmap.cxx index 3520159d9237..2bb1a9d55889 100644 --- a/vcl/source/gdi/bitmap.cxx +++ b/vcl/source/gdi/bitmap.cxx @@ -1812,17 +1812,4 @@ bool Bitmap::GetSystemData( BitmapSystemData& rData ) const return bRet; } -bool Bitmap::HasAlpha() -{ - bool bRet = false; - if( mpImpBmp ) - { - SalBitmap* pSalBitmap = mpImpBmp->ImplGetSalBitmap(); - if( pSalBitmap ) - bRet = pSalBitmap->HasAlpha(); - } - - return bRet; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/helper/canvastools.cxx b/vcl/source/helper/canvastools.cxx index ae48e4b41a54..9ba85d0585c8 100644 --- a/vcl/source/helper/canvastools.cxx +++ b/vcl/source/helper/canvastools.cxx @@ -21,8 +21,6 @@ #include <rtl/logfile.hxx> #include <cppuhelper/compbase1.hxx> -#include <com/sun/star/beans/XFastPropertySet.hpp> - #include <com/sun/star/geometry/RealSize2D.hpp> #include <com/sun/star/geometry/RealPoint2D.hpp> #include <com/sun/star/geometry/RealRectangle2D.hpp> @@ -72,32 +70,11 @@ namespace vcl { namespace unotools { - uno::Reference< rendering::XBitmap > xBitmapFromBitmapEx( const uno::Reference< rendering::XGraphicDevice >& xGraphicDevice, + uno::Reference< rendering::XBitmap > xBitmapFromBitmapEx( const uno::Reference< rendering::XGraphicDevice >& /*xGraphicDevice*/, const ::BitmapEx& inputBitmap ) { RTL_LOGFILE_CONTEXT( aLog, "::vcl::unotools::xBitmapFromBitmapEx()" ); - if ( inputBitmap.GetBitmap().HasAlpha() ) - { - geometry::IntegerSize2D aSize; - - aSize.Width = aSize.Height = 1; - - uno::Reference< rendering::XBitmap > xBitmap = xGraphicDevice->createCompatibleAlphaBitmap( aSize ); - - uno::Reference< beans::XFastPropertySet > rPropSet( xBitmap, uno::UNO_QUERY ); - if ( rPropSet.is() ) - { - Bitmap aBitmap = inputBitmap.GetBitmap(); - rPropSet->setFastPropertyValue( 0, uno::Any( sal_Int64( &aBitmap ))); - - aSize = xBitmap->getSize(); - - if ( aSize.Width != 1 || aSize.Height != 1 ) - return xBitmap; - } - } - return new vcl::unotools::VclCanvasBitmap( inputBitmap ); } diff --git a/vcl/unx/generic/gdi/salbmp.cxx b/vcl/unx/generic/gdi/salbmp.cxx index 9c7a798ed274..bc4d8c71c210 100644 --- a/vcl/unx/generic/gdi/salbmp.cxx +++ b/vcl/unx/generic/gdi/salbmp.cxx @@ -567,7 +567,6 @@ XImage* X11SalBitmap::ImplCreateXImage( // ----------------------------------------------------------------------------- bool X11SalBitmap::ImplCreateFromDrawable( Drawable aDrawable, - void *pVisual, SalX11Screen nScreen, long nDrawableDepth, long nX, @@ -578,7 +577,7 @@ bool X11SalBitmap::ImplCreateFromDrawable( Destroy(); if( aDrawable && nWidth && nHeight && nDrawableDepth ) - mpDDB = new ImplSalDDB( aDrawable, pVisual, nScreen, nDrawableDepth, nX, nY, nWidth, nHeight ); + mpDDB = new ImplSalDDB( aDrawable, nScreen, nDrawableDepth, nX, nY, nWidth, nHeight ); return( mpDDB != NULL ); } @@ -738,8 +737,7 @@ bool X11SalBitmap::Create( const SalBitmap& rSSalBmp ) } else if( rSalBmp.mpDDB ) ImplCreateFromDrawable( rSalBmp.mpDDB->ImplGetPixmap(), - rSalBmp.mpDDB->ImplGetVisual(), - rSalBmp.mpDDB->ImplGetScreen(), + rSalBmp.mpDDB->ImplGetScreen(), rSalBmp.mpDDB->ImplGetDepth(), 0, 0, rSalBmp.mpDDB->ImplGetWidth(), rSalBmp.mpDDB->ImplGetHeight() ); @@ -778,13 +776,11 @@ bool X11SalBitmap::Create( if( xFastPropertySet->getFastPropertyValue(bMask ? 2 : 1) >>= args ) { long pixmapHandle; - sal_Int64 nVisualPtr; - if( args.getLength() >= 4 && ( args[1] >>= pixmapHandle ) && ( args[2] >>= depth ) && ( args[3] >>= nVisualPtr ) ) { + if( ( args[1] >>= pixmapHandle ) && ( args[2] >>= depth ) ) { mbGrey = bMask; bool bSuccess = ImplCreateFromDrawable( pixmapHandle, - reinterpret_cast<void*>(nVisualPtr), // FIXME: this seems multi-screen broken to me SalX11Screen( 0 ), depth, @@ -896,7 +892,6 @@ bool X11SalBitmap::GetSystemData( BitmapSystemData& rData ) // prolly not a good idea, since it's accessed from // non-platform aware code in vcl/bitmap.hxx) rData.aPixmap = (void*)mpDDB->ImplGetPixmap(); - rData.aVisual = mpDDB->ImplGetVisual (); rData.mnWidth = mpDDB->ImplGetWidth (); rData.mnHeight = mpDDB->ImplGetHeight (); return true; @@ -912,7 +907,6 @@ bool X11SalBitmap::GetSystemData( BitmapSystemData& rData ) ImplSalDDB::ImplSalDDB( XImage* pImage, Drawable aDrawable, SalX11Screen nXScreen, const SalTwoRect& rTwoRect ) : maPixmap ( 0 ) - , mpVisual ( NULL ) , maTwoRect ( rTwoRect ) , mnDepth ( pImage->depth ) , mnXScreen ( nXScreen ) @@ -944,15 +938,13 @@ ImplSalDDB::ImplSalDDB( XImage* pImage, Drawable aDrawable, ImplSalDDB::ImplSalDDB( Drawable aDrawable, - void *pVisual, SalX11Screen nXScreen, long nDrawableDepth, long nX, long nY, long nWidth, long nHeight -) : mpVisual ( pVisual ) - , mnDepth( nDrawableDepth ) +) : mnDepth( nDrawableDepth ) , mnXScreen( nXScreen ) { SalDisplay* pSalDisp = GetGenericData()->GetSalDisplay(); diff --git a/vcl/unx/generic/gdi/salgdi2.cxx b/vcl/unx/generic/gdi/salgdi2.cxx index 29ea8ec8ff8f..e33a449714d0 100644 --- a/vcl/unx/generic/gdi/salgdi2.cxx +++ b/vcl/unx/generic/gdi/salgdi2.cxx @@ -83,7 +83,7 @@ void X11SalGraphics::CopyScreenArea( Display* pDisplay, else { X11SalBitmap aBM; - aBM.ImplCreateFromDrawable( aSrc, NULL, nXScreenSrc, nSrcDepth, src_x, src_y, w, h ); + aBM.ImplCreateFromDrawable( aSrc, nXScreenSrc, nSrcDepth, src_x, src_y, w, h ); SalTwoRect aTwoRect; aTwoRect.mnSrcX = aTwoRect.mnSrcY = 0; aTwoRect.mnSrcWidth = aTwoRect.mnDestWidth = w; @@ -887,7 +887,7 @@ SalBitmap *X11SalGraphics::getBitmap( long nX, long nY, long nDX, long nDY ) nBitCount = 1; if( ! bFakeWindowBG ) - pSalBitmap->ImplCreateFromDrawable( GetDrawable(), NULL, m_nXScreen, nBitCount, nX, nY, nDX, nDY ); + pSalBitmap->ImplCreateFromDrawable( GetDrawable(), m_nXScreen, nBitCount, nX, nY, nDX, nDY ); else pSalBitmap->Create( Size( nDX, nDY ), (nBitCount > 8) ? 24 : nBitCount, BitmapPalette( nBitCount > 8 ? nBitCount : 0 ) ); |