diff options
author | Michael Meeks <michael.meeks@suse.com> | 2013-06-12 09:20:19 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2013-06-12 09:54:57 +0100 |
commit | 352580fedebcb9ae3c4200d343f88f98b9faa22a (patch) | |
tree | b29d3ed74aa9a55588d214501275b479695063e0 /vcl | |
parent | 548cf61edf5c3b0960dca7090c380ddc94ed6567 (diff) |
Revert "pass argb32 pixmaps from vcl to canvas, avoiding x11 roundtrips"
This reverts commit 6b8e311ddc633bb13053d13c5d0f29240039846b.
Conflicts:
canvas/source/cairo/cairo_canvasbitmap.cxx
vcl/unx/generic/gdi/salgdi2.cxx
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/unx/salbmp.h | 4 | ||||
-rw-r--r-- | vcl/inc/vcl/bitmap.hxx | 3 | ||||
-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 |
6 files changed, 7 insertions, 58 deletions
diff --git a/vcl/inc/unx/salbmp.h b/vcl/inc/unx/salbmp.h index 59a1285b0d41..866412d5c6e3 100644 --- a/vcl/inc/unx/salbmp.h +++ b/vcl/inc/unx/salbmp.h @@ -79,7 +79,6 @@ public: SAL_DLLPRIVATE bool ImplCreateFromDrawable( Drawable aDrawable, - void* pVisual, SalX11Screen nXScreen, long nDrawableDepth, long nX, @@ -160,7 +159,6 @@ class ImplSalDDB private: Pixmap maPixmap; - void* mpVisual; SalTwoRect maTwoRect; long mnDepth; SalX11Screen mnXScreen; @@ -192,7 +190,6 @@ public: ImplSalDDB( Drawable aDrawable, - void *pVisual, SalX11Screen nXScreen, long nDrawableDepth, long nX, @@ -204,7 +201,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/inc/vcl/bitmap.hxx b/vcl/inc/vcl/bitmap.hxx index df42f93fd655..ea52068160c9 100644 --- a/vcl/inc/vcl/bitmap.hxx +++ b/vcl/inc/vcl/bitmap.hxx @@ -325,7 +325,6 @@ struct BitmapSystemData void* rImageContext; //Image context (CGContextRef) #else void* aPixmap; - void* aVisual; #endif int mnWidth; int mnHeight; @@ -847,8 +846,6 @@ public: const BmpFilterParam* pFilterParam = NULL, const Link* pProgress = NULL ); - bool HasAlpha(); - public: BitmapReadAccess* AcquireReadAccess(); BitmapWriteAccess* AcquireWriteAccess(); diff --git a/vcl/source/gdi/bitmap.cxx b/vcl/source/gdi/bitmap.cxx index 98de0a4e2f84..436092a89828 100644 --- a/vcl/source/gdi/bitmap.cxx +++ b/vcl/source/gdi/bitmap.cxx @@ -1901,17 +1901,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 d05f7e78bfb3..75ad8721e3a9 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 7f587c6904c3..aee24ddbf534 100644 --- a/vcl/unx/generic/gdi/salbmp.cxx +++ b/vcl/unx/generic/gdi/salbmp.cxx @@ -564,7 +564,6 @@ XImage* X11SalBitmap::ImplCreateXImage( // ----------------------------------------------------------------------------- bool X11SalBitmap::ImplCreateFromDrawable( Drawable aDrawable, - void *pVisual, SalX11Screen nScreen, long nDrawableDepth, long nX, @@ -575,7 +574,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 ); } @@ -735,8 +734,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() ); @@ -775,13 +773,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, @@ -893,7 +889,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; @@ -909,7 +904,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 ) @@ -941,15 +935,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 1553fba3f0dc..97d1924cacb1 100644 --- a/vcl/unx/generic/gdi/salgdi2.cxx +++ b/vcl/unx/generic/gdi/salgdi2.cxx @@ -90,7 +90,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; @@ -894,7 +894,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 ) ); |