Index: cairo_canvashelper.cxx
===================================================================
RCS file: /cvs/gsl/canvas/source/cairo/cairo_canvashelper.cxx,v
retrieving revision 1.3
diff -u -p -r1.3 cairo_canvashelper.cxx
--- canvas/source/cairo/cairo_canvashelper.cxx	22 Mar 2006 10:59:35 -0000	1.3
+++ canvas/source/cairo/cairo_canvashelper.cxx	23 Jun 2006 12:28:40 -0000
@@ -1036,6 +1036,7 @@ namespace cairocanvas
 																					   bool bHasAlpha )
     {
 		uno::Reference< rendering::XCachedPrimitive > rv = uno::Reference< rendering::XCachedPrimitive >(NULL);
+                geometry::IntegerSize2D aBitmapSize = rSize;
 
 		if( mpCairo ) {
 			const ::basegfx::B2ISize& aSize = mpDevice->getSizePixel();
@@ -1064,10 +1065,11 @@ namespace cairocanvas
 
 					dWidth = round( rSize.Width * aMatrix.xx );
 					dHeight = round( rSize.Height* aMatrix.yy );
+                                        aBitmapSize.Width = static_cast<sal_Int32>( dWidth );
+                                        aBitmapSize.Height = static_cast<sal_Int32>( dHeight );
 
-					Surface* pScaledSurface = mpDevice->getSurface( ::basegfx::B2ISize( static_cast<sal_Int32>( dWidth ),
-																						static_cast<sal_Int32>( dHeight ) ),
-																	bHasAlpha ? CAIRO_CONTENT_COLOR_ALPHA : CAIRO_CONTENT_COLOR );
+					Surface* pScaledSurface = mpDevice->getSurface( ::basegfx::B2ISize( aBitmapSize.Width, aBitmapSize.Height ),
+                                                                                        bHasAlpha ? CAIRO_CONTENT_COLOR_ALPHA : CAIRO_CONTENT_COLOR );
 					Cairo* pCairo = pScaledSurface->getCairo();
 
 					// cairo_set_operator( pCairo, CAIRO_OPERATOR_SOURCE );
@@ -1092,8 +1094,8 @@ namespace cairocanvas
 				double x, y, width, height;
 
 				x = y = 0;
-				width = rSize.Width;
-				height = rSize.Height;
+				width = aBitmapSize.Width;
+				height = aBitmapSize.Height;
 				cairo_matrix_transform_point( &aMatrix, &x, &y );
 				cairo_matrix_transform_distance( &aMatrix, &width, &height );
 
@@ -1118,8 +1120,14 @@ namespace cairocanvas
 			}
 
 			cairo_set_source_surface( mpCairo, pSurface->mpSurface, 0, 0 );
-// 			if( !bHasAlpha )
-// 				cairo_set_operator( mpCairo, CAIRO_OPERATOR_SOURCE );
+ 			if( !bHasAlpha &&
+				::rtl::math::approxEqual( aMatrix.xx, 1 ) &&
+				::rtl::math::approxEqual( aMatrix.yy, 1 ) &&
+				::rtl::math::approxEqual( aMatrix.x0, 0 ) &&
+				::rtl::math::approxEqual( aMatrix.y0, 0 ) )
+ 				cairo_set_operator( mpCairo, CAIRO_OPERATOR_SOURCE );
+			cairo_rectangle( mpCairo, 0, 0, aBitmapSize.Width, aBitmapSize.Height );
+			cairo_clip( mpCairo );
 			cairo_paint( mpCairo );
 			cairo_restore( mpCairo );
 		} else
