]> git.pld-linux.org Git - packages/libreoffice.git/blob - openoffice-speed-bitmap-render.patch
- up
[packages/libreoffice.git] / openoffice-speed-bitmap-render.patch
1 Index: vcl/unx/source/gdi/salgdi2.cxx
2 ===================================================================
3 RCS file: /cvs/gsl/vcl/unx/source/gdi/salgdi2.cxx,v
4 retrieving revision 1.18
5 diff -u -p -u -r1.18 salgdi2.cxx
6 --- vcl/unx/source/gdi/salgdi2.cxx      10 Jun 2003 14:31:08 -0000      1.18
7 +++ vcl/unx/source/gdi/salgdi2.cxx      14 Oct 2003 13:12:49 -0000
8 @@ -775,10 +775,13 @@ void SalGraphics::DrawBitmap( const SalT
9          XGCValues                      aOldVal, aNewVal;
10          int                                    nValues = GCForeground | GCBackground;
11  
12 -        // set foreground/background values for 1Bit bitmaps
13 -        XGetGCValues( pXDisp, aGC, nValues, &aOldVal );
14 -        aNewVal.foreground = rColMap.GetWhitePixel(), aNewVal.background = rColMap.GetBlackPixel();
15 -        XChangeGC( pXDisp, aGC, nValues, &aNewVal );
16 +               if( rSalBitmap.GetBitCount() == 1 )
17 +               {
18 +                               // set foreground/background values for 1Bit bitmaps
19 +                               XGetGCValues( pXDisp, aGC, nValues, &aOldVal );
20 +                               aNewVal.foreground = rColMap.GetWhitePixel(), aNewVal.background = rColMap.GetBlackPixel();
21 +                               XChangeGC( pXDisp, aGC, nValues, &aNewVal );
22 +               }
23  
24  #if defined(_USE_PRINT_EXTENSION_)
25                 rSalBitmap.ImplDraw( pSalDisp, aDrawable, nDepth, *pPosAry,  aGC );
26 @@ -786,7 +789,8 @@ void SalGraphics::DrawBitmap( const SalT
27                 rSalBitmap.ImplDraw( aDrawable, nDepth, *pPosAry, aGC );
28  #endif
29  
30 -        XChangeGC( pXDisp, aGC, nValues, &aOldVal );
31 +               if( rSalBitmap.GetBitCount() == 1 )
32 +                               XChangeGC( pXDisp, aGC, nValues, &aOldVal );
33          XFlush( pXDisp );
34  
35  #ifndef _USE_PRINT_EXTENSION_
36 @@ -1058,12 +1062,7 @@ SalBitmap *SalGraphics::GetBitmap( long 
37          if( &_GetDisplay()->GetColormap() != &_GetColormap() )
38              nBitCount = 1;
39  
40 -
41 -#if defined(_USE_PRINT_EXTENSION_)
42 -        pSalBitmap->ImplCreateFromDrawable( _GetDisplay(), _GetDrawable(), nBitCount, nX, nY, nDX, nDY );
43 -#else
44 -        pSalBitmap->ImplCreateFromDrawable( _GetDrawable(), nBitCount, nX, nY, nDX, nDY );
45 -#endif
46 +               pSalBitmap->ImplCreateLocalFromDrawable( _GetDrawable(), nBitCount, nX, nY, nDX, nDY );
47          return pSalBitmap;
48  
49  #ifndef _USE_PRINT_EXTENSION_
50 Index: vcl/unx/inc/salbmp.hxx
51 ===================================================================
52 RCS file: /cvs/gsl/vcl/unx/inc/salbmp.hxx,v
53 retrieving revision 1.3
54 diff -u -p -u -r1.3 salbmp.hxx
55 --- vcl/unx/inc/salbmp.hxx      29 Aug 2001 16:14:00 -0000      1.3
56 +++ vcl/unx/inc/salbmp.hxx      14 Oct 2003 13:13:18 -0000
57 @@ -123,6 +124,12 @@ public:
58                                                                                         long nX, long nY, 
59                                                                                         long nWidth, long nHeight );
60  
61 +       BOOL                    ImplCreateLocalFromDrawable( 
62 +                                                                                       Drawable aDrawable, 
63 +                                                                                       long nDrawableDepth,
64 +                                                                                       long nX, long nY, 
65 +                                                                                       long nWidth, long nHeight );
66 +
67         XImage*                 ImplCreateXImage( 
68                                                                                         SalDisplay* pSalDisp, long nDepth, 
69                                                                                         const SalTwoRect& rTwoRect ) const;
70 Index: vcl/unx/source/gdi/salbmp.cxx
71 ===================================================================
72 RCS file: /cvs/gsl/vcl/unx/source/gdi/salbmp.cxx,v
73 retrieving revision 1.8
74 diff -u -p -u -r1.8 salbmp.cxx
75 --- vcl/unx/source/gdi/salbmp.cxx       11 Sep 2001 15:52:22 -0000      1.8
76 +++ vcl/unx/source/gdi/salbmp.cxx       14 Oct 2003 13:13:48 -0000
77 @@ -502,6 +506,17 @@ BOOL SalBitmap::ImplCreateFromDrawable( 
78  // -----------------------------------------------------------------------------
79  #endif
80  
81 +BOOL SalBitmap::ImplCreateLocalFromDrawable(  Drawable aDrawable, long nDrawableDepth, 
82 +                                                                                         long nX, long nY, long nWidth, long nHeight )
83 +{
84 +       Destroy();
85 +
86 +       if( aDrawable && nWidth && nHeight && nDrawableDepth )
87 +        mpDIB = ImplCreateDIB( aDrawable, nDrawableDepth, nX, nY, nWidth, nHeight );
88 +
89 +       return( mpDIB != NULL );
90 +}
91 +
92  BOOL 
93  SalBitmap::SnapShot (Display* pDisplay, XLIB_Window hWindow)
94  {
This page took 0.050468 seconds and 3 git commands to generate.