mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 16:00:16 +02:00
fixed -dVerboseStretchCopyArea
git-svn-id: trunk@8311 -
This commit is contained in:
parent
ad436d2657
commit
c6f54982a3
@ -2753,7 +2753,7 @@ var
|
|||||||
if SizeChange then begin
|
if SizeChange then begin
|
||||||
{$IFDEF VerboseStretchCopyArea}
|
{$IFDEF VerboseStretchCopyArea}
|
||||||
Depth:=gdk_visual_get_system^.Depth;
|
Depth:=gdk_visual_get_system^.Depth;
|
||||||
DebugLn('ScaleAndROP Scaling buffer: ',Width,' x ',Height,' x ',Depth,' CopyingWholeSrc=',CopyingWholeSrc);
|
DebugLn('ScaleAndROP Scaling buffer: '+dbgs(Width),' x '+dbgs(Height),' x '+dbgs(Depth),' CopyingWholeSrc='+dbgs(CopyingWholeSrc));
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
// Scale the src part to a temporary pixmap with the size of the
|
// Scale the src part to a temporary pixmap with the size of the
|
||||||
// destination rectangle
|
// destination rectangle
|
||||||
@ -2785,7 +2785,7 @@ var
|
|||||||
|
|
||||||
Depth:=gdk_visual_get_system^.Depth;
|
Depth:=gdk_visual_get_system^.Depth;
|
||||||
{$IFDEF VerboseStretchCopyArea}
|
{$IFDEF VerboseStretchCopyArea}
|
||||||
DebugLn('ScaleAndROP Creating rop buffer: ',Width,' x ',Height,' x ',Depth);
|
DebugLn('ScaleAndROP Creating rop buffer: '+dbgs(Width),' x '+dbgs(Height),' x '+dbgs(Depth));
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
TempPixmap := gdk_pixmap_new(nil,SrcWidth,SrcHeight,Depth);
|
TempPixmap := gdk_pixmap_new(nil,SrcWidth,SrcHeight,Depth);
|
||||||
gdk_window_copy_area(TempPixmap, fGC, 0, 0,
|
gdk_window_copy_area(TempPixmap, fGC, 0, 0,
|
||||||
@ -2806,7 +2806,7 @@ var
|
|||||||
if TempPixmap=nil then exit;
|
if TempPixmap=nil then exit;
|
||||||
if (ROp=WHITENESS) or (ROp=BLACKNESS) or (ROp=DSTINVERT) then begin
|
if (ROp=WHITENESS) or (ROp=BLACKNESS) or (ROp=DSTINVERT) then begin
|
||||||
{$IFDEF VerboseStretchCopyArea}
|
{$IFDEF VerboseStretchCopyArea}
|
||||||
DebugLn('ROPFillBuffer ROp=',ROp);
|
DebugLn('ROPFillBuffer ROp='+dbgs(ROp));
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
with TDeviceContext(DC) do
|
with TDeviceContext(DC) do
|
||||||
begin
|
begin
|
||||||
@ -2905,9 +2905,9 @@ var
|
|||||||
{$IFDEF VerboseStretchCopyArea}
|
{$IFDEF VerboseStretchCopyArea}
|
||||||
DebugLn('SrcDevBitmapToDrawable ',
|
DebugLn('SrcDevBitmapToDrawable ',
|
||||||
' SrcPixmap=',DbgS(SrcPixmap),
|
' SrcPixmap=',DbgS(SrcPixmap),
|
||||||
' XSrc=',XSrc,' YSrc=',YSrc,' SrcWidth=',SrcWidth,' SrcHeight=',SrcHeight,
|
' XSrc='+dbgs(XSrc),' YSrc='+dbgs(YSrc),' SrcWidth='+dbgs(SrcWidth),' SrcHeight='+dbgs(SrcHeight),
|
||||||
' MaskPixmap=',DbgS(MaskPixmap),
|
' MaskPixmap=',DbgS(MaskPixmap),
|
||||||
' XMask=',XMask,' YMask=',YMask,
|
' XMask='+dbgs(XMask),' YMask='+dbgs(YMask),
|
||||||
'');
|
'');
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
@ -3057,7 +3057,7 @@ var
|
|||||||
begin
|
begin
|
||||||
Result := IsValidDC(DestDC) and IsValidDC(SrcDC);
|
Result := IsValidDC(DestDC) and IsValidDC(SrcDC);
|
||||||
{$IFDEF VerboseStretchCopyArea}
|
{$IFDEF VerboseStretchCopyArea}
|
||||||
DebugLn('StretchCopyArea Start ',Result);
|
DebugLn('StretchCopyArea Start '+dbgs(Result));
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
if not Result then exit;
|
if not Result then exit;
|
||||||
if (Width=0) or (Height=0) then exit;
|
if (Width=0) or (Height=0) then exit;
|
||||||
@ -3083,16 +3083,16 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{$IFDEF VerboseStretchCopyArea}
|
{$IFDEF VerboseStretchCopyArea}
|
||||||
DebugLn('TGtkWidgetSet.StretchCopyArea BEFORE CLIPPING X=',X,' Y=',Y,' Width=',Width,' Height=',Height,
|
DebugLn('TGtkWidgetSet.StretchCopyArea BEFORE CLIPPING X='+dbgs(X),' Y='+dbgs(Y),' Width='+dbgs(Width),' Height='+dbgs(Height),
|
||||||
' XSrc=',XSrc,' YSrc=',YSrc,' SrcWidth=',SrcWidth,' SrcHeight=',SrcHeight,
|
' XSrc='+dbgs(XSrc)+' YSrc='+dbgs(YSrc)+' SrcWidth='+dbgs(SrcWidth)+' SrcHeight='+dbgs(SrcHeight),
|
||||||
' SrcDrawable=',DbgS(TDeviceContext(SrcDC).Drawable),
|
' SrcDrawable=',DbgS(TDeviceContext(SrcDC).Drawable),
|
||||||
' SrcOrigin=',SrcDCOrigin.X,',',SrcDCOrigin.Y,
|
' SrcOrigin='+dbgs(SrcDCOrigin),
|
||||||
' DestDrawable=',DbgS(TDeviceContext(DestDC).Drawable),
|
' DestDrawable='+DbgS(TDeviceContext(DestDC).Drawable),
|
||||||
' DestOrigin=',DestDCOrigin.X,',',DestDCOrigin.Y,
|
' DestOrigin='+dbgs(DestDCOrigin),
|
||||||
' Mask=',DbgS(Mask),' XMask=',XMask,' YMask=',YMask,
|
' Mask='+DbgS(Mask)+' XMask='+dbgs(XMask)+' YMask='+dbgs(YMask),
|
||||||
' SizeChange=',SizeChange,' ROpIsSpecial=',ROpIsSpecial,
|
' SizeChange='+dbgs(SizeChange)+' ROpIsSpecial='+dbgs(ROpIsSpecial),
|
||||||
' DestWhole=',DestWholeWidth,',',DestWholeHeight,
|
' DestWhole='+dbgs(DestWholeWidth)+','+dbgs(DestWholeHeight),
|
||||||
' SrcWhole=',SrcWholeWidth,',',SrcWholeHeight,
|
' SrcWhole='+dbgs(SrcWholeWidth)+','+dbgs(SrcWholeHeight),
|
||||||
'');
|
'');
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
@ -3111,7 +3111,7 @@ begin
|
|||||||
NewSrcWidth:=SrcWidth+XSrc;
|
NewSrcWidth:=SrcWidth+XSrc;
|
||||||
NewWidth:=((Width*NewSrcWidth) div SrcWidth);
|
NewWidth:=((Width*NewSrcWidth) div SrcWidth);
|
||||||
{$IFDEF VerboseStretchCopyArea}
|
{$IFDEF VerboseStretchCopyArea}
|
||||||
DebugLn('StretchCopyArea Cliping Src to left NewSrcWidth=',NewSrcWidth,' NewWidth=',NewWidth);
|
DebugLn('StretchCopyArea Cliping Src to left NewSrcWidth='+dbgs(NewSrcWidth),' NewWidth='+dbgs(NewWidth));
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
if NewWidth=0 then exit;
|
if NewWidth=0 then exit;
|
||||||
inc(X,Width-NewWidth);
|
inc(X,Width-NewWidth);
|
||||||
@ -3125,7 +3125,7 @@ begin
|
|||||||
NewSrcHeight:=SrcHeight+YSrc;
|
NewSrcHeight:=SrcHeight+YSrc;
|
||||||
NewHeight:=((Height*NewSrcHeight) div SrcHeight);
|
NewHeight:=((Height*NewSrcHeight) div SrcHeight);
|
||||||
{$IFDEF VerboseStretchCopyArea}
|
{$IFDEF VerboseStretchCopyArea}
|
||||||
DebugLn('StretchCopyArea Cliping Src to top NewSrcHeight=',NewSrcHeight,' NewHeight=',NewHeight);
|
DebugLn('StretchCopyArea Cliping Src to top NewSrcHeight='+dbgs(NewSrcHeight),' NewHeight='+dbgs(NewHeight));
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
if NewHeight=0 then exit;
|
if NewHeight=0 then exit;
|
||||||
inc(Y,Height-NewHeight);
|
inc(Y,Height-NewHeight);
|
||||||
@ -3139,7 +3139,7 @@ begin
|
|||||||
NewSrcWidth:=SrcWholeWidth-XSrc;
|
NewSrcWidth:=SrcWholeWidth-XSrc;
|
||||||
Width:=((Width*NewSrcWidth) div SrcWidth);
|
Width:=((Width*NewSrcWidth) div SrcWidth);
|
||||||
{$IFDEF VerboseStretchCopyArea}
|
{$IFDEF VerboseStretchCopyArea}
|
||||||
DebugLn('StretchCopyArea Cliping Src to right NewSrcWidth=',NewSrcWidth,' NewWidth=',Width);
|
DebugLn('StretchCopyArea Cliping Src to right NewSrcWidth='+dbgs(NewSrcWidth),' NewWidth='+dbgs(Width));
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
if (Width=0) then exit;
|
if (Width=0) then exit;
|
||||||
if (X+Width<=0) then exit;
|
if (X+Width<=0) then exit;
|
||||||
@ -3151,7 +3151,7 @@ begin
|
|||||||
NewSrcHeight:=SrcWholeHeight-YSrc;
|
NewSrcHeight:=SrcWholeHeight-YSrc;
|
||||||
Height:=((Height*NewSrcHeight) div SrcHeight);
|
Height:=((Height*NewSrcHeight) div SrcHeight);
|
||||||
{$IFDEF VerboseStretchCopyArea}
|
{$IFDEF VerboseStretchCopyArea}
|
||||||
DebugLn('StretchCopyArea Cliping Src to bottom NewSrcHeight=',NewSrcHeight,' NewHeight=',Height);
|
DebugLn('StretchCopyArea Cliping Src to bottom NewSrcHeight='+dbgs(NewSrcHeight),' NewHeight='+dbgs(Height));
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
if (Height=0) then exit;
|
if (Height=0) then exit;
|
||||||
if (Y+Height<=0) then exit;
|
if (Y+Height<=0) then exit;
|
||||||
@ -3172,13 +3172,13 @@ begin
|
|||||||
TempMaskPixmap:=nil;
|
TempMaskPixmap:=nil;
|
||||||
|
|
||||||
{$IFDEF VerboseStretchCopyArea}
|
{$IFDEF VerboseStretchCopyArea}
|
||||||
write('TGtkWidgetSet.StretchCopyArea AFTER CLIPPING X=',X,' Y=',Y,' Width=',Width,' Height=',Height,
|
write('TGtkWidgetSet.StretchCopyArea AFTER CLIPPING X='+dbgs(X)+' Y='+dbgs(Y)+' Width='+dbgs(Width)+' Height='+dbgs(Height),
|
||||||
' XSrc=',XSrc,' YSrc=',YSrc,' SrcWidth=',SrcWidth,' SrcHeight=',SrcHeight,
|
' XSrc='+dbgs(XSrc),' YSrc='+dbgs(YSrc)+' SrcWidth='+dbgs(SrcWidth)+' SrcHeight='+dbgs(SrcHeight),
|
||||||
' SrcDrawable=',DbgS(TDeviceContext(SrcDC).Drawable),
|
' SrcDrawable='+DbgS(TDeviceContext(SrcDC).Drawable),
|
||||||
' DestDrawable=',DbgS(TDeviceContext(DestDC).Drawable),
|
' DestDrawable='+DbgS(TDeviceContext(DestDC).Drawable),
|
||||||
' Mask=',DbgS(Mask),' XMask=',XMask,' YMask=',YMask,
|
' Mask='+DbgS(Mask)+' XMask='+dbgs(XMask)+' YMask='+dbgs(YMask),
|
||||||
' SizeChange=',SizeChange,' ROpIsSpecial=',ROpIsSpecial,
|
' SizeChange='+dbgs(SizeChange)+' ROpIsSpecial='+dbgs(ROpIsSpecial),
|
||||||
' CopyingWholeSrc=',CopyingWholeSrc);
|
' CopyingWholeSrc='+dbgs(CopyingWholeSrc));
|
||||||
write(' ROp=');
|
write(' ROp=');
|
||||||
case ROp of
|
case ROp of
|
||||||
SRCCOPY : DebugLn('SRCCOPY');
|
SRCCOPY : DebugLn('SRCCOPY');
|
||||||
|
@ -1149,9 +1149,9 @@ begin
|
|||||||
{$IFDEF VerboseStretchCopyArea}
|
{$IFDEF VerboseStretchCopyArea}
|
||||||
DebugLn('MergeClipping START DestinationDC=',DbgS(DestinationDC),
|
DebugLn('MergeClipping START DestinationDC=',DbgS(DestinationDC),
|
||||||
' DestinationGC=',DbgS(DestinationGC),
|
' DestinationGC=',DbgS(DestinationGC),
|
||||||
' X=',X,' Y=',Y,' Width=',Width,' Height=',Height,
|
' X='+dbgs(X),' Y='+dbgs(Y),' Width='+dbgs(Width),' Height='+dbgs(Height),
|
||||||
' ClipMergeMask=',DbgS(ClipMergeMask),
|
' ClipMergeMask=',DbgS(ClipMergeMask),
|
||||||
' ClipMergeMaskX=',ClipMergeMaskX,' ClipMergeMaskY=',ClipMergeMaskY);
|
' ClipMergeMaskX=',dbgs(ClipMergeMaskX),' ClipMergeMaskY=',dbgs(ClipMergeMaskY));
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
// activate clipping region of destination
|
// activate clipping region of destination
|
||||||
@ -1246,9 +1246,9 @@ begin
|
|||||||
{$IFDEF VerboseStretchCopyArea}
|
{$IFDEF VerboseStretchCopyArea}
|
||||||
DebugLn('ScalePixmap ScaleGC=',DbgS(ScaleGC),
|
DebugLn('ScalePixmap ScaleGC=',DbgS(ScaleGC),
|
||||||
' SrcPixmap=[',GetWindowDebugReport(SrcPixmap),']',
|
' SrcPixmap=[',GetWindowDebugReport(SrcPixmap),']',
|
||||||
' SrcX=',SrcX,' SrcY=',SrcY,' SrcWidth=',SrcWidth,' SrcHeight=',SrcHeight,
|
' SrcX='+dbgs(SrcX),' SrcY='+dbgs(SrcY),' SrcWidth='+dbgs(SrcWidth),' SrcHeight='+dbgs(SrcHeight),
|
||||||
' NewPixmap=[',GetWindowDebugReport(NewPixmap),']',
|
' NewPixmap=[',GetWindowDebugReport(NewPixmap),']',
|
||||||
' NewWidth=',NewWidth,' NewHeight=',NewHeight);
|
' NewWidth='+dbgs(NewWidth),' NewHeight='+dbgs(NewHeight));
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
Result := False;
|
Result := False;
|
||||||
if SrcPixmap=nil then begin
|
if SrcPixmap=nil then begin
|
||||||
@ -1289,7 +1289,7 @@ begin
|
|||||||
|
|
||||||
// Creating PixBuf from pixmap
|
// Creating PixBuf from pixmap
|
||||||
{$IFDEF VerboseStretchCopyArea}
|
{$IFDEF VerboseStretchCopyArea}
|
||||||
DebugLn('ScalePixmap Creating PixBuf from pixmap SrcWhole=',SrcWholeWidth,',',SrcWholeHeight);
|
DebugLn('ScalePixmap Creating PixBuf from pixmap SrcWhole='+dbgs(SrcWholeWidth),','+dbgs(SrcWholeHeight));
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
ScaleSRC := gdk_pixbuf_get_from_drawable(nil,SrcPixmap,
|
ScaleSRC := gdk_pixbuf_get_from_drawable(nil,SrcPixmap,
|
||||||
SrcColorMap,0,0,SrcX,SrcY,SrcWidth,SrcHeight);
|
SrcColorMap,0,0,SrcX,SrcY,SrcWidth,SrcHeight);
|
||||||
@ -1301,10 +1301,10 @@ begin
|
|||||||
// Scaling PixBuf
|
// Scaling PixBuf
|
||||||
{$IFDEF VerboseStretchCopyArea}
|
{$IFDEF VerboseStretchCopyArea}
|
||||||
DebugLn('ScalePixmap Scaling PixBuf ',
|
DebugLn('ScalePixmap Scaling PixBuf ',
|
||||||
' Width=',gdk_pixbuf_get_width(ScaleSrc),
|
' Width='+dbgs(gdk_pixbuf_get_width(ScaleSrc)),
|
||||||
' Height=',gdk_pixbuf_get_height(ScaleSrc),
|
' Height='+dbgs(gdk_pixbuf_get_height(ScaleSrc)),
|
||||||
' HasAlpha=',gdk_pixbuf_get_has_alpha(ScaleSrc),
|
' HasAlpha='+dbgs(gdk_pixbuf_get_has_alpha(ScaleSrc)),
|
||||||
' RowStride=',gdk_pixbuf_get_rowstride(ScaleSrc),
|
' RowStride='+dbgs(gdk_pixbuf_get_rowstride(ScaleSrc)),
|
||||||
'');
|
'');
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
ScaleDest := gdk_pixbuf_scale_simple(ScaleSRC,NewWidth,NewHeight,ScaleMethod);
|
ScaleDest := gdk_pixbuf_scale_simple(ScaleSRC,NewWidth,NewHeight,ScaleMethod);
|
||||||
@ -1318,10 +1318,10 @@ begin
|
|||||||
// Creating pixmap from scaled pixbuf
|
// Creating pixmap from scaled pixbuf
|
||||||
{$IFDEF VerboseStretchCopyArea}
|
{$IFDEF VerboseStretchCopyArea}
|
||||||
DebugLn('ScalePixmap Creating pixmap from scaled pixbuf',
|
DebugLn('ScalePixmap Creating pixmap from scaled pixbuf',
|
||||||
' Width=',gdk_pixbuf_get_width(ScaleDest),
|
' Width='+dbgs(gdk_pixbuf_get_width(ScaleDest)),
|
||||||
' Height=',gdk_pixbuf_get_height(ScaleDest),
|
' Height='+dbgs(gdk_pixbuf_get_height(ScaleDest)),
|
||||||
' HasAlpha=',gdk_pixbuf_get_has_alpha(ScaleDest),
|
' HasAlpha='+dbgs(gdk_pixbuf_get_has_alpha(ScaleDest)),
|
||||||
' RowStride=',gdk_pixbuf_get_rowstride(ScaleDest),
|
' RowStride='+dbgs(gdk_pixbuf_get_rowstride(ScaleDest)),
|
||||||
'');
|
'');
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
DummyMask:=nil;
|
DummyMask:=nil;
|
||||||
@ -1338,7 +1338,7 @@ begin
|
|||||||
gdk_window_get_size(PGDKWindow(NewPixmap),@NewWholeWidth,@NewWholeHeight);
|
gdk_window_get_size(PGDKWindow(NewPixmap),@NewWholeWidth,@NewWholeHeight);
|
||||||
DebugLn('ScalePixmap RESULT NewPixmap=',DbgS(NewPixmap),
|
DebugLn('ScalePixmap RESULT NewPixmap=',DbgS(NewPixmap),
|
||||||
' DummyMask=',DbgS(DummyMask),
|
' DummyMask=',DbgS(DummyMask),
|
||||||
' NewWidth=',NewWholeWidth,' NewHeight=',NewWholeHeight,
|
' NewWidth='+dbgs(NewWholeWidth),' NewHeight='+dbgs(NewWholeHeight),
|
||||||
'');
|
'');
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
if DummyMask<>nil then gdk_pixmap_unref(DummyMask);
|
if DummyMask<>nil then gdk_pixmap_unref(DummyMask);
|
||||||
|
Loading…
Reference in New Issue
Block a user