ooo-build r11779 - in trunk: . patches/src680



Author: rodo
Date: Mon Mar  3 13:57:47 2008
New Revision: 11779
URL: http://svn.gnome.org/viewvc/ooo-build?rev=11779&view=rev

Log:
2008-03-03  Radek Doulik  <rodo novell com>

	* patches/src680/apply: added vcl-grey-alpha-unix-sal-bitmap.diff
	with changes described below

	* build/ooh680-m8/vcl/unx/source/gdi/salbmp.cxx: use the mbGrey
	flag, override the palette where needed. this is used when getting
	alpha mask from canvas backend as Pixmap. before we ended by
	recreating the bitmap/X pixmap with the same content and new
	palette

	* build/ooh680-m8/vcl/unx/inc/salbmp.h: added mbGrey flag to
	override bitmap palette to linear 8bit grey



Added:
   trunk/patches/src680/vcl-grey-alpha-unix-sal-bitmap.diff
Modified:
   trunk/ChangeLog
   trunk/patches/src680/apply

Modified: trunk/patches/src680/apply
==============================================================================
--- trunk/patches/src680/apply	(original)
+++ trunk/patches/src680/apply	Mon Mar  3 13:57:47 2008
@@ -2284,3 +2284,4 @@
 
 sd-slideshow-slideshowview-transformation-fix.diff, rodo
 cairocanvas-fix-image-cache.diff, rodo
+vcl-grey-alpha-unix-sal-bitmap.diff, rodo

