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