diff options
author | sekelsenmat <sekelsenmat@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-05-27 07:14:49 +0000 |
---|---|---|
committer | sekelsenmat <sekelsenmat@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-05-27 07:14:49 +0000 |
commit | 734b88fd7ed8c0416016025f2961b313d7b298d8 (patch) | |
tree | 7e008120a8f8b5644b136fb1a711e80e5bc984c6 /gfx/x11 | |
parent | 374d6c940a5a8328ed64a3110e8cc96abf88106d (diff) | |
download | fpGUI-734b88fd7ed8c0416016025f2961b313d7b298d8.tar.xz |
small improvements to painting system on x11
Diffstat (limited to 'gfx/x11')
-rw-r--r-- | gfx/x11/gfx_x11.pas | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/gfx/x11/gfx_x11.pas b/gfx/x11/gfx_x11.pas index 862ea1e5..029be44e 100644 --- a/gfx/x11/gfx_x11.pas +++ b/gfx/x11/gfx_x11.pas @@ -727,9 +727,13 @@ var Image: XLib.PXImage; ConvertFormat: TGfxPixelFormat; begin + {$IFDEF VerboseFPGUI} + WriteLn('>: DoDrawImageRect'); + {$ENDIF} + + {$IFDEF VerboseFPGUI} ASSERT(AImage.InheritsFrom(TX11Bitmap)); - {$IFDEF Debug} - ASSERT(not TXImage(AImage).IsLocked); + ASSERT(not TX11Bitmap(AImage).IsLocked); {$ENDIF} // !!!: Add support for XF86 4 and XShm etc. to speed this up! @@ -738,7 +742,9 @@ begin ASourceRect.Right - ASourceRect.Left, ASourceRect.Bottom - ASourceRect.Top, 8, 0); -// WriteLn('Size allocated: ', Image^.bytes_per_line * (ASourceRect.Bottom - ASourceRect.Top) + 1); + {$IFDEF VerboseFPGUIp} + WriteLn('Size allocat for imageaed: ', Image^.bytes_per_line * (ASourceRect.Bottom - ASourceRect.Top) + 1); + {$ENDIF} { Here its necessary to alloc an extra byte, otherwise it will fail on 32-bits machines, but still work on 64-bits machines. The cause of this is unknown. } @@ -752,6 +758,13 @@ begin else begin ConvertFormat := PixelFormat; + + { !!!: The following is a workaround: At least the XFree86 X server for + ATI graphics adapters uses 32 bit padding per pixel for 24 bpp + images...?!? To be checked: Is this always the case or only for ATI? } +// if ConvertFormat.FormatType = ftRGB24 then +// ConvertFormat.FormatType := ftRGB32; + ConvertImage(ASourceRect, AImage.PixelFormat, AImage.Palette, TX11Bitmap(AImage).Data, TX11Bitmap(AImage).Stride, 0, 0, ConvertFormat, Image^.data, Image^.bytes_per_line); @@ -762,6 +775,10 @@ begin FreeMem(Image^.data); Image^.data := nil; XDestroyImage(Image); + + {$IFDEF VerboseFPGUI} + WriteLn('<: DoDrawImageRect'); + {$ENDIF} end; |