mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-04 19:00:27 +02:00
VirtualTreeView: fix building with Qt4 widgetset on non-x86 platforms (unify with Qt5 and Qt6 widgetsets), issue #40431
(cherry picked from commit b101a75d7e
)
This commit is contained in:
parent
d25e9d67fe
commit
a1765f403b
@ -1,7 +1,9 @@
|
|||||||
uses
|
uses
|
||||||
qt4, qtobjects;
|
qt4, qtobjects;
|
||||||
|
|
||||||
{$ASMMODE INTEL}
|
{$if Defined(CPU386)}
|
||||||
|
{$ASMMODE INTEL}
|
||||||
|
{$endif}
|
||||||
|
|
||||||
procedure AlphaBlendLineConstant(Source, Destination: Pointer; Count: Integer; ConstantAlpha, Bias: Integer);
|
procedure AlphaBlendLineConstant(Source, Destination: Pointer; Count: Integer; ConstantAlpha, Bias: Integer);
|
||||||
|
|
||||||
@ -10,7 +12,11 @@ procedure AlphaBlendLineConstant(Source, Destination: Pointer; Count: Integer; C
|
|||||||
// ConstantAlpha must be in the range 0..255 where 0 means totally transparent (destination pixel only)
|
// ConstantAlpha must be in the range 0..255 where 0 means totally transparent (destination pixel only)
|
||||||
// and 255 totally opaque (source pixel only).
|
// and 255 totally opaque (source pixel only).
|
||||||
// Bias is an additional value which gets added to every component and must be in the range -128..127
|
// Bias is an additional value which gets added to every component and must be in the range -128..127
|
||||||
|
{$if not Defined(CPU386)}
|
||||||
|
begin
|
||||||
|
|
||||||
|
end;
|
||||||
|
{$else}
|
||||||
asm
|
asm
|
||||||
|
|
||||||
{$ifdef CPU64}
|
{$ifdef CPU64}
|
||||||
@ -168,6 +174,7 @@ asm
|
|||||||
POP ESI
|
POP ESI
|
||||||
{$endif}
|
{$endif}
|
||||||
end;
|
end;
|
||||||
|
{$endif}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -176,7 +183,11 @@ procedure AlphaBlendLinePerPixel(Source, Destination: Pointer; Count, Bias: Inte
|
|||||||
// Blends a line of Count pixels from Source to Destination using the alpha value of the source pixels.
|
// Blends a line of Count pixels from Source to Destination using the alpha value of the source pixels.
|
||||||
// The layout of a pixel must be BGRA.
|
// The layout of a pixel must be BGRA.
|
||||||
// Bias is an additional value which gets added to every component and must be in the range -128..127
|
// Bias is an additional value which gets added to every component and must be in the range -128..127
|
||||||
|
{$if not Defined(CPU386)}
|
||||||
|
begin
|
||||||
|
|
||||||
|
end;
|
||||||
|
{$else}
|
||||||
asm
|
asm
|
||||||
|
|
||||||
{$ifdef CPU64}
|
{$ifdef CPU64}
|
||||||
@ -327,6 +338,7 @@ asm
|
|||||||
POP ESI
|
POP ESI
|
||||||
{$endif}
|
{$endif}
|
||||||
end;
|
end;
|
||||||
|
{$endif}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -336,7 +348,11 @@ procedure AlphaBlendLineMaster(Source, Destination: Pointer; Count: Integer; Con
|
|||||||
// The layout of a pixel must be BGRA.
|
// The layout of a pixel must be BGRA.
|
||||||
// ConstantAlpha must be in the range 0..255.
|
// ConstantAlpha must be in the range 0..255.
|
||||||
// Bias is an additional value which gets added to every component and must be in the range -128..127
|
// Bias is an additional value which gets added to every component and must be in the range -128..127
|
||||||
|
{$if not Defined(CPU386)}
|
||||||
|
begin
|
||||||
|
|
||||||
|
end;
|
||||||
|
{$else}
|
||||||
asm
|
asm
|
||||||
|
|
||||||
{$ifdef CPU64}
|
{$ifdef CPU64}
|
||||||
@ -511,7 +527,7 @@ asm
|
|||||||
POP ESI
|
POP ESI
|
||||||
{$endif}
|
{$endif}
|
||||||
end;
|
end;
|
||||||
|
{$endif}
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
procedure AlphaBlendLineMasterAndColor(Destination: Pointer; Count: Integer; ConstantAlpha, Color: Integer);
|
procedure AlphaBlendLineMasterAndColor(Destination: Pointer; Count: Integer; ConstantAlpha, Color: Integer);
|
||||||
@ -519,7 +535,11 @@ procedure AlphaBlendLineMasterAndColor(Destination: Pointer; Count: Integer; Con
|
|||||||
// Blends a line of Count pixels in Destination against the given color using a constant alpha value.
|
// Blends a line of Count pixels in Destination against the given color using a constant alpha value.
|
||||||
// The layout of a pixel must be BGRA and Color must be rrggbb00 (as stored by a COLORREF).
|
// The layout of a pixel must be BGRA and Color must be rrggbb00 (as stored by a COLORREF).
|
||||||
// ConstantAlpha must be in the range 0..255.
|
// ConstantAlpha must be in the range 0..255.
|
||||||
|
{$if not Defined(CPU386)}
|
||||||
|
begin
|
||||||
|
|
||||||
|
end;
|
||||||
|
{$else}
|
||||||
asm
|
asm
|
||||||
|
|
||||||
{$ifdef CPU64}
|
{$ifdef CPU64}
|
||||||
@ -649,10 +669,16 @@ asm
|
|||||||
JNZ @1
|
JNZ @1
|
||||||
{$endif}
|
{$endif}
|
||||||
end;
|
end;
|
||||||
|
{$endif}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
procedure EMMS;
|
procedure EMMS;
|
||||||
|
{$if not Defined(CPU386)}
|
||||||
|
begin
|
||||||
|
|
||||||
|
end;
|
||||||
|
{$else}
|
||||||
|
|
||||||
// Reset MMX state to use the FPU for other tasks again.
|
// Reset MMX state to use the FPU for other tasks again.
|
||||||
|
|
||||||
@ -667,6 +693,7 @@ asm
|
|||||||
DB $0F, $77 /// EMMS
|
DB $0F, $77 /// EMMS
|
||||||
end;
|
end;
|
||||||
{$endif}
|
{$endif}
|
||||||
|
{$endif}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -758,13 +785,13 @@ var
|
|||||||
SourceHeight,
|
SourceHeight,
|
||||||
DestWidth,
|
DestWidth,
|
||||||
DestHeight: Integer;
|
DestHeight: Integer;
|
||||||
{$ifdef CPU64}
|
{$IFDEF CPU64}
|
||||||
ATransform: QTransformH;
|
ATransform: QTransformH;
|
||||||
DX, DY: QReal;
|
DX, DY: QReal;
|
||||||
AColor: QColorH;
|
AColor: QColorH;
|
||||||
ADst: TQtDeviceContext absolute Destination;
|
ADst: TQtDeviceContext absolute Destination;
|
||||||
AFillColor: TQColor;
|
AFillColor: TQColor;
|
||||||
{$endif}
|
{$ENDIF}
|
||||||
|
|
||||||
//BlendColor: TQColor;
|
//BlendColor: TQColor;
|
||||||
begin
|
begin
|
||||||
@ -844,7 +871,6 @@ begin
|
|||||||
R.Right - R.Left, R.Bottom - R.Top, @BlendColor);
|
R.Right - R.Left, R.Bottom - R.Top, @BlendColor);
|
||||||
}
|
}
|
||||||
// Source is ignored since there is a constant color value.
|
// Source is ignored since there is a constant color value.
|
||||||
|
|
||||||
{$IFDEF CPU64}
|
{$IFDEF CPU64}
|
||||||
if ADst <> nil then
|
if ADst <> nil then
|
||||||
begin
|
begin
|
||||||
@ -860,7 +886,6 @@ begin
|
|||||||
QColor_destroy(AColor);
|
QColor_destroy(AColor);
|
||||||
end;
|
end;
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
|
|
||||||
DestBits := GetBitmapBitsFromDeviceContext(Destination, DestWidth, DestHeight);
|
DestBits := GetBitmapBitsFromDeviceContext(Destination, DestWidth, DestHeight);
|
||||||
if Assigned(DestBits) then
|
if Assigned(DestBits) then
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user