mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-10 20:56:14 +02:00
Qt: trial to sppedup qt paintings through -dQtGraphicsSpeedUp
git-svn-id: trunk@12134 -
This commit is contained in:
parent
df48056fc0
commit
08ba2c42af
@ -294,6 +294,7 @@ type
|
||||
function getDeviceSize: TPoint;
|
||||
function getRegionType(ARegion: QRegionH): integer;
|
||||
function region: TQtRegion;
|
||||
procedure setClipping(const AValue: Boolean);
|
||||
procedure setClipRegion(ARegion: QRegionH; AOperation: QtClipOperation = QtReplaceClip);
|
||||
procedure setRegion(ARegion: TQtRegion);
|
||||
procedure drawImage(targetRect: PRect; image: QImageH; sourceRect: PRect; flags: QtImageConversionFlags = QtAutoColor);
|
||||
@ -1291,7 +1292,12 @@ begin
|
||||
Widget := QPainter_create(QPaintDeviceH(ParentPixmap));
|
||||
end
|
||||
else
|
||||
begin
|
||||
Widget := QPainter_create(QWidget_to_QPaintDevice(Parent));
|
||||
{$ifdef QtGraphicsSpeedUp}
|
||||
QPainter_setRenderHint(Widget, QPainterTextAntialiasing, False);
|
||||
{$endif}
|
||||
end;
|
||||
end;
|
||||
FOwnPainter := True;
|
||||
CreateObjects;
|
||||
@ -1939,6 +1945,11 @@ begin
|
||||
Result := vRegion;
|
||||
end;
|
||||
|
||||
procedure TQtDeviceContext.setClipping(const AValue: Boolean);
|
||||
begin
|
||||
QPainter_setClipping(Widget, AValue);
|
||||
end;
|
||||
|
||||
procedure TQtDeviceContext.setClipRegion(ARegion: QRegionH;
|
||||
AOperation: QtClipOperation = QtReplaceClip);
|
||||
begin
|
||||
|
@ -6178,7 +6178,7 @@ begin
|
||||
{$ifdef VerboseQt}
|
||||
WriteLn('TQtAbstractScrollArea.Create');
|
||||
{$endif}
|
||||
FViewPortWidget := NiL;
|
||||
FViewPortWidget := niL;
|
||||
Result := QScrollArea_create();
|
||||
QWidget_setAttribute(Result, QtWA_NoMousePropagation);
|
||||
end;
|
||||
@ -6371,8 +6371,12 @@ begin
|
||||
|
||||
FillChar(AParams, SizeOf(AParams), #0);
|
||||
FViewPortWidget := TQtWidget.Create(LCLObject, AParams);
|
||||
{$ifdef QtGraphicsSpeedUp}
|
||||
QWidget_setAttribute(Widget, QtWA_OpaquePaintEvent);
|
||||
QWidget_setBackgroundRole(FViewPortWidget.Widget, QPaletteNoRole);
|
||||
{$endif}
|
||||
FViewPortWidget.AttachEvents;
|
||||
|
||||
|
||||
QAbstractScrollArea_setViewport(QAbstractScrollAreaH(Widget), FViewPortWidget.Widget);
|
||||
end;
|
||||
|
||||
|
@ -99,6 +99,7 @@ begin
|
||||
//Write('>>> Setting Paint ClipRegion: ');
|
||||
//DebugRegion('PaintData.ClipRegion: ', Widget.PaintData.ClipRegion);
|
||||
DC.setClipRegion(Widget.PaintData.ClipRegion);
|
||||
DC.setClipping(True);
|
||||
end;
|
||||
if Widget.PaintData.ClipRect <> nil then
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user