Added: trunk/patches/src680/vcl-grey-alpha-unix-sal-bitmap.diff
==============================================================================
--- (empty file)
+++ trunk/patches/src680/vcl-grey-alpha-unix-sal-bitmap.diff	Mon Mar  3 13:57:47 2008
@@ -0,0 +1,125 @@
+diff -rup /home/rodo/svn/ooo-build-1/build/ooh680-m8/vcl/unx/inc/salbmp.h vcl/unx/inc/salbmp.h
+--- /home/rodo/svn/ooo-build-1/build/ooh680-m8/vcl/unx/inc/salbmp.h	2008-03-03 11:01:10.000000000 +0100
++++ vcl/unx/inc/salbmp.h	2008-02-28 13:18:23.000000000 +0100
+@@ -74,7 +74,8 @@ private:
+                                                int nScreen,
+ 											   long nDrawableDepth,
+ 											   long nX, long nY,
+-											   long nWidth, long nHeight );
++											   long nWidth, long nHeight,
++                                               bool bGrey );
+ 
+ public:
+ 
+@@ -95,6 +96,7 @@ private:
+ 
+ 	BitmapBuffer*	mpDIB;
+ 	ImplSalDDB*		mpDDB;
++    bool            mbGrey;
+ 								
+ public:
+ 
+diff -rup /home/rodo/svn/ooo-build-1/build/ooh680-m8/vcl/unx/source/gdi/salbmp.cxx vcl/unx/source/gdi/salbmp.cxx
+--- /home/rodo/svn/ooo-build-1/build/ooh680-m8/vcl/unx/source/gdi/salbmp.cxx	2008-03-03 11:01:10.000000000 +0100
++++ vcl/unx/source/gdi/salbmp.cxx	2008-02-28 13:39:01.000000000 +0100
+@@ -97,7 +98,8 @@ ULONG				X11SalBitmap::mnCacheInstCount 
+ 
+ X11SalBitmap::X11SalBitmap() :
+ 	mpDIB( NULL ),
+-	mpDDB( NULL )
++	mpDDB( NULL ),
++    mbGrey( false )
+ {
+ }
+ 
+@@ -211,7 +213,8 @@ BitmapBuffer* X11SalBitmap::ImplCreateDI
+                                            int nScreen,
+                                            long nDrawableDepth,
+                                            long nX, long nY,
+-                                           long nWidth, long nHeight )
++                                           long nWidth, long nHeight,
++                                           bool bGrey )
+ {
+ 	BitmapBuffer* pDIB = NULL;
+ 
+@@ -322,6 +325,21 @@ BitmapBuffer* X11SalBitmap::ImplCreateDI
+ 				rPal[ 0 ] = Color( COL_BLACK );
+ 				rPal[ 1 ] = Color( COL_WHITE );
+ 			}
++            else if( pImage->depth == 8 && bGrey )
++            {
++				rPal.SetEntryCount( 256 );
++				pDstPal = &rPal;
++
++				for( USHORT i = 0; i < 256; i++ )
++				{
++					BitmapColor&	rBmpCol = rPal[ i ];
++
++					rBmpCol.SetRed( i );
++					rBmpCol.SetGreen( i );
++					rBmpCol.SetBlue( i );
++				}
++                
++            }
+ 			else if( aSrcBuf.mnBitCount <= 8 )
+ 			{
+ 				const SalColormap& rColMap = pSalDisp->GetColormap( nScreen );
+@@ -365,7 +383,8 @@ XImage*	X11SalBitmap::ImplCreateXImage( 
+                            mpDDB->ImplGetDepth(),
+                            0, 0, 
+                            mpDDB->ImplGetWidth(), 
+-                           mpDDB->ImplGetHeight() );
++                           mpDDB->ImplGetHeight(),
++                           mbGrey );
+ 	}
+ 
+ 	if( mpDIB && mpDIB->mnWidth && mpDIB->mnHeight )
+@@ -448,6 +467,20 @@ XImage*	X11SalBitmap::ImplCreateXImage( 
+ 				(*pPal)[ 0 ] = Color( COL_BLACK );
+ 				(*pPal)[ 1 ] = Color( COL_WHITE );
+ 			}
++            else if( pImage->depth == 8 && mbGrey )
++            {
++				pPal = new BitmapPalette( 256 );
++
++				for( USHORT i = 0; i < 256; i++ )
++				{
++					BitmapColor&	rBmpCol = (*pPal)[ i ];
++
++					rBmpCol.SetRed( i );
++					rBmpCol.SetGreen( i );
++					rBmpCol.SetBlue( i );
++				}
++                
++            }
+ 			else if( pImage->depth <= 8 )
+ 			{
+ 				const SalColormap& rColMap = pSalDisp->GetColormap( nScreen );
+@@ -612,7 +645,8 @@ ImplSalDDB* X11SalBitmap::ImplGetDDB( Dr
+                                                                         mpDDB->ImplGetDepth(),
+                                                                         0, 0, 
+                                                                         mpDDB->ImplGetWidth(), 
+-                                                                        mpDDB->ImplGetHeight() );
++                                                                        mpDDB->ImplGetHeight(),
++                                                                        mbGrey );
+ 			}
+ 
+ 			delete mpDDB, const_cast<X11SalBitmap*>(this)->mpDDB = NULL;
+@@ -775,6 +809,8 @@ bool X11SalBitmap::Create( const ::com::
+ 
+         if( xFastPropertySet->getFastPropertyValue(bMask ? 2 : 1) >>= args ) {
+             if( ( args[1] >>= pixmapHandle ) && ( args[2] >>= depth ) ) {
++
++                mbGrey = bMask;
+                 bool bSuccess = ImplCreateFromDrawable( pixmapHandle, 0, depth, 0, 0, (long) rSize.Width(), (long) rSize.Height() );
+                 bool bFreePixmap;
+                 if( bSuccess && (args[0] >>= bFreePixmap) && bFreePixmap )
+@@ -844,7 +882,7 @@ BitmapBuffer* X11SalBitmap::AcquireBuffe
+ 		mpDIB = ImplCreateDIB( mpDDB->ImplGetPixmap(),
+                                mpDDB->ImplGetScreen(),
+                                mpDDB->ImplGetDepth(),
+-							   0, 0, mpDDB->ImplGetWidth(), mpDDB->ImplGetHeight() );
++							   0, 0, mpDDB->ImplGetWidth(), mpDDB->ImplGetHeight(), mbGrey );
+ 	}
+ 
+ 	return mpDIB;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